From 3d29882f5c70e627b0bbfe42c0a31d6cb5f6b6bf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 26 May 2017 18:22:02 -0700 Subject: altoslib: Get KML export working again Even annotate the states with avg speed/accel for fun. Signed-off-by: Keith Packard --- altoslib/AltosCalData.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'altoslib/AltosCalData.java') diff --git a/altoslib/AltosCalData.java b/altoslib/AltosCalData.java index 3da0e400..fff6ba67 100644 --- a/altoslib/AltosCalData.java +++ b/altoslib/AltosCalData.java @@ -206,9 +206,13 @@ public class AltosCalData { public AltosGPS gps_pad = null; + public double gps_pad_altitude = AltosLib.MISSING; + public void set_gps(AltosGPS gps) { if ((state != AltosLib.MISSING && state < AltosLib.ao_flight_boost) || gps_pad == null) gps_pad = gps; + if (gps_pad_altitude == AltosLib.MISSING && gps.alt != AltosLib.MISSING) + gps_pad_altitude = gps.alt; } /* @@ -226,8 +230,8 @@ public class AltosCalData { if (temp_gps != null) { if (temp_gps.locked && temp_gps.nsat >= 4) set_gps(temp_gps); + temp_gps = null; } - temp_gps = null; } public boolean gps_pending() { @@ -235,9 +239,8 @@ public class AltosCalData { } public AltosGPS make_temp_gps(int tick, boolean sats) { - if (temp_gps == null) { + if (temp_gps == null) temp_gps = new AltosGPS(); - } if (sats) { if (tick != temp_gps_sat_tick) temp_gps.cc_gps_sat = null; -- cgit v1.2.3