From: Keith Packard Date: Fri, 26 Jun 2015 01:35:07 +0000 (-0700) Subject: altosui: Correctly show/hide receiver battery value X-Git-Tag: 1.6.0.4~17 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=3d508b66c2a15286bb9af88e4d92209463e0725d altosui: Correctly show/hide receiver battery value Override the hide() test function which has the listener_state Signed-off-by: Keith Packard --- 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++));