Was trying to use AltosDroid.number for integers, which didn't work as
it expected doubles.
Signed-off-by: Keith Packard <keithp@keithp.com>
return String.format(format, value);
}
return String.format(format, value);
}
+ static String integer(String format, int value) {
+ if (value == AltosRecord.MISSING)
+ return "";
+ return String.format(format, value);
+ }
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
} else {
mDataLoggingView.setText("Storage full");
}
} else {
mDataLoggingView.setText("Storage full");
}
- mDataLoggingLights.set(state.data.flight != 0, state.data.flight != AltosRecord.MISSING);
+ mDataLoggingLights.set(state.data.flight != 0, state.data.flight == AltosRecord.MISSING);
- mGPSLockedView.setText(AltosDroid.number("%4d sats", state.gps.nsat));
+ mGPSLockedView.setText(AltosDroid.integer("%4d sats", state.gps.nsat));
mGPSLockedLights.set(state.gps.locked && state.gps.nsat >= 4, false);
if (state.gps_ready)
mGPSReadyView.setText("Ready");
else
mGPSLockedLights.set(state.gps.locked && state.gps.nsat >= 4, false);
if (state.gps_ready)
mGPSReadyView.setText("Ready");
else
- mGPSReadyView.setText(AltosDroid.number("Waiting %d", state.gps_waiting));
+ mGPSReadyView.setText(AltosDroid.integer("Waiting %d", state.gps_waiting));
} else
mGPSLockedLights.set(false, true);
mGPSReadyLights.set(state.gps_ready, state.gps == null);
} else
mGPSLockedLights.set(false, true);
mGPSReadyLights.set(state.gps_ready, state.gps == null);