diff options
Diffstat (limited to 'altosui')
| -rw-r--r-- | altosui/AltosConfigPyroUI.java | 2 | ||||
| -rw-r--r-- | altosui/AltosConfigUI.java | 4 | ||||
| -rw-r--r-- | altosui/AltosPad.java | 52 | 
3 files changed, 25 insertions, 33 deletions
diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java index e0915a17..125866c6 100644 --- a/altosui/AltosConfigPyroUI.java +++ b/altosui/AltosConfigPyroUI.java @@ -105,7 +105,7 @@ public class AltosConfigPyroUI  				double 	unit_value = new_value;  				AltosUnits units = AltosPyro.pyro_to_units(flag);  				if (units != null) -					unit_value = units.value(new_value); +					unit_value = units.parse_value(new_value);  				String	format;  				if (scale >= 100)  					format = "%6.2f"; diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java index 24167df3..09123f4f 100644 --- a/altosui/AltosConfigUI.java +++ b/altosui/AltosConfigUI.java @@ -976,7 +976,7 @@ public class AltosConfigUI  	}  	String get_main_deploy_label() { -		return String.format("Main Deploy Altitude(%s):", AltosConvert.height.show_units()); +		return String.format("Main Deploy Altitude(%s):", AltosConvert.height.parse_units());  	}  	String[] main_deploy_values() { @@ -1243,7 +1243,7 @@ public class AltosConfigUI  	}  	String get_tracker_motion_label() { -		return String.format("Logging Trigger Motion (%s):", AltosConvert.height.show_units()); +		return String.format("Logging Trigger Motion (%s):", AltosConvert.height.parse_units());  	}  	void set_tracker_tool_tip() { diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 4f55636d..9a8c8087 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -101,7 +101,11 @@ public class AltosPad extends AltosUIFlightTab {  	class ReceiverBattery extends AltosUIVoltageIndicator { -		public double voltage(AltosState state) { return AltosLib.MISSING; } +		double	last_voltage = AltosLib.MISSING; + +		public double voltage(AltosState state) { +			return last_voltage; +		}  		public double good() { return AltosLib.ao_battery_good; } @@ -111,8 +115,10 @@ public class AltosPad extends AltosUIFlightTab {  		public double value(AltosState state, AltosListenerState listener_state, int i) {  			if (listener_state == null) -				return AltosLib.MISSING; -			return listener_state.battery; +				last_voltage = AltosLib.MISSING; +			else +				last_voltage = listener_state.battery; +			return last_voltage;  		}  		public ReceiverBattery (AltosUIFlightTab container, int y) { @@ -205,40 +211,26 @@ public class AltosPad extends AltosUIFlightTab {  		}  	} -	class PadAlt extends AltosUIIndicator { +	class PadAlt extends AltosUIUnitsIndicator { -		double	last_alt = AltosLib.MISSING - 1; +		public double value(AltosState state, int i) { +			if (report_pad(state)) +				return state.pad_alt; +			else +				return state.gps.alt; +		}  		public void show (AltosState state, AltosListenerState listener_state) { -			double alt = AltosLib.MISSING; -			String label = null; +			String label = "Altitude"; -			if (state != null) { -				if (report_pad(state)) { -					alt = state.pad_alt; -					label = "Pad Altitude"; -				} else { -					alt = state.gps.alt; -					label = "Altitude"; -				} -			} -			if (alt != last_alt) { -				if (alt != AltosLib.MISSING) { -					show(AltosConvert.height.show(5, alt)); -					set_label(label); -				} else -					hide(); -				last_alt = alt; -			} -		} - -		public void reset() { -			super.reset(); -			last_alt =  AltosLib.MISSING - 1; +			if (state != null && report_pad(state)) +				label = "Pad Altitude"; +			set_label(label); +			super.show(state, listener_state);  		}  		public PadAlt (AltosUIFlightTab container, int y) { -			super (container, y, "Pad Altitude", 1, false, 2); +			super (container, y, AltosConvert.height, "Pad Altitude", 1, false, 2);  		}  	}  	public String getName() { return "Pad"; }  | 
