altosui: Record flight number when scanning file, not when running
[fw/altos] / ao-tools / altosui / AltosEepromReader.java
index ac54ff4472344ffa07e59932ef36514bbd5c9998..86bbaee0cde2a9640b768aca0f17a428032cc941 100644 (file)
@@ -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