diff options
author | Keith Packard <keithp@keithp.com> | 2014-09-01 18:25:00 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-09-01 18:25:00 -0500 |
commit | b838a974d0dad43ff02060d8d913d9369eb20e96 (patch) | |
tree | 8eeca00e9b729ab66fa13b33d907eaeab4360603 /altosui | |
parent | 7735cee871d02215517cb9d91cd552f003ca6a50 (diff) |
altosui: Fix 'pad' screen for TeleGPS
Don't report pad position for TeleGPS
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui')
-rw-r--r-- | altosui/AltosPad.java | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 5c33fd16..eb0c5644 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -117,6 +117,17 @@ public class AltosPad extends AltosUIFlightTab { } } + boolean report_pad(AltosState state) { + if ((state.state == AltosLib.ao_flight_stateless || + state.state < AltosLib.ao_flight_pad) && + state.gps != null && + state.gps.lat != AltosLib.MISSING) + { + return false; + } + return true; + } + class PadLat extends AltosUIIndicator { double last_lat = AltosLib.MISSING - 1; @@ -126,12 +137,12 @@ public class AltosPad extends AltosUIFlightTab { String label = null; if (state != null) { - if (state.state < AltosLib.ao_flight_pad && state.gps != null && state.gps.lat != AltosLib.MISSING) { - lat = state.gps.lat; - label = "Latitude"; - } else { + if (report_pad(state)) { lat = state.pad_lat; label = "Pad Latitude"; + } else { + lat = state.gps.lat; + label = "Latitude"; } } if (lat != last_lat) { @@ -163,12 +174,12 @@ public class AltosPad extends AltosUIFlightTab { String label = null; if (state != null) { - if (state.state < AltosLib.ao_flight_pad && state.gps != null && state.gps.lon != AltosLib.MISSING) { - lon = state.gps.lon; - label = "Longitude"; - } else { + if (report_pad(state)) { lon = state.pad_lon; label = "Pad Longitude"; + } else { + lon = state.gps.lon; + label = "Longitude"; } } if (lon != last_lon) { @@ -200,12 +211,12 @@ public class AltosPad extends AltosUIFlightTab { 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 { + if (report_pad(state)) { alt = state.pad_alt; label = "Pad Altitude"; + } else { + alt = state.gps.alt; + label = "Altitude"; } } if (alt != last_alt) { |