From 0564f9b13d4e3050b0a45fc1c4f710ab2b1f9d81 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2012 22:40:57 -0700 Subject: [PATCH] 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 --- altoslib/AltosRecord.java | 2 +- altoslib/AltosState.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 , 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; -- 2.30.2