altosui: Hacks to plug into the new graph stuff
authorKeith Packard <keithp@keithp.com>
Fri, 12 May 2017 07:01:14 +0000 (00:01 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 20 May 2017 04:41:40 +0000 (21:41 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosGraphUI.java
altosui/AltosLanded.java
altosui/AltosUI.java

index 4ca2b77c3781856898654d72cdb828493c5ea764..50a1948ececfb4d107c8eb37ef41fc7b570f4f63 100644 (file)
@@ -34,7 +34,7 @@ import org.jfree.ui.RefineryUtilities;
 public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, AltosUnitsListener
 {
        JTabbedPane             pane;
 public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, AltosUnitsListener
 {
        JTabbedPane             pane;
-       AltosGraph              graph;
+       AltosGraphNew           graph;
        AltosUIEnable           enable;
        AltosUIMap              map;
        AltosState              state;
        AltosUIEnable           enable;
        AltosUIMap              map;
        AltosState              state;
@@ -69,7 +69,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
                        enable.units_changed(imperial_units);
        }
 
                        enable.units_changed(imperial_units);
        }
 
-       AltosGraphUI(AltosStateIterable states, File file) throws InterruptedException, IOException {
+       AltosGraphUI(AltosStateIterable states, AltosRecordSet record_set, File file) throws InterruptedException, IOException {
                super(file.getName());
                state = null;
 
                super(file.getName());
                state = null;
 
@@ -78,9 +78,9 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
                enable = new AltosUIEnable();
 
                stats = new AltosFlightStats(states);
                enable = new AltosUIEnable();
 
                stats = new AltosFlightStats(states);
-               graphDataSet = new AltosGraphDataSet(states);
+//             graphDataSet = new AltosGraphDataSet(states);
 
 
-               graph = new AltosGraph(enable, stats, graphDataSet);
+               graph = new AltosGraphNew(enable, stats, record_set);
 
                statsTable = new AltosFlightStatsTable(stats);
 
 
                statsTable = new AltosFlightStatsTable(stats);
 
index 25d4fcc80ea796ae88c63fabfdd426f90fef3e7d..95cab6051422e1eed05d4652194d6afc28499d30 100644 (file)
@@ -124,9 +124,11 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener {
                                String  filename = file.getName();
                                try {
                                        AltosStateIterable states = null;
                                String  filename = file.getName();
                                try {
                                        AltosStateIterable states = null;
+                                       AltosRecordSet record_set = null;
                                        if (filename.endsWith("eeprom")) {
                                                FileReader in = new FileReader(file);
                                                states = new AltosEepromFile(in);
                                        if (filename.endsWith("eeprom")) {
                                                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);
                                        } 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 {
                                                throw new FileNotFoundException(filename);
                                        }
                                        try {
-                                               new AltosGraphUI(states, file);
+                                               new AltosGraphUI(states, record_set, file);
                                        } catch (InterruptedException ie) {
                                        } catch (IOException ie) {
                                        }
                                        } catch (InterruptedException ie) {
                                        } catch (IOException ie) {
                                        }
index 72c3c161b4809042423330098ed5307ea1cf4e93..7caaa3e9a5107f067b02dc5584b42ab174de8072 100644 (file)
@@ -348,7 +348,7 @@ public class AltosUI extends AltosUIFrame {
                if (states == null)
                        return;
                try {
                if (states == null)
                        return;
                try {
-                       new AltosGraphUI(states, chooser.file());
+                       new AltosGraphUI(states, new AltosEepromRecordSet(new FileReader(chooser.file())), chooser.file());
                } catch (InterruptedException ie) {
                } catch (IOException ie) {
                }
                } catch (InterruptedException ie) {
                } catch (IOException ie) {
                }
@@ -487,7 +487,7 @@ public class AltosUI extends AltosUIFrame {
                if (states == null)
                        return false;
                try {
                if (states == null)
                        return false;
                try {
-                       new AltosGraphUI(states, file);
+                       new AltosGraphUI(states, new AltosEepromRecordSet(new FileReader(file)), file);
                        return true;
                } catch (InterruptedException ie) {
                } catch (IOException ie) {
                        return true;
                } catch (InterruptedException ie) {
                } catch (IOException ie) {