From 3d508b66c2a15286bb9af88e4d92209463e0725d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 Jun 2015 18:35:07 -0700 Subject: [PATCH] altosui: Correctly show/hide receiver battery value Override the hide() test function which has the listener_state Signed-off-by: Keith Packard --- altosui/AltosPad.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 687fe6f7..4f3ea137 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -103,9 +103,12 @@ public class AltosPad extends AltosUIFlightTab { public double voltage(AltosState state) { return AltosLib.MISSING; } - public boolean hide(double v) { return v == AltosLib.MISSING; } public double good() { return AltosLib.ao_battery_good; } + public boolean hide(AltosState state, AltosListenerState listener_state, int i) { + return value(state, listener_state, i) == AltosLib.MISSING; + } + public double value(AltosState state, AltosListenerState listener_state, int i) { if (listener_state == null) return AltosLib.MISSING; @@ -243,12 +246,12 @@ public class AltosPad extends AltosUIFlightTab { public AltosPad() { int y = 0; add(new Battery(this, y++)); + add(new ReceiverBattery(this, y++)); add(new Apogee(this, y++)); add(new Main(this, y++)); add(new LoggingReady(this, y++)); add(new GPSLocked(this, y++)); add(new GPSReady(this, y++)); - add(new ReceiverBattery(this, y++)); add(new PadLat(this, y++)); add(new PadLon(this, y++)); add(new PadAlt(this, y++)); -- 2.30.2