Skip to content

Commit b5e0114

Browse files
committed
added logging when parsing map.
1 parent f1dad45 commit b5e0114

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/src/gui/brown/kiwisdr_map.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ struct KiwiSDRMapSelector {
8181
serversList = loadServersList();
8282

8383
if (serversList) {
84+
int totallyParsed = 0;
8485
for (const auto& entry : *serversList) {
8586
ServerEntry serverEntry;
8687

@@ -90,8 +91,13 @@ struct KiwiSDRMapSelector {
9091

9192
if (entry["offline"].get<std::string>() == "no") {
9293
std::string gps_str = entry["gps"].get<std::string>();
93-
geomap::GeoCoordinates geo;
94+
geomap::GeoCoordinates geo = {0.0, 0.0};
9495
sscanf(gps_str.c_str(), "(%lf, %lf)", &geo.latitude, &geo.longitude);
96+
if (geo.latitude == 0 || geo.longitude == 0) {
97+
flog::warn("Parsing geo coordinates: \"{}\" => {},{}", gps_str, geo.latitude, geo.longitude);
98+
} else if (totallyParsed < 10) {
99+
flog::info("Parsing geo coordinates: \"{}\" => {},{}", gps_str, geo.latitude, geo.longitude);
100+
}
95101
serverEntry.gps = geomap::geoToCartesian(geo).toImVec2();
96102
serverEntry.name = entry["name"].get<std::string>();
97103
serverEntry.loc = entry["loc"].get<std::string>();
@@ -103,9 +109,11 @@ struct KiwiSDRMapSelector {
103109
serverEntry.users = atoi(entry["users"].get<std::string>().c_str());
104110
serverEntry.usersmax = atoi(entry["users_max"].get<std::string>().c_str());
105111
servers.push_back(serverEntry);
112+
totallyParsed++;
106113
}
107114
}
108115
}
116+
flog::info("Parsed {} servers",totallyParsed);
109117
}
110118

111119
std::sort(servers.begin(), servers.end(), [](const ServerEntry& a, const ServerEntry& b) {

0 commit comments

Comments
 (0)