altosuilib: Receiver battery voltage lives in listener_state
authorKeith Packard <keithp@keithp.com>
Fri, 26 Jun 2015 01:33:46 +0000 (18:33 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 26 Jun 2015 01:43:13 +0000 (18:43 -0700)
The code to detect whether to show or hide this entry was using
functions that weren't given the listener_state and hence returned
MISSING all of the time.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosuilib/AltosUIUnitsIndicator.java

index 6f39880..8e0a9e0 100644 (file)
@@ -36,6 +36,10 @@ public abstract class AltosUIUnitsIndicator extends AltosUIIndicator {
                return hide(value(state, i));
        }
 
+       public boolean hide(AltosState state, AltosListenerState listener_state, int i) {
+               return hide(state, i);
+       }
+
        public double value (AltosState state, AltosListenerState listener_state, int i) {
                return value(state, i);
        }
@@ -77,7 +81,7 @@ public abstract class AltosUIUnitsIndicator extends AltosUIIndicator {
                                v[i] = value(state, listener_state, i);
                        else
                                v[i] = AltosLib.MISSING;
-                       if (hide(state, i))
+                       if (hide(state, listener_state, i))
                                hide = true;
                }