altoslib/altosui: Further AltosState transition work
[fw/altos] / altosui / AltosLanded.java
index 1d209bda8ccaa493371d104126efb2d1c6ca21c2..4cdaa3df795ac095a191304bf1d335f5fc5c9b2a 100644 (file)
@@ -103,7 +103,8 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio
 
        class Lat extends LandedValue {
                void show (AltosState state, AltosListenerState listener_state) {
-                       if (state.gps != null && state.gps.connected)
+                       show();
+                       if (state.gps != null && state.gps.connected && state.gps.lat != AltosRecord.MISSING)
                                show(pos(state.gps.lat,"N", "S"));
                        else
                                show("???");
@@ -118,7 +119,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio
        class Lon extends LandedValue {
                void show (AltosState state, AltosListenerState listener_state) {
                        show();
-                       if (state.gps != null && state.gps.connected)
+                       if (state.gps != null && state.gps.connected && state.gps.lon != AltosRecord.MISSING)
                                show(pos(state.gps.lon,"E", "W"));
                        else
                                show("???");
@@ -243,21 +244,18 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio
                        if (file != null) {
                                String  filename = file.getName();
                                try {
-                                       AltosRecordIterable records = null;
+                                       AltosStateIterable states = null;
                                        if (filename.endsWith("eeprom")) {
                                                FileInputStream in = new FileInputStream(file);
-                                               records = new AltosEepromIterable(in);
+                                               states = new AltosEepromFile(in);
                                        } else if (filename.endsWith("telem")) {
                                                FileInputStream in = new FileInputStream(file);
-                                               records = new AltosTelemetryIterable(in);
-                                       } else if (filename.endsWith("mega")) {
-                                               FileInputStream in = new FileInputStream(file);
-                                               records = new AltosEepromMegaIterable(in);
+                                               states = null; // new AltosTelemetryIterable(in);
                                        } else {
                                                throw new FileNotFoundException(filename);
                                        }
                                        try {
-                                               new AltosGraphUI(records, file);
+                                               new AltosGraphUI(states, file);
                                        } catch (InterruptedException ie) {
                                        } catch (IOException ie) {
                                        }