first cut at turnon scripts for EasyTimer v2
[fw/altos] / altosuilib / AltosGraph.java
index c4a49d683cfa16d65b9d8ab53c720e2436ed1863..46dc80f36e02b56defd2fa5a99d0e430c8a04bfe 100644 (file)
@@ -88,18 +88,32 @@ public class AltosGraph extends AltosUIGraph {
        static final private AltosUILineStyle mag_through_color = new AltosUILineStyle();
        static final private AltosUILineStyle mag_total_color = new AltosUILineStyle();
 
+       static final private AltosUILineStyle motor_pressure_color = new AltosUILineStyle();
+
        static AltosUnits dop_units = null;
        static AltosUnits tick_units = null;
 
        AltosUIFlightSeries flight_series;
 
+       boolean enable_axis(int product_id, String label) {
+               switch (product_id) {
+               case AltosLib.product_easymotor:
+                       return(label.equals(AltosUIFlightSeries.motor_pressure_name) ||
+                              label.equals(AltosUIFlightSeries.accel_name));
+               default:
+                       return true;
+               }
+       }
+
        AltosUITimeSeries[] setup(AltosFlightStats stats, AltosUIFlightSeries flight_series) {
                AltosCalData    cal_data = flight_series.cal_data();
+               int             product_id = cal_data.device_type;
 
                AltosUIAxis     height_axis, speed_axis, accel_axis, voltage_axis, temperature_axis, nsat_axis, dbm_axis;
                AltosUIAxis     pressure_axis, thrust_axis;
                AltosUIAxis     gyro_axis, orient_axis, mag_axis;
                AltosUIAxis     course_axis, dop_axis, tick_axis;
+               AltosUIAxis     motor_pressure_axis;
 
                if (stats != null && stats.serial != AltosLib.MISSING && stats.product != null && stats.flight != AltosLib.MISSING)
                        setName(String.format("%s %d flight %d\n", stats.product, stats.serial, stats.flight));
@@ -122,6 +136,8 @@ public class AltosGraph extends AltosUIGraph {
                course_axis = newAxis("Course", AltosConvert.orient, gps_course_color, 0);
                dop_axis = newAxis("Dilution of Precision", dop_units, gps_pdop_color, 0);
 
+               motor_pressure_axis = newAxis("Motor Pressure", AltosConvert.pressure, motor_pressure_color, 0);
+
                flight_series.register_axis("default",
                                            speed_color,
                                            false,
@@ -129,7 +145,7 @@ public class AltosGraph extends AltosUIGraph {
 
                flight_series.register_marker(AltosUIFlightSeries.state_name,
                                              state_color,
-                                             true,
+                                             enable_axis(product_id, AltosUIFlightSeries.state_name),
                                              plot,
                                              true);
 
@@ -146,12 +162,12 @@ public class AltosGraph extends AltosUIGraph {
 
                flight_series.register_axis(AltosUIFlightSeries.accel_name,
                                            accel_color,
-                                           true,
+                                           enable_axis(product_id, AltosUIFlightSeries.accel_name),
                                            accel_axis);
 
                flight_series.register_axis(AltosUIFlightSeries.vert_accel_name,
                                            vert_accel_color,
-                                           true,
+                                           enable_axis(product_id, AltosUIFlightSeries.vert_accel_name),
                                            accel_axis);
 
                flight_series.register_axis(AltosUIFlightSeries.kalman_accel_name,
@@ -166,12 +182,12 @@ public class AltosGraph extends AltosUIGraph {
 
                flight_series.register_axis(AltosUIFlightSeries.speed_name,
                                            speed_color,
-                                           true,
+                                           enable_axis(product_id, AltosUIFlightSeries.speed_name),
                                            speed_axis);
 
                flight_series.register_axis(AltosUIFlightSeries.kalman_speed_name,
                                            kalman_speed_color,
-                                           true,
+                                           enable_axis(product_id, AltosUIFlightSeries.kalman_speed_name),
                                            speed_axis);
 
                flight_series.register_axis(AltosUIFlightSeries.pressure_name,
@@ -181,7 +197,7 @@ public class AltosGraph extends AltosUIGraph {
 
                flight_series.register_axis(AltosUIFlightSeries.height_name,
                                            height_color,
-                                           true,
+                                           enable_axis(product_id, AltosUIFlightSeries.height_name),
                                            height_axis);
 
                flight_series.register_axis(AltosUIFlightSeries.altitude_name,
@@ -342,7 +358,7 @@ public class AltosGraph extends AltosUIGraph {
 
                flight_series.register_axis(AltosUIFlightSeries.thrust_name,
                                            accel_color,
-                                           true,
+                                           enable_axis(product_id, AltosUIFlightSeries.thrust_name),
                                            thrust_axis);
 
                for (int channel = 0; channel < 8; channel++) {
@@ -352,6 +368,11 @@ public class AltosGraph extends AltosUIGraph {
                                                    voltage_axis);
                }
 
+               flight_series.register_axis(AltosUIFlightSeries.motor_pressure_name,
+                                           motor_pressure_color,
+                                           enable_axis(product_id, AltosUIFlightSeries.motor_pressure_name),
+                                           motor_pressure_axis);
+
                flight_series.check_axes();
 
                return flight_series.series(cal_data);