MicroPeak tries to filter out bogus pressure data so that the value
reported on the LED is reasonable. We want to report that same value
in the UI, which means replacing the normal mechanism for computing
max height from the time series of height data with the value computed
from the saved minimum pressure value recorded in the device.
Signed-off-by: Keith Packard <keithp@keithp.com>
public AltosTimeSeries height_series;
+ public double max_height = AltosLib.MISSING;
+
+ public void set_min_pressure(double pa) {
+ double ground_altitude = cal_data().ground_altitude;
+ if (ground_altitude != AltosLib.MISSING)
+ max_height = AltosConvert.pressure_to_altitude(pa) -
+ ground_altitude;
+ }
+
public static final String height_name = "Height";
public void set_pressure(double pa) {
}
}
- max_height = AltosLib.MISSING;
- if (series.height_series != null)
+ max_height = series.max_height;
+ if (max_height == AltosLib.MISSING && series.height_series != null)
max_height = series.height_series.max().value;
max_gps_height = AltosLib.MISSING;
if (series.gps_height != null) {
flight_series.set_time(cal_data.time());
flight_series.set_state(AltosLib.ao_flight_landed);
+ flight_series.set_min_pressure(min_pressure);
+
flight_series.finish();
flight_stats = new AltosFlightStats(flight_series);