From 90686853e46b7f0df9bdaf671f859819eef926e0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 10 Jun 2014 11:32:57 -0700 Subject: [PATCH] altosui: Show "Missing" instead of huge numbers in descent/landed tabs Signed-off-by: Keith Packard --- altosui/AltosDescent.java | 10 ++++++++-- altosui/AltosLanded.java | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) 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) { -- 2.30.2