int current_tick = 0;
int boost_tick = 0;
+ AltosRecord previous = null;
records = new LinkedList<AltosRecord> ();
try {
break;
}
try {
- AltosTelemetry record = new AltosTelemetry(line);
+ AltosRecord record = AltosTelemetry.parse(line, previous);
if (record == null)
break;
if (records.isEmpty()) {
has_gps = true;
if (record.main != AltosRecord.MISSING)
has_ignite = true;
- records.add(record);
+ if (previous != null && previous.tick != record.tick)
+ records.add(previous);
+ previous = record;
} catch (ParseException pe) {
System.out.printf("parse exception %s\n", pe.getMessage());
} catch (AltosCRCException ce) {
System.out.printf("io exception\n");
}
+ if (previous != null)
+ records.add(previous);
+
/* adjust all tick counts to be relative to boost time */
for (AltosRecord r : this)
r.time = (r.tick - boost_tick) / 100.0;