kopia lustrzana https://gitlab.com/tomaszg/geostat
Protect OCpl only features like FTF and trails with if, so they don't appear for other users
rodzic
91d250cb3a
commit
277cdc058e
113
geostat.cpp
113
geostat.cpp
|
@ -914,69 +914,70 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
n = 1;
|
||||
if (!ocpl_user_uuid.empty()) {
|
||||
n = 1;
|
||||
|
||||
std::cout << "<h2>Power trails (by completion percentage)</h2>\n";
|
||||
std::cout << "<table class=\"list\">\n";
|
||||
std::cout << "<tr><th></th>";
|
||||
std::cout << "<th>Trail</th>";
|
||||
// std::cout << "<th>Type</th>";
|
||||
std::cout << "<th>Caches</th>";
|
||||
std::cout << "<th>Found</th>";
|
||||
std::cout << "<th>Treshold</th>";
|
||||
std::cout << "</tr>\n";
|
||||
|
||||
for (auto& i : tt) {
|
||||
if (i->completed)
|
||||
std::cout << "<tr class=\"highlight\">";
|
||||
else
|
||||
std::cout << "<tr>";
|
||||
std::cout << "<th>" << n << "</th> ";
|
||||
std::cout << "<td>" << i->link_name() << "</td>";
|
||||
// std::cout << "<td>" << i->type << "</td>";
|
||||
std::cout << "<td>" << i->caches.size() << "</td>";
|
||||
std::cout << "<td>" << i->found << "</td>";
|
||||
std::cout << "<td>" << (100 * i->found / i->caches.size()) << "% / " << i->treshold_perc << "%</td>";
|
||||
std::cout << "<h2>Power trails (by completion percentage)</h2>\n";
|
||||
std::cout << "<table class=\"list\">\n";
|
||||
std::cout << "<tr><th></th>";
|
||||
std::cout << "<th>Trail</th>";
|
||||
// std::cout << "<th>Type</th>";
|
||||
std::cout << "<th>Caches</th>";
|
||||
std::cout << "<th>Found</th>";
|
||||
std::cout << "<th>Treshold</th>";
|
||||
std::cout << "</tr>\n";
|
||||
n++;
|
||||
// if (n > LIST_MAX) break;
|
||||
}
|
||||
std::cout << "</table>\n";
|
||||
|
||||
// show_histogram(tt, "Power trails (completion percentage)", 1);
|
||||
std::cout << "<div class=\"basic_stats\">\n";
|
||||
std::cout << "Number of completed power trails: <span class=\"value\">" << std::count_if(tt.begin(), tt.end(), [&](const auto& a) { return a->completed; }) << "</span><br>\n";
|
||||
std::cout << "Number of started power trails: <span class=\"value\">" << tt.size() << "</span><br>\n";
|
||||
std::cout << "</div>\n";
|
||||
for (auto& i : tt) {
|
||||
if (i->completed)
|
||||
std::cout << "<tr class=\"highlight\">";
|
||||
else
|
||||
std::cout << "<tr>";
|
||||
std::cout << "<th>" << n << "</th> ";
|
||||
std::cout << "<td>" << i->link_name() << "</td>";
|
||||
// std::cout << "<td>" << i->type << "</td>";
|
||||
std::cout << "<td>" << i->caches.size() << "</td>";
|
||||
std::cout << "<td>" << i->found << "</td>";
|
||||
std::cout << "<td>" << (100 * i->found / i->caches.size()) << "% / " << i->treshold_perc << "%</td>";
|
||||
std::cout << "</tr>\n";
|
||||
n++;
|
||||
// if (n > LIST_MAX) break;
|
||||
}
|
||||
std::cout << "</table>\n";
|
||||
|
||||
std::cout << "<h2>FTF</h2>\n";
|
||||
std::cout << "<table class=\"list\">\n";
|
||||
std::cout << "<tr><th></th>";
|
||||
std::cout << "<th>Cache</th>";
|
||||
std::cout << "<th>Type</th>";
|
||||
std::cout << "<th>Region</th>";
|
||||
std::cout << "<th>Date hidden</th>";
|
||||
std::cout << "<th>Finds</th>";
|
||||
std::cout << "</tr>\n";
|
||||
// show_histogram(tt, "Power trails (completion percentage)", 1);
|
||||
std::cout << "<div class=\"basic_stats\">\n";
|
||||
std::cout << "Number of completed power trails: <span class=\"value\">" << std::count_if(tt.begin(), tt.end(), [&](const auto& a) { return a->completed; }) << "</span><br>\n";
|
||||
std::cout << "Number of started power trails: <span class=\"value\">" << tt.size() << "</span><br>\n";
|
||||
std::cout << "</div>\n";
|
||||
|
||||
n = 1;
|
||||
|
||||
for (auto i : caches_ftf) {
|
||||
std::cout << "<tr><th>" << n << "</th> ";
|
||||
std::cout << "<td>" << i->link_name() << "</td>";
|
||||
std::cout << "<td>" << i->type << "</td>";
|
||||
std::cout << "<td>" << i->region << "</td>";
|
||||
std::cout << "<td>" << i->date_hidden << "</td>";
|
||||
std::cout << "<td>" << i->founds << "</td>";
|
||||
std::cout << "<h2>FTF</h2>\n";
|
||||
std::cout << "<table class=\"list\">\n";
|
||||
std::cout << "<tr><th></th>";
|
||||
std::cout << "<th>Cache</th>";
|
||||
std::cout << "<th>Type</th>";
|
||||
std::cout << "<th>Region</th>";
|
||||
std::cout << "<th>Date hidden</th>";
|
||||
std::cout << "<th>Finds</th>";
|
||||
std::cout << "</tr>\n";
|
||||
n++;
|
||||
// if (n > LIST_MAX) break;
|
||||
|
||||
n = 1;
|
||||
|
||||
for (auto i : caches_ftf) {
|
||||
std::cout << "<tr><th>" << n << "</th> ";
|
||||
std::cout << "<td>" << i->link_name() << "</td>";
|
||||
std::cout << "<td>" << i->type << "</td>";
|
||||
std::cout << "<td>" << i->region << "</td>";
|
||||
std::cout << "<td>" << i->date_hidden << "</td>";
|
||||
std::cout << "<td>" << i->founds << "</td>";
|
||||
std::cout << "</tr>\n";
|
||||
n++;
|
||||
// if (n > LIST_MAX) break;
|
||||
}
|
||||
std::cout << "</table>\n";
|
||||
std::cout << "<div class=\"basic_stats\">\n";
|
||||
std::cout << "Number of FTFs: <span class=\"value\">" << caches_ftf.size() << "</span><br>\n";
|
||||
std::cout << "</div>\n";
|
||||
}
|
||||
std::cout << "</table>\n";
|
||||
std::cout << "<div class=\"basic_stats\">\n";
|
||||
// std::cout << "Number of FTFs: <span class=\"value\">" << std::count_if(cc.begin(), cc.end(), [&](const auto& a) { return a.ftf; }) << "</span><br>\n";
|
||||
std::cout << "Number of FTFs: <span class=\"value\">" << caches_ftf.size() << "</span><br>\n";
|
||||
std::cout << "</div>\n";
|
||||
} // end of main if
|
||||
|
||||
if (get_not_found) {
|
||||
|
|
Ładowanie…
Reference in New Issue