altosuilib: Don't display pad, last location in flight stats without gps
authorKeith Packard <keithp@keithp.com>
Tue, 13 Jun 2017 04:47:05 +0000 (21:47 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 13 Jun 2017 04:47:05 +0000 (21:47 -0700)
Check stats.have_gps before displaying pad and last known location values.

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

index 70a5611049e1b569dc5a4b66871e66560d44fcbe..d88383b8da78824b83a52a2f7184120c7ab9e1da 100644 (file)
@@ -194,12 +194,12 @@ public class AltosFlightStatsTable extends JComponent implements AltosFontListen
                if (stats.state_start[AltosLib.ao_flight_boost] < stats.state_start[AltosLib.ao_flight_landed])
                        new FlightStat(layout, y++, "Flight time",
                                       String.format("%6.1f s", stats.landed_time - stats.boost_time));
-               if (stats.pad_lat != AltosLib.MISSING) {
+               if (stats.has_gps && stats.pad_lat != AltosLib.MISSING) {
                        new FlightStat(layout, y++, "Pad location",
                                       pos(stats.pad_lat,"N","S"),
                                       pos(stats.pad_lon,"E","W"));
                }
-               if (stats.lat != AltosLib.MISSING) {
+               if (stats.has_gps && stats.lat != AltosLib.MISSING) {
                        new FlightStat(layout, y++, "Last reported location",
                                       pos(stats.lat,"N","S"),
                                       pos(stats.lon,"E","W"));