altosui: Show GPS max height in flight stats window of graph
authorKeith Packard <keithp@keithp.com>
Sat, 25 Jan 2014 06:40:49 +0000 (22:40 -0800)
committerKeith Packard <keithp@keithp.com>
Sat, 25 Jan 2014 06:40:49 +0000 (22:40 -0800)
Uses the new state.max_gps_height() function.#

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

index bf5644c39888a26940df8fbb866836fe5ad32968..0be49c2fb82167890ab9da39f363fc2f8c2f0fca 100644 (file)
@@ -22,6 +22,7 @@ import org.altusmetrum.altoslib_3.*;
 
 public class AltosFlightStats {
        double          max_height;
+       double          max_gps_height;
        double          max_speed;
        double          max_acceleration;
        double[]        state_speed = new double[Altos.ao_flight_invalid + 1];
@@ -153,6 +154,7 @@ public class AltosFlightStats {
                                max_height = state.max_height();
                                max_speed = state.max_speed();
                                max_acceleration = state.max_acceleration();
+                               max_gps_height = state.max_gps_height();
                        }
                        if (state.gps != null && state.gps.locked && state.gps.nsat >= 4) {
                                if (state_id <= Altos.ao_flight_pad) {
index 3e7e9fe11c5737878798985b5e73262aeba30dbc..cb0c1562bf7b73c95ad2cdb123ac600e5aab7eab 100644 (file)
@@ -91,6 +91,11 @@ public class AltosFlightStatsTable extends JComponent {
                new FlightStat(layout, y++, "Maximum height",
                               String.format("%5.0f m", stats.max_height),
                               String.format("%5.0f ft", AltosConvert.meters_to_feet(stats.max_height)));
+               if (stats.max_gps_height != AltosLib.MISSING) {
+                       new FlightStat(layout, y++, "Maximum GPS height",
+                                      String.format("%5.0f m", stats.max_gps_height),
+                                      String.format("%5.0f ft", AltosConvert.meters_to_feet(stats.max_gps_height)));
+               }
                new FlightStat(layout, y++, "Maximum speed",
                               String.format("%5.0f m/s", stats.max_speed),
                               String.format("%5.0f mph", AltosConvert.meters_to_mph(stats.max_speed)),