diff options
author | Keith Packard <keithp@keithp.com> | 2019-09-02 15:20:14 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2019-09-02 15:45:30 -0500 |
commit | 2524730217e6972f3d0f04a9954350ba1964a83a (patch) | |
tree | 959e388b0ea4908cb9cd21b60c662f2cedcb9bfb /altosui/AltosGraphUI.java | |
parent | b13893245e8c66b48e23bb2005ef6ce46e69744f (diff) |
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 <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosGraphUI.java')
-rw-r--r-- | altosui/AltosGraphUI.java | 8 |
1 files changed, 6 insertions, 2 deletions
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); } } |