From 222158581887b5f9e8b9843d14321c313fa023fa Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 May 2017 22:36:05 -0700 Subject: altoslib/altosuilib/altosui: More work towards using AltosFlightSeries for analysis Graphing and CSV seem complete now; stats still missing lots of stuff. Signed-off-by: Keith Packard --- altosui/AltosGraphUI.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'altosui/AltosGraphUI.java') diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 5314a3b6..a3107f2b 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -44,19 +44,26 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt void fill_map(AltosFlightSeries flight_series) { boolean any_gps = false; + AltosGPSTimeValue gtv_last = null; for (AltosGPSTimeValue gtv : flight_series.gps_series) { + gtv_last = gtv; AltosGPS gps = gtv.gps; if (gps != null && gps.locked && gps.nsat >= 4) { if (map == null) map = new AltosUIMap(); - map.show(gps, AltosLib.ao_flight_pad); + map.show(gps, (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time)); this.gps = gps; has_gps = true; } } + if (gtv_last != null) { + int state = (int) flight_series.value_after(AltosFlightSeries.state_name, gtv_last.time); + if (state == AltosLib.ao_flight_landed) + map.show(gtv_last.gps, state); + } } public void font_size_changed(int font_size) { -- cgit v1.2.3