diff options
author | Keith Packard <keithp@keithp.com> | 2013-02-10 15:34:56 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-02-10 18:15:25 -0800 |
commit | cbd9dd989a662f41ddcb0c9e0f4453840687fd4a (patch) | |
tree | 527a04c75036b5db1003fa8b48a53fbbc081ca78 /altosui/AltosFlightStats.java | |
parent | f0a125503e502d213711df0d7774d837d4d98447 (diff) |
altosui: Add map and GPS data to graph window. Trac #50
See where the rocket landed without having to replay the whole flight.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosFlightStats.java')
-rw-r--r-- | altosui/AltosFlightStats.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/altosui/AltosFlightStats.java b/altosui/AltosFlightStats.java index 0f32ae5e..7f0c9adb 100644 --- a/altosui/AltosFlightStats.java +++ b/altosui/AltosFlightStats.java @@ -34,6 +34,8 @@ public class AltosFlightStats { int flight; int year, month, day; int hour, minute, second; + double lat, lon; + double pad_lat, pad_lon; double landed_time(AltosRecordIterable iterable) { AltosState state = null; @@ -98,6 +100,7 @@ public class AltosFlightStats { year = month = day = -1; hour = minute = second = -1; serial = flight = -1; + lat = lon = -1; for (AltosRecord record : iterable) { if (serial < 0) serial = record.serial; @@ -137,6 +140,14 @@ public class AltosFlightStats { max_speed = state.max_baro_speed; max_acceleration = state.max_acceleration; } + if (state.gps.locked && state.gps.nsat >= 4) { + if (state.state <= Altos.ao_flight_pad) { + pad_lat = state.gps.lat; + pad_lon = state.gps.lon; + } + lat = state.gps.lat; + lon = state.gps.lon; + } } for (int s = Altos.ao_flight_startup; s <= Altos.ao_flight_landed; s++) { if (state_count[s] > 0) { |