summaryrefslogtreecommitdiff
path: root/altosui/AltosTelemetryRecordLegacy.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-10-27 00:49:23 -0700
committerKeith Packard <keithp@keithp.com>2011-10-27 00:49:23 -0700
commit0669f0d74fc24c4f1925a45a9975b7a49a65b692 (patch)
tree5b2bef044755a081f1edce5fd27f31edb2f8ab88 /altosui/AltosTelemetryRecordLegacy.java
parentc7e14a2750d437e8b77d68a944a0711e7a0c882b (diff)
altosui: Only update GPS data when new GPS information arrives
Track which telemetry packets are actually producing new GPS information and only update the GPS average position and count of stable GPS reports with new GPS info, instead of on every telemetry packet. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosTelemetryRecordLegacy.java')
-rw-r--r--altosui/AltosTelemetryRecordLegacy.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/altosui/AltosTelemetryRecordLegacy.java b/altosui/AltosTelemetryRecordLegacy.java
index f59027ab..f2f63358 100644
--- a/altosui/AltosTelemetryRecordLegacy.java
+++ b/altosui/AltosTelemetryRecordLegacy.java
@@ -265,8 +265,10 @@ public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele
flight_vel = map.get_int(AO_TELEM_ADHOC_SPEED, MISSING);
flight_pres = map.get_int(AO_TELEM_ADHOC_BARO, MISSING);
- if (map.has(AO_TELEM_GPS_STATE))
+ if (map.has(AO_TELEM_GPS_STATE)) {
gps = new AltosGPS(map);
+ new_gps = true;
+ }
else
gps = null;
}
@@ -355,6 +357,7 @@ public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele
}
gps = new AltosGPS(words, i, version);
+ new_gps = true;
}
public AltosTelemetryRecordLegacy(String line) throws ParseException, AltosCRCException {
@@ -467,6 +470,7 @@ public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele
if ((gps_flags & (AO_GPS_VALID|AO_GPS_RUNNING)) != 0) {
gps = new AltosGPS();
+ new_gps = true;
seen |= seen_gps_time | seen_gps_lat | seen_gps_lon;
gps.nsat = (gps_flags & AO_GPS_NUM_SAT_MASK);