altosui: Adapt to flight stats time value changes
authorKeith Packard <keithp@keithp.com>
Sun, 23 Jul 2017 23:38:09 +0000 (16:38 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 23 Jul 2017 23:42:35 +0000 (16:42 -0700)
There aren't state time values anymore as those don't work when you
have multiple motors. Instead, 'boost_time' is when the rocket left
the pad and 'landed_time' is when it touched down. Use these new
values in the --summary output.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosUI.java

index 2659173..a5a2078 100644 (file)
@@ -520,11 +520,12 @@ public class AltosUI extends AltosUIFrame {
                        System.out.printf("Main rate:   %6.0f m/s  %6.0f ft/s\n",
                                          stats.state_speed[Altos.ao_flight_main],
                                          AltosConvert.meters_to_feet(stats.state_speed[Altos.ao_flight_main]));
-               if (stats.state_end[Altos.ao_flight_main] != AltosLib.MISSING &&
-                   stats.state_start[Altos.ao_flight_boost] != AltosLib.MISSING)
+               if (stats.landed_time != AltosLib.MISSING &&
+                   stats.boost_time != AltosLib.MISSING &&
+                   stats.landed_time > stats.boost_time)
                        System.out.printf("Flight time: %6.0f s\n",
-                                         stats.state_end[Altos.ao_flight_main] -
-                                         stats.state_start[Altos.ao_flight_boost]);
+                                         stats.landed_time -
+                                         stats.boost_time);
                System.out.printf("\n");
                return true;
        }