diff options
| author | Keith Packard <keithp@keithp.com> | 2017-05-11 17:14:51 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2017-05-19 21:41:40 -0700 | 
| commit | 258808d296aeadaf150fa9b07e9c99a6bf1ca7c8 (patch) | |
| tree | 2127cc9f8a85ffb8365542e709b224bd37bc0c2c /altoslib/AltosConfigData.java | |
| parent | a9aa2d3558c77eb444223eaa747c75916bc7bac1 (diff) | |
altoslib: Create new abstraction underneath AltosState for recording values
Provides a way for the graph API to see raw data values, instead of
those cooked by AltosState.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosConfigData.java')
| -rw-r--r-- | altoslib/AltosConfigData.java | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index 23ab1e11..05fc2031 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -214,6 +214,10 @@ public class AltosConfigData implements Iterable<String> {  		return r;  	} +	public boolean altitude_32() { +		return altitude_32 == 1; +	} +  	public int compare_version(String other) {  		int[]	me = parse_version(version);  		int[]	them = parse_version(other); @@ -438,11 +442,11 @@ public class AltosConfigData implements Iterable<String> {  		if (frequency > 0) {  			radio_frequency = (int) Math.floor (freq * 1000 + 0.5); -			radio_channel = -1; +			radio_channel = AltosLib.MISSING;  		} else if (setting > 0) {  			radio_setting =AltosConvert.radio_frequency_to_setting(freq,  										    radio_calibration); -			radio_channel = -1; +			radio_channel = AltosLib.MISSING;  		} else {  			radio_channel = AltosConvert.radio_frequency_to_channel(freq);  		} @@ -453,7 +457,7 @@ public class AltosConfigData implements Iterable<String> {  		int	setting = radio_setting;  		if (radio_frequency < 0 && channel < 0 && setting < 0) -			return -1; +			return AltosLib.MISSING;  		if (channel < 0)  			channel = 0; | 
