altosuilib: Remove 'cal_data' param from AltosGraphNew constructor
authorKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 06:34:18 +0000 (23:34 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 06:34:18 +0000 (23:34 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosGraphUI.java
altosuilib/AltosGraphNew.java

index 71aa0e6..9b47211 100644 (file)
@@ -99,7 +99,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt
 
                stats = new AltosFlightStats(flight_series);
 
-               graph = new AltosGraphNew(enable, stats, flight_series, cal_data);
+               graph = new AltosGraphNew(enable, stats, flight_series);
 
                statsTable = new AltosFlightStatsTable(stats);
 
index a9393f9..c0afd65 100644 (file)
@@ -82,7 +82,8 @@ public class AltosGraphNew extends AltosUIGraphNew {
 
        AltosUIFlightSeries flight_series;
 
-       AltosUITimeSeries[] setup(AltosFlightStats stats, AltosUIFlightSeries flight_series, AltosCalData cal_data) {
+       AltosUITimeSeries[] setup(AltosFlightStats stats, AltosUIFlightSeries flight_series) {
+               AltosCalData    cal_data = flight_series.cal_data;
 
                AltosUIAxis     height_axis, speed_axis, accel_axis, voltage_axis, temperature_axis, nsat_axis, dbm_axis;
                AltosUIAxis     distance_axis, pressure_axis, thrust_axis;
@@ -159,6 +160,11 @@ public class AltosGraphNew extends AltosUIGraphNew {
                                            true,
                                            height_axis);
 
+               flight_series.register_axis(AltosUIFlightSeries.altitude_name,
+                                           height_color,
+                                           false,
+                                           height_axis);
+
                flight_series.register_axis(AltosUIFlightSeries.kalman_height_name,
                                            kalman_height_color,
                                            false,
@@ -305,9 +311,16 @@ public class AltosGraphNew extends AltosUIGraphNew {
                return flight_series.series(cal_data);
        }
 
-       public AltosGraphNew(AltosUIEnable enable, AltosFlightStats stats, AltosUIFlightSeries flight_series, AltosCalData cal_data) {
+       public void set_data(AltosFlightStats stats, AltosUIFlightSeries flight_series) {
+               set_series(setup(stats, flight_series));
+       }
+
+       public AltosGraphNew(AltosUIEnable enable) {
                super(enable, "Flight");
+       }
 
-               set_series(setup(stats, flight_series, cal_data));
+       public AltosGraphNew(AltosUIEnable enable, AltosFlightStats stats, AltosUIFlightSeries flight_series) {
+               this(enable);
+               set_series(setup(stats, flight_series));
        }
 }