diff options
| author | Keith Packard <keithp@keithp.com> | 2017-06-11 22:52:56 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2017-06-11 22:54:23 -0700 | 
| commit | 247fa1c669f987830540e618bf263b08284118df (patch) | |
| tree | 6edccfff3df7aaa15876dec4994ea2daa9f2ed1a | |
| parent | 03ec3e4c2247b6520c728b34805ad500be547a25 (diff) | |
altosui: Display current altitude in monitor idle Pad tab
This was attempting to use 'pad' values even though monitor idle
doesn't have them.
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | altosui/AltosPad.java | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 73da9933..a29cdd6f 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -128,10 +128,8 @@ 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) +		if (state.state() == AltosLib.ao_flight_stateless || +		    state.state() < AltosLib.ao_flight_pad)  		{  			return false;  		} @@ -150,7 +148,7 @@ public class AltosPad extends AltosUIFlightTab {  				if (report_pad(state)) {  					lat = state.pad_lat;  					label = "Pad Latitude"; -				} else { +				} else if (state.gps != null) {  					lat = state.gps.lat;  					label = "Latitude";  				} @@ -187,7 +185,7 @@ public class AltosPad extends AltosUIFlightTab {  				if (report_pad(state)) {  					lon = state.pad_lon;  					label = "Pad Longitude"; -				} else { +				} else if (state.gps != null) {  					lon = state.gps.lon;  					label = "Longitude";  				} @@ -217,8 +215,10 @@ public class AltosPad extends AltosUIFlightTab {  		public double value(AltosState state, int i) {  			if (report_pad(state))  				return state.pad_alt; -			else +			else if (state.gps != null)  				return state.gps.alt; +			else +				return state.altitude();  		}  		public void show (AltosState state, AltosListenerState listener_state) { | 
