From 8f80f5705d64469bcfb00ff11aee68364edb271b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 6 Jul 2011 21:38:57 -0700 Subject: altosui: Don't show missing igniter and gps values The new telemetry stuff leaves state.gps always set (but empty), which seems fine, we just need to look at state.gps.connected to see if there's a GPS receiver on board. For TeleNano, we also want to hide the igniter status fields as they won't have any data present. Signed-off-by: Keith Packard --- altosui/AltosInfoTable.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'altosui/AltosInfoTable.java') diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index 723f8301..8ebeaba1 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -107,10 +107,12 @@ public class AltosInfoTable extends JTable { info_add_row(0, "Max Speed", "%8.1f m/s", state.max_speed); info_add_row(0, "Temperature", "%9.2f °C", state.temperature); info_add_row(0, "Battery", "%9.2f V", state.battery); - info_add_row(0, "Drogue", "%9.2f V", state.drogue_sense); - info_add_row(0, "Main", "%9.2f V", state.main_sense); + if (state.drogue_sense != AltosRecord.MISSING) + info_add_row(0, "Drogue", "%9.2f V", state.drogue_sense); + if (state.main_sense != AltosRecord.MISSING) + info_add_row(0, "Main", "%9.2f V", state.main_sense); info_add_row(0, "Pad altitude", "%6.0f m", state.ground_altitude); - if (state.gps == null) { + if (state.gps == null || !state.gps.connected) { info_add_row(1, "GPS", "not available"); } else { if (state.gps_ready) -- cgit v1.2.3