- double last_alt = AltosLib.MISSING - 1;
-
- public void show (AltosState state, AltosListenerState listener_state) {
- double alt = AltosLib.MISSING;
- String label = null;
-
- if (state != null) {
- if (state.state < AltosLib.ao_flight_pad && state.gps != null && state.gps.alt != AltosLib.MISSING) {
- alt = state.gps.alt;
- label = "Altitude";
- } else {
- alt = state.pad_alt;
- label = "Pad Altitude";
- }
- }
- if (alt != last_alt) {
- if (alt != AltosLib.MISSING) {
- show(AltosConvert.height.show(5, alt));
- set_label(label);
- } else
- hide();
- last_alt = alt;
+ public double value(AltosState state, int i) {
+ if (report_pad(state)) {
+ double alt = state.gps_ground_altitude();
+ if (alt == AltosLib.MISSING)
+ alt = state.ground_altitude();
+ return alt;