altoslib/altosui: Further AltosState transition work
[fw/altos] / altosui / AltosAscent.java
index f8435037e30eeb2eedb3d41cce1d82ad36a56220..ceba2d1d4fc3c1db32d7b54cd6afa4007f4a1490 100644 (file)
@@ -308,7 +308,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
 
        class Lat extends AscentValue {
                void show (AltosState state, AltosListenerState listener_state) {
-                       if (state.gps != null)
+                       if (state.gps != null && state.gps.connected && state.gps.lat != AltosRecord.MISSING)
                                show(pos(state.gps.lat,"N", "S"));
                        else
                                show("???");
@@ -322,7 +322,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
 
        class Lon extends AscentValue {
                void show (AltosState state, AltosListenerState listener_state) {
-                       if (state.gps != null)
+                       if (state.gps != null && state.gps.connected && state.gps.lon != AltosRecord.MISSING)
                                show(pos(state.gps.lon,"E", "W"));
                        else
                                show("???");