diff options
| author | Keith Packard <keithp@keithp.com> | 2015-06-25 18:35:07 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2015-06-25 18:43:13 -0700 | 
| commit | 3d508b66c2a15286bb9af88e4d92209463e0725d (patch) | |
| tree | a4eaa5b1d7d0144fbeaec3f063e619e0400a18d3 | |
| parent | f76d5e4fc2ed1e0d79c096cc89793d671ecb78c3 (diff) | |
altosui: Correctly show/hide receiver battery value
Override the hide() test function which has the listener_state
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | altosui/AltosPad.java | 7 | 
1 files 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++)); | 
