summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b2aa689)
While reading eeprom files, the GPS record is reconstructed each time
the system sees the first GPS log item (the time field), but as the
date isn't repeated, we need to copy it from the old GPS data record.
Signed-off-by: Keith Packard <keithp@keithp.com>
if (last_reported)
return null;
last_reported = true;
if (last_reported)
return null;
last_reported = true;
+ return new AltosRecord(state);
}
record = record_iterator.next();
}
record = record_iterator.next();
break;
case Altos.AO_LOG_GPS_TIME:
gps_tick = state.tick;
break;
case Altos.AO_LOG_GPS_TIME:
gps_tick = state.tick;
+ AltosGPS old = state.gps;
state.gps = new AltosGPS();
state.gps = new AltosGPS();
+
+ /* GPS date doesn't get repeated through the file */
+ if (old != null) {
+ state.gps.year = old.year;
+ state.gps.month = old.month;
+ state.gps.day = old.day;
+ }
state.gps.hour = (record.a & 0xff);
state.gps.minute = (record.a >> 8);
state.gps.second = (record.b & 0xff);
state.gps.hour = (record.a & 0xff);
state.gps.minute = (record.a >> 8);
state.gps.second = (record.b & 0xff);
}
break;
case Altos.AO_LOG_GPS_DATE:
}
break;
case Altos.AO_LOG_GPS_DATE:
- state.gps.year = record.a & 0xff;
+ state.gps.year = (record.a & 0xff) + 2000;
state.gps.month = record.a >> 8;
state.gps.day = record.b & 0xff;
break;
state.gps.month = record.a >> 8;
state.gps.day = record.b & 0xff;
break;
AltosOrderedRecord record = new AltosOrderedRecord(line, index++, tick);
if (record == null)
break;
AltosOrderedRecord record = new AltosOrderedRecord(line, index++, tick);
if (record == null)
break;
+ if (record.cmd == Altos.AO_LOG_INVALID)
+ continue;
tick = record.tick;
if (!saw_boost && record.cmd == Altos.AO_LOG_STATE &&
record.a >= Altos.ao_flight_boost)
tick = record.tick;
if (!saw_boost && record.cmd == Altos.AO_LOG_STATE &&
record.a >= Altos.ao_flight_boost)