From 2524730217e6972f3d0f04a9954350ba1964a83a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 2 Sep 2019 15:20:14 -0500 Subject: altosui: Add speed and gps height to map display data And generalize the API so that any other GPS data could be added in the future. This feature was proposed by Mike Beattie Signed-off-by: Keith Packard --- altosui/AltosGraphUI.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'altosui/AltosGraphUI.java') diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index c1e18ac1..c1fdc3a3 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -45,6 +45,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt void fill_map(AltosFlightSeries flight_series) { boolean any_gps = false; AltosGPSTimeValue gtv_last = null; + double gps_pad_altitude = flight_series.cal_data().gps_pad_altitude;; if (flight_series.gps_series != null) { for (AltosGPSTimeValue gtv : flight_series.gps_series) { @@ -54,7 +55,9 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt gps.nsat >= 4) { if (map == null) map = new AltosUIMap(); - map.show(gps, gtv. time, (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time)); + double gps_height = gps.alt - gps_pad_altitude; + int state = (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time); + map.show(gps, gtv.time, state, gps_height); this.gps = gps; gtv_last = gtv; has_gps = true; @@ -63,8 +66,9 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt } if (gtv_last != null) { int state = (int) flight_series.value_after(AltosFlightSeries.state_name, gtv_last.time); + double gps_height = gps.alt - gps_pad_altitude; if (state == AltosLib.ao_flight_landed) - map.show(gtv_last.gps, gtv_last.time, state); + map.show(gtv_last.gps, gtv_last.time, state,gps_height); } } -- cgit v1.2.3