diff options
author | Keith Packard <keithp@keithp.com> | 2013-06-17 14:00:43 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-06-17 14:00:43 -0700 |
commit | 10f3d0084ff1c0b3dbf28c5d44727b514caeee20 (patch) | |
tree | 249085c9d56ba6b2d7505ae4ddbeaa7f67fa56f1 /altosui/AltosGraph.java | |
parent | 298e54856b5f8809b43f24407caa4a6be60822f3 (diff) |
altosui: Add raw pressure to the AltosUI graph
A nice addition, and useful when diagnosing baro sensor issues
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosGraph.java')
-rw-r--r-- | altosui/AltosGraph.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/altosui/AltosGraph.java b/altosui/AltosGraph.java index defe69a0..40604ce3 100644 --- a/altosui/AltosGraph.java +++ b/altosui/AltosGraph.java @@ -73,18 +73,18 @@ class AltosNsat extends AltosUnits { } } -class AltosDbm extends AltosUnits { +class AltosPressure extends AltosUnits { - public double value(double v) { - return v; + public double value(double p) { + return p; } public String show_units() { - return "dBm"; + return "Pa"; } public String say_units() { - return "d b m"; + return "pascals"; } public int show_fraction(int width) { @@ -96,6 +96,7 @@ public class AltosGraph extends AltosUIGraph { static final private Color height_color = new Color(194,31,31); static final private Color gps_height_color = new Color(150,31,31); + static final private Color pressure_color = new Color (225,31,31); static final private Color range_color = new Color(100, 31, 31); static final private Color distance_color = new Color(100, 31, 194); static final private Color speed_color = new Color(31,194,31); @@ -112,16 +113,18 @@ public class AltosGraph extends AltosUIGraph { static final private Color state_color = new Color(0,0,0); static AltosVoltage voltage_units = new AltosVoltage(); + static AltosPressure pressure_units = new AltosPressure(); static AltosNsat nsat_units = new AltosNsat(); static AltosDbm dbm_units = new AltosDbm(); AltosUIAxis height_axis, speed_axis, accel_axis, voltage_axis, temperature_axis, nsat_axis, dbm_axis; - AltosUIAxis distance_axis; + AltosUIAxis distance_axis, pressure_axis; public AltosGraph(AltosUIEnable enable, AltosFlightStats stats, AltosGraphDataSet dataSet) { super(enable); height_axis = newAxis("Height", AltosConvert.height, height_color); + pressure_axis = newAxis("Pressure", pressure_units, pressure_color, 0); speed_axis = newAxis("Speed", AltosConvert.speed, speed_color); accel_axis = newAxis("Acceleration", AltosConvert.accel, accel_color); voltage_axis = newAxis("Voltage", voltage_units, voltage_color); @@ -138,6 +141,12 @@ public class AltosGraph extends AltosUIGraph { height_color, true, height_axis); + addSeries("Pressure", + AltosGraphDataPoint.data_pressure, + pressure_units, + pressure_color, + false, + pressure_axis); addSeries("Speed", AltosGraphDataPoint.data_speed, AltosConvert.speed, |