altosui: Don't display missing sensor data
[fw/altos] / altosui / AltosPad.java
index d13f69458c4705470cfc6cf398af73aee44f7d45..66cb4cfca83f3409d72763d05703a796f07b1515 100644 (file)
@@ -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");