summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-09-05 01:52:36 -0700
committerKeith Packard <keithp@keithp.com>2010-09-05 01:52:36 -0700
commit6c653a4cba5fef8d49261cf1c024f3e86e9058c6 (patch)
tree2c041dbad9b34dcd9129e66f32db147d388081aa
parent38e1d87c8d449866faac026577fefa9a118428cb (diff)
altosui: Record flight number when scanning file, not when running
The very first record in the eeprom is the flight number, but it is time-stamped with the 'boost' time, and so it gets sorted until much later, delaying the return of data until the rocket enters boost mode. This drops all of the nice pad GPS and state date on the floor. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--ao-tools/altosui/AltosEepromReader.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/ao-tools/altosui/AltosEepromReader.java b/ao-tools/altosui/AltosEepromReader.java
index ac54ff44..86bbaee0 100644
--- a/ao-tools/altosui/AltosEepromReader.java
+++ b/ao-tools/altosui/AltosEepromReader.java
@@ -130,9 +130,7 @@ public class AltosEepromReader extends AltosReader {
state.tick = record.tick;
switch (record.cmd) {
case Altos.AO_LOG_FLIGHT:
- state.ground_accel = record.a;
- state.flight = record.b;
- seen |= seen_flight;
+ /* recorded when first read from the file */
break;
case Altos.AO_LOG_SENSOR:
state.accel = record.a;
@@ -351,6 +349,11 @@ public class AltosEepromReader extends AltosReader {
saw_boost = true;
boost_tick = tick;
}
+ if (record.cmd == Altos.AO_LOG_FLIGHT) {
+ state.ground_accel = record.a;
+ state.flight = record.b;
+ seen |= seen_flight;
+ }
/* Two firmware bugs caused the loss of some GPS data.
* The flight date would never be recorded, and often