diff options
author | Keith Packard <keithp@keithp.com> | 2011-07-06 21:38:57 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-07-06 21:38:57 -0700 |
commit | 8f80f5705d64469bcfb00ff11aee68364edb271b (patch) | |
tree | 9db032cfcb647951259c9ff7f0deabea682271cf /altosui/AltosPad.java | |
parent | 80ca066a825646f833ca609190c76c5252118d9a (diff) |
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 <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosPad.java')
-rw-r--r-- | altosui/AltosPad.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 2d800e8a..d08925be 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -149,6 +149,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class Apogee extends LaunchStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4.2f V", state.drogue_sense)); lights.set(state.drogue_sense > 3.2); } @@ -161,6 +162,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class Main extends LaunchStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4.2f V", state.main_sense)); lights.set(state.main_sense > 3.2); } @@ -259,10 +261,16 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { public void show(AltosState state, int crc_errors) { battery.show(state, crc_errors); - apogee.show(state, crc_errors); - main.show(state, crc_errors); + if (state.drogue_sense == AltosRecord.MISSING) + apogee.hide(); + else + apogee.show(state, crc_errors); + if (state.main_sense == AltosRecord.MISSING) + main.hide(); + else + main.show(state, crc_errors); pad_alt.show(state, crc_errors); - if (state.gps != null) { + if (state.gps != null && state.gps.connected) { gps_locked.show(state, crc_errors); gps_ready.show(state, crc_errors); pad_lat.show(state, crc_errors); |