summaryrefslogtreecommitdiff
path: root/altosui/AltosPad.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-09-12 19:20:49 -0700
committerKeith Packard <keithp@keithp.com>2015-10-13 13:54:28 -0700
commit0afa07d3c1dcb5e301fcb8b4edfecdd961662478 (patch)
treebd0742a81d3ef60933358fa5151e5d49910cacbe /altosui/AltosPad.java
parent7064bc685aebeef07711e525dea4d5fbe33d235b (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 'altosui/AltosPad.java')
-rw-r--r--altosui/AltosPad.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java
index 2f87b681..d056e256 100644
--- a/altosui/AltosPad.java
+++ b/altosui/AltosPad.java
@@ -49,10 +49,10 @@ public class AltosPad extends AltosUIFlightTab {
hide();
} else {
if (state.flight != 0) {
- if (state.state <= Altos.ao_flight_pad)
+ if (state.state() <= Altos.ao_flight_pad)
show("Ready to record");
- else if (state.state < Altos.ao_flight_landed ||
- state.state == AltosLib.ao_flight_stateless)
+ else if (state.state() < Altos.ao_flight_landed ||
+ state.state() == AltosLib.ao_flight_stateless)
show("Recording data");
else
show("Recorded data");
@@ -121,8 +121,8 @@ public class AltosPad extends AltosUIFlightTab {
}
boolean report_pad(AltosState state) {
- if ((state.state == AltosLib.ao_flight_stateless ||
- state.state < AltosLib.ao_flight_pad) &&
+ if ((state.state() == AltosLib.ao_flight_stateless ||
+ state.state() < AltosLib.ao_flight_pad) &&
state.gps != null &&
state.gps.lat != AltosLib.MISSING)
{