altosui: Hacks to plug into the new graph stuff
[fw/altos] / altosui / AltosLanded.java
index ded085376fa3fb8ff35c302eaa17ba5b2e93b735..95cab6051422e1eed05d4652194d6afc28499d30 100644 (file)
@@ -124,9 +124,11 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener {
                                String  filename = file.getName();
                                try {
                                        AltosStateIterable states = null;
+                                       AltosRecordSet record_set = null;
                                        if (filename.endsWith("eeprom")) {
-                                               FileInputStream in = new FileInputStream(file);
+                                               FileReader in = new FileReader(file);
                                                states = new AltosEepromFile(in);
+                                               record_set = new AltosEepromRecordSet(new FileReader(file));
                                        } else if (filename.endsWith("telem")) {
                                                FileInputStream in = new FileInputStream(file);
                                                states = new AltosTelemetryFile(in);
@@ -134,7 +136,7 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener {
                                                throw new FileNotFoundException(filename);
                                        }
                                        try {
-                                               new AltosGraphUI(states, file);
+                                               new AltosGraphUI(states, record_set, file);
                                        } catch (InterruptedException ie) {
                                        } catch (IOException ie) {
                                        }
@@ -143,6 +145,11 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener {
                                                                      fe.getMessage(),
                                                                      "Cannot open file",
                                                                      JOptionPane.ERROR_MESSAGE);
+                               } catch (IOException ie) {
+                                       JOptionPane.showMessageDialog(null,
+                                                                     ie.getMessage(),
+                                                                     "Error reading file file",
+                                                                     JOptionPane.ERROR_MESSAGE);
                                }
                        }
                }