summaryrefslogtreecommitdiff
path: root/altosui/AltosInfoTable.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-04-02 16:47:07 -0700
committerKeith Packard <keithp@keithp.com>2013-04-02 16:47:07 -0700
commite747156d0ea4b62eea30a8f486ee105ee35dcaf5 (patch)
tree76d5d1f9450cc59ed5a43b15eb523a3e161b0045 /altosui/AltosInfoTable.java
parent997cdef3fe04acdd566d287e70981f7b7934d0c8 (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/AltosInfoTable.java')
-rw-r--r--altosui/AltosInfoTable.java30
1 files changed, 20 insertions, 10 deletions
diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java
index 2facf38a..1dce6daf 100644
--- a/altosui/AltosInfoTable.java
+++ b/altosui/AltosInfoTable.java
@@ -108,16 +108,26 @@ public class AltosInfoTable extends JTable {
if (state == null)
return;
info_reset();
- info_add_row(0, "Altitude", "%6.0f m", state.altitude);
- info_add_row(0, "Pad altitude", "%6.0f m", state.ground_altitude);
- info_add_row(0, "Height", "%6.0f m", state.height);
- info_add_row(0, "Max height", "%6.0f m", state.max_height);
- info_add_row(0, "Acceleration", "%8.1f m/s²", state.acceleration);
- info_add_row(0, "Max acceleration", "%8.1f m/s²", state.max_acceleration);
- info_add_row(0, "Speed", "%8.1f m/s", state.speed());
- info_add_row(0, "Max Speed", "%8.1f m/s", state.max_accel_speed);
- info_add_row(0, "Temperature", "%9.2f °C", state.temperature);
- info_add_row(0, "Battery", "%9.2f V", state.battery);
+ if (state.altitude != AltosRecord.MISSING)
+ info_add_row(0, "Altitude", "%6.0f m", state.altitude);
+ if (state.ground_altitude != AltosRecord.MISSING)
+ info_add_row(0, "Pad altitude", "%6.0f m", state.ground_altitude);
+ if (state.height != AltosRecord.MISSING)
+ info_add_row(0, "Height", "%6.0f m", state.height);
+ if (state.max_height != AltosRecord.MISSING)
+ info_add_row(0, "Max height", "%6.0f m", state.max_height);
+ if (state.acceleration != AltosRecord.MISSING)
+ info_add_row(0, "Acceleration", "%8.1f m/s²", state.acceleration);
+ if (state.max_acceleration != AltosRecord.MISSING)
+ info_add_row(0, "Max acceleration", "%8.1f m/s²", state.max_acceleration);
+ if (state.speed() != AltosRecord.MISSING)
+ info_add_row(0, "Speed", "%8.1f m/s", state.speed());
+ if (state.max_speed() != AltosRecord.MISSING)
+ info_add_row(0, "Max Speed", "%8.1f m/s", state.max_accel_speed);
+ if (state.temperature != AltosRecord.MISSING)
+ info_add_row(0, "Temperature", "%9.2f °C", state.temperature);
+ if (state.battery != AltosRecord.MISSING)
+ info_add_row(0, "Battery", "%9.2f V", state.battery);
if (state.drogue_sense != AltosRecord.MISSING)
info_add_row(0, "Drogue", "%9.2f V", state.drogue_sense);
if (state.main_sense != AltosRecord.MISSING)