altos: Rename telemetry to telemetry_orig
[fw/altos] / altosui / AltosGraphUI.java
index cd158651402d2634e4763015c1d36214b7899fb4..4b994b4775cafd84ddadc4a0d6cc4211cdd9ab6b 100644 (file)
@@ -35,7 +35,7 @@ public class AltosGraphUI extends JFrame
         AltosGraphTime.Element speed =
             new AltosGraphTime.TimeSeries("Speed (m/s)", "Vertical Speed", green) { 
                 public void gotTimeData(double time, AltosDataPoint d) {
-                    if (d.state() < Altos.ao_flight_drogue) {
+                   if (d.state() < Altos.ao_flight_drogue && d.has_accel()) {
                         series.add(time, d.accel_speed());
                     } else {
                         series.add(time, d.baro_speed());
@@ -96,10 +96,14 @@ public class AltosGraphUI extends JFrame
         public ArrayList<AltosGraph> graphs() {
             ArrayList<AltosGraph> graphs = new ArrayList<AltosGraph>();
     
-            graphs.add( myAltosGraphTime("Summary")
-                    .addElement(height)
-                    .addElement(speed)
-                    .addElement(acceleration) );
+           graphs.add( myAltosGraphTime("Summary")
+                       .addElement(height)
+                       .addElement(speed)
+                       .addElement(acceleration) );
+
+           graphs.add( myAltosGraphTime("Summary")
+                       .addElement(height)
+                       .addElement(speed));
     
             graphs.add( myAltosGraphTime("Altitude")
                     .addElement(height) );
@@ -107,15 +111,15 @@ public class AltosGraphUI extends JFrame
             graphs.add( myAltosGraphTime("Speed")
                     .addElement(speed) );
     
-            graphs.add( myAltosGraphTime("Acceleration")
-                    .addElement(acceleration) );
+           graphs.add( myAltosGraphTime("Acceleration")
+                       .addElement(acceleration) );
     
             graphs.add( myAltosGraphTime("Temperature")
                     .addElement(temperature) );
     
-            graphs.add( myAltosGraphTime("Continuity")
-                    .addElement(drogue_voltage)
-                    .addElement(main_voltage) );
+           graphs.add( myAltosGraphTime("Continuity")
+                       .addElement(drogue_voltage)
+                       .addElement(main_voltage) );
     
             return graphs;
         }
@@ -154,20 +158,23 @@ public class AltosGraphUI extends JFrame
        public AltosGraphUI(AltosRecordIterable records) {
                super("Altos Graph");
 
-               Iterable<AltosDataPoint> reader = new AltosDataPointReader (records);
+               AltosDataPointReader reader = new AltosDataPointReader (records);
                if (reader == null)
                        return;
         
-               init(reader, 0);
+               if (reader.has_accel)
+                       init(reader, 0);
+               else
+                       init(reader, 1);
        }
 
-    public AltosGraphUI(Iterable<AltosDataPoint> data, int which) 
+    public AltosGraphUI(AltosDataPointReader data, int which)
     {
         super("Altos Graph");
         init(data, which);
     }
 
-    private void init(Iterable<AltosDataPoint> data, int which) {
+    private void init(AltosDataPointReader data, int which) {
         AltosGraph graph = createGraph(data, which);
 
         JFreeChart chart = graph.createChart();