altosui: Show "Missing" instead of huge numbers in descent/landed tabs
authorKeith Packard <keithp@keithp.com>
Tue, 10 Jun 2014 18:32:57 +0000 (11:32 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 10 Jun 2014 18:32:57 +0000 (11:32 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosDescent.java
altosui/AltosLanded.java

index e6710524ec03647e5c77ba38732124d60e291f4d..b56a08bc3cfad7f46d0cd32cc9a20c284e0366c9 100644 (file)
@@ -133,11 +133,17 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay {
 
                void show(double v) {
                        this.v = v;
-                       show(units.show(8, v));
+                       if (v == AltosLib.MISSING)
+                               show("Missing");
+                       else
+                               show(units.show(8, v));
                }
 
                void show(String format, double v) {
-                       show(String.format(format, v));
+                       if (v == AltosLib.MISSING)
+                               show("Missing");
+                       else
+                               show(String.format(format, v));
                }
 
                public void font_size_changed(int font_size) {
index bb52fe2bc5381042f15f7af9c6eb984ecffd332f..d2628fb01f1c2b6a468cf4cf01b6f5197529ae23 100644 (file)
@@ -51,7 +51,10 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio
 
                void show(double v) {
                        this.v = v;
-                       show(units.show(8, v));
+                       if (v == AltosLib.MISSING)
+                               show("Missing");
+                       else
+                               show(units.show(8, v));
                }
 
                void show(String format, double v) {