summaryrefslogtreecommitdiff
path: root/altosui/AltosPad.java
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2014-09-06 13:41:36 -0600
committerBdale Garbee <bdale@gag.com>2014-09-06 13:41:36 -0600
commit8c212cd5bfa03f71a31d84bd0051314e77d88461 (patch)
tree5be036b3510b8b474ad829caea20fcbc75b56839 /altosui/AltosPad.java
parente9714e34091abe657aa1b30aeda9466331aa39c1 (diff)
parentdd26ec2e706bdd29090759deeb90090a0e3b74f0 (diff)
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Conflicts: ao-bringup/turnon_telemega
Diffstat (limited to 'altosui/AltosPad.java')
-rw-r--r--altosui/AltosPad.java35
1 files changed, 23 insertions, 12 deletions
diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java
index 5c33fd16..eb0c5644 100644
--- a/altosui/AltosPad.java
+++ b/altosui/AltosPad.java
@@ -117,6 +117,17 @@ 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)
+ {
+ return false;
+ }
+ return true;
+ }
+
class PadLat extends AltosUIIndicator {
double last_lat = AltosLib.MISSING - 1;
@@ -126,12 +137,12 @@ public class AltosPad extends AltosUIFlightTab {
String label = null;
if (state != null) {
- if (state.state < AltosLib.ao_flight_pad && state.gps != null && state.gps.lat != AltosLib.MISSING) {
- lat = state.gps.lat;
- label = "Latitude";
- } else {
+ if (report_pad(state)) {
lat = state.pad_lat;
label = "Pad Latitude";
+ } else {
+ lat = state.gps.lat;
+ label = "Latitude";
}
}
if (lat != last_lat) {
@@ -163,12 +174,12 @@ public class AltosPad extends AltosUIFlightTab {
String label = null;
if (state != null) {
- if (state.state < AltosLib.ao_flight_pad && state.gps != null && state.gps.lon != AltosLib.MISSING) {
- lon = state.gps.lon;
- label = "Longitude";
- } else {
+ if (report_pad(state)) {
lon = state.pad_lon;
label = "Pad Longitude";
+ } else {
+ lon = state.gps.lon;
+ label = "Longitude";
}
}
if (lon != last_lon) {
@@ -200,12 +211,12 @@ public class AltosPad extends AltosUIFlightTab {
String label = null;
if (state != null) {
- if (state.state < AltosLib.ao_flight_pad && state.gps != null && state.gps.alt != AltosLib.MISSING) {
- alt = state.gps.alt;
- label = "Altitude";
- } else {
+ if (report_pad(state)) {
alt = state.pad_alt;
label = "Pad Altitude";
+ } else {
+ alt = state.gps.alt;
+ label = "Altitude";
}
}
if (alt != last_alt) {