From: Keith Packard Date: Thu, 13 Sep 2012 05:40:57 +0000 (-0700) Subject: altosui: Leave new_gps indication until gps value is used X-Git-Tag: 1.1~1^2~1 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=0564f9b13d4e3050b0a45fc1c4f710ab2b1f9d81;hp=7e237920abb582d7ceb3e1925b11a848575ac68a 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 --- 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;