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 6f398808fde5066c9a8bcd58a56ed4b1f6cb5b4b..8e0a9e07be96c396f9e9bb82966ebb224b74b5c8 100644 (file)
@@ -36,6 +36,10 @@ public abstract class AltosUIUnitsIndicator extends AltosUIIndicator {
                return hide(value(state, i));
        }
 
                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);
        }
        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;
                                v[i] = value(state, listener_state, i);
                        else
                                v[i] = AltosLib.MISSING;
-                       if (hide(state, i))
+                       if (hide(state, listener_state, i))
                                hide = true;
                }
 
                                hide = true;
                }