From: Keith Packard Date: Fri, 28 Oct 2022 04:00:07 +0000 (-0700) Subject: altosuilib: Limit EasyMotor graphs to motor pressure and accel by default X-Git-Tag: 1.9.12~1^2~12 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=2fdf4e798bd67b0d7e96f2b8fff49915b71b089e altosuilib: Limit EasyMotor graphs to motor pressure and accel by default Change which axes are turned on when the graph is created. Signed-off-by: Keith Packard --- diff --git a/altosuilib/AltosGraph.java b/altosuilib/AltosGraph.java index 1ccde1d6..46dc80f3 100644 --- a/altosuilib/AltosGraph.java +++ b/altosuilib/AltosGraph.java @@ -95,8 +95,19 @@ public class AltosGraph extends AltosUIGraph { 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; @@ -134,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); @@ -151,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, @@ -171,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, @@ -186,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, @@ -347,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++) { @@ -359,7 +370,7 @@ public class AltosGraph extends AltosUIGraph { flight_series.register_axis(AltosUIFlightSeries.motor_pressure_name, motor_pressure_color, - true, + enable_axis(product_id, AltosUIFlightSeries.motor_pressure_name), motor_pressure_axis); flight_series.check_axes();