Fixes #3843: GPS logging in decimal degrees format. Companion export to Google Earth fixed.

This commit is contained in:
Damjan Adamic
2016-10-05 17:57:02 +02:00
parent 5864834661
commit 5157a9f33c
4 changed files with 70 additions and 53 deletions
+8 -3
View File
@@ -305,10 +305,15 @@ void logsWrite()
TelemetryItem & telemetryItem = telemetryItems[i];
if (sensor.logs) {
if (sensor.unit == UNIT_GPS) {
if (telemetryItem.gps.longitude && telemetryItem.gps.latitude)
f_printf(&g_oLogFile, "%f %f,", float(telemetryItem.gps.longitude)/1000000, float(telemetryItem.gps.latitude)/1000000);
else
if (telemetryItem.gps.longitude && telemetryItem.gps.latitude) {
div_t qr = div(telemetryItem.gps.latitude, 1000000);
f_printf(&g_oLogFile, "%d.%06d ", qr.quot, abs(qr.rem));
qr = div(telemetryItem.gps.longitude, 1000000);
f_printf(&g_oLogFile, "%d.%06d,", qr.quot, abs(qr.rem));
}
else {
f_printf(&g_oLogFile, ",");
}
}
else if (sensor.unit == UNIT_DATETIME) {
if (telemetryItem.datetime.datestate)