summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-09-12 22:40:57 -0700
committerKeith Packard <keithp@keithp.com>2012-09-12 23:54:13 -0700
commit0564f9b13d4e3050b0a45fc1c4f710ab2b1f9d81 (patch)
tree41662bf0bbeb13569f2829ea778a77796506befd
parent7e237920abb582d7ceb3e1925b11a848575ac68a (diff)
altosui: Leave new_gps indication until gps value is used
During replay, AltosState may not see a new GPS value as soon as it lands in the state field as additional records with the same timestamp may come in after the GPS record. Instead of resetting the new_gps indication when the new record is created, wait until the new_gps indication is seen by the AltosState update code and have that clear the new_gps indication. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--altoslib/AltosRecord.java2
-rw-r--r--altoslib/AltosState.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/altoslib/AltosRecord.java b/altoslib/AltosRecord.java
index dd741716..8bab1d0c 100644
--- a/altoslib/AltosRecord.java
+++ b/altoslib/AltosRecord.java
@@ -168,7 +168,7 @@ public class AltosRecord implements Comparable <AltosRecord>, Cloneable {
speed = old.speed;
height = old.height;
gps = new AltosGPS(old.gps);
- new_gps = false;
+ new_gps = old.new_gps;
companion = old.companion;
}
diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java
index 2806812e..2e4d8870 100644
--- a/altoslib/AltosState.java
+++ b/altoslib/AltosState.java
@@ -165,6 +165,8 @@ public class AltosState {
} else
pad_alt = ground_altitude;
+ data.new_gps = false;
+
gps_waiting = MIN_PAD_SAMPLES - npad;
if (gps_waiting < 0)
gps_waiting = 0;