From: Keith Packard Date: Mon, 11 Dec 2017 22:42:45 +0000 (-0800) Subject: altoslib: Keep old GPS values when updating data X-Git-Tag: 1.8.3~1^2~2 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=2efb997865ee46bf0e8d5145c95d051a7656222a altoslib: Keep old GPS values when updating data This way, updating satellite information doesn't drop all of the regular GPS data on the floor. Signed-off-by: Keith Packard --- diff --git a/altoslib/AltosCalData.java b/altoslib/AltosCalData.java index fdea5e21..03e2cbd7 100644 --- a/altoslib/AltosCalData.java +++ b/altoslib/AltosCalData.java @@ -241,6 +241,8 @@ public class AltosCalData { public AltosGPS gps_pad = null; + public AltosGPS prev_gps = null; + public double gps_pad_altitude = AltosLib.MISSING; public void set_cal_gps(AltosGPS gps) { @@ -251,6 +253,7 @@ public class AltosCalData { gps_pad_altitude = gps.alt; } temp_gps = null; + prev_gps = gps; } /* @@ -275,7 +278,7 @@ public class AltosCalData { public AltosGPS make_temp_cal_gps(int tick, boolean sats) { if (temp_gps == null) - temp_gps = new AltosGPS(); + temp_gps = new AltosGPS(prev_gps); if (sats) { if (tick != temp_gps_sat_tick) temp_gps.cc_gps_sat = null;