summaryrefslogtreecommitdiff
path: root/altoslib/AltosCalData.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-12-11 14:42:45 -0800
committerKeith Packard <keithp@keithp.com>2017-12-11 14:42:45 -0800
commit2efb997865ee46bf0e8d5145c95d051a7656222a (patch)
tree68dace9f430948b9c49c69782f3eff16c0b1a0a5 /altoslib/AltosCalData.java
parentfa3ff3a089e4af88dd0cc9a9e92511a0ba4a8e0f (diff)
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 <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosCalData.java')
-rw-r--r--altoslib/AltosCalData.java5
1 files changed, 4 insertions, 1 deletions
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;