altosui: Handle missing GPS when graphing mega/metrum data
authorKeith Packard <keithp@keithp.com>
Tue, 12 Sep 2017 20:37:24 +0000 (13:37 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 12 Sep 2017 20:37:24 +0000 (13:37 -0700)
These have GPS, but if we never get a valid packet, then there won't
be any final position to display.

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

index f6c906c64fa78a1a14802b20d47914efcbbe7dab..042f9277c2cf40e8335d9b46d9f5bda727b7c9e1 100644 (file)
@@ -48,7 +48,6 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
 
                if (flight_series.gps_series != null) {
                        for (AltosGPSTimeValue gtv : flight_series.gps_series) {
-                               gtv_last = gtv;
                                AltosGPS gps = gtv.gps;
                                if (gps != null &&
                                    gps.locked &&
@@ -57,6 +56,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
                                                map = new AltosUIMap();
                                        map.show(gps, (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time));
                                        this.gps = gps;
+                                       gtv_last = gtv;
                                        has_gps = true;
                                }
                        }