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/AltosGraphUI.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/AltosGraphUI.java')
-rw-r--r-- | altosui/AltosGraphUI.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index b376f7de..ac20f84b 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -21,8 +21,24 @@ public class AltosGraphUI extends AltosUIFrame JTabbedPane pane; AltosGraph graph; AltosUIEnable enable; + AltosSiteMap map; + AltosState state; + + boolean fill_map(AltosRecordIterable records) { + boolean any_gps = false; + for (AltosRecord record : records) { + state = new AltosState(record, state); + if (state.data.gps != null) { + map.show(state, 0); + any_gps = true; + } + } + return any_gps; + } AltosGraphUI(AltosRecordIterable records, String file) throws InterruptedException, IOException { + state = null; + pane = new JTabbedPane(); enable = new AltosUIEnable(); @@ -31,17 +47,24 @@ public class AltosGraphUI extends AltosUIFrame graph.setDataSet(new AltosGraphDataSet(records)); + map = new AltosSiteMap(); + pane.add("Flight Graph", graph.panel); pane.add("Configure Graph", enable); AltosFlightStatsTable stats = new AltosFlightStatsTable(new AltosFlightStats(records)); pane.add("Flight Statistics", stats); + if (fill_map(records)) + pane.add("Map", map); + setContentPane (pane); pack(); setDefaultCloseOperation(DISPOSE_ON_CLOSE); setVisible(true); + if (state != null) + map.centre(state); } } |