From: Keith Packard Date: Tue, 10 Jun 2014 18:32:57 +0000 (-0700) Subject: altosui: Show "Missing" instead of huge numbers in descent/landed tabs X-Git-Tag: 1.4~81 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=90686853e46b7f0df9bdaf671f859819eef926e0 altosui: Show "Missing" instead of huge numbers in descent/landed tabs Signed-off-by: Keith Packard --- diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index e6710524..b56a08bc 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -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) { diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index bb52fe2b..d2628fb0 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -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) {