diff options
author | Keith Packard <keithp@keithp.com> | 2013-04-02 16:47:07 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-04-02 16:47:07 -0700 |
commit | e747156d0ea4b62eea30a8f486ee105ee35dcaf5 (patch) | |
tree | 76d5d1f9450cc59ed5a43b15eb523a3e161b0045 /altosui/AltosPad.java | |
parent | 997cdef3fe04acdd566d287e70981f7b7934d0c8 (diff) |
altosui: Don't display missing sensor data
For devices without sensors, don't display temperature, barometric and
accelerometer-derived values.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosPad.java')
-rw-r--r-- | altosui/AltosPad.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index d13f6945..66cb4cfc 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -168,8 +168,12 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class Battery extends LaunchStatus { void show (AltosState state, int crc_errors) { - show("%4.2f V", state.battery); - lights.set(state.battery > 3.7); + if (state.battery == AltosRecord.MISSING) + hide(); + else { + show("%4.2f V", state.battery); + lights.set(state.battery > 3.7); + } } public Battery (GridBagLayout layout, int y) { super(layout, y, "Battery Voltage"); @@ -285,7 +289,10 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class PadAlt extends LaunchValue { void show (AltosState state, int crc_errors) { - show("%4.0f m", state.pad_alt); + if (state.pad_alt == AltosRecord.MISSING) + hide(); + else + show("%4.0f m", state.pad_alt); } public PadAlt (GridBagLayout layout, int y) { super (layout, y, "Pad Altitude"); |