altoslib: Use first pressure value if no ground pressure available
authorKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 21:41:42 +0000 (14:41 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 21:41:42 +0000 (14:41 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosFlightSeries.java

index 7e643d9651359a10455504418766048ba024e60c..09b537758540ecbad4b9e6577bf28b954bc7a879 100644 (file)
@@ -213,6 +213,9 @@ public class AltosFlightSeries extends AltosDataListener {
                if (altitude_series == null)
                        altitude_series = add_series(altitude_name, AltosConvert.height);
 
+               if (cal_data.ground_pressure == AltosLib.MISSING)
+                       cal_data.set_ground_pressure(pa);
+
                double altitude = AltosConvert.pressure_to_altitude(pa);
                altitude_series.add(time(), altitude);
        }