diff options
| author | Keith Packard <keithp@keithp.com> | 2015-09-12 19:20:49 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2015-10-13 13:54:28 -0700 | 
| commit | 0afa07d3c1dcb5e301fcb8b4edfecdd961662478 (patch) | |
| tree | bd0742a81d3ef60933358fa5151e5d49910cacbe /altoslib/AltosKML.java | |
| parent | 7064bc685aebeef07711e525dea4d5fbe33d235b (diff) | |
altoslib: Hide 'state' member and use accessor function
Someone was smashing the state to 'landed' when no packets had been
received for a while. Found that by making it impossible for anyone
outside of AltosState to change the value.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosKML.java')
| -rw-r--r-- | altoslib/AltosKML.java | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/altoslib/AltosKML.java b/altoslib/AltosKML.java index 81433958..1a364106 100644 --- a/altoslib/AltosKML.java +++ b/altoslib/AltosKML.java @@ -112,8 +112,8 @@ public class AltosKML implements AltosWriter {  	boolean	started = false;  	void state_start(AltosState state) { -		String	state_name = AltosLib.state_name(state.state); -		String	state_color = state_color(state.state); +		String	state_name = AltosLib.state_name(state.state()); +		String	state_color = state_color(state.state());  		out.printf(kml_style_start, state_name, state_color);  		out.printf("\tState: %s\n", state_name);  		out.printf("%s", kml_style_end); @@ -171,8 +171,8 @@ public class AltosKML implements AltosWriter {  		}  		if (prev != null && prev.gps_sequence == state.gps_sequence)  			return; -		if (state.state != flight_state) { -			flight_state = state.state; +		if (state.state() != flight_state) { +			flight_state = state.state();  			if (prev != null) {  				coord(state);  				state_end(prev); | 
