X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosGraphUI.java;h=2f3575a4387bbbd9e39f0e58a4a8394ce53a1f27;hp=b376f7de69ee29d4adea4d1d46e56b003bd21af9;hb=2120d362cefceba69e75996b6391d9558978c01d;hpb=bf88c5f829ea5d32043431945e862a9f6c96740a diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index b376f7de..2f3575a4 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -21,21 +21,47 @@ public class AltosGraphUI extends AltosUIFrame JTabbedPane pane; AltosGraph graph; AltosUIEnable enable; + AltosSiteMap map; + AltosState state; + AltosGraphDataSet graphDataSet; + AltosFlightStats stats; + AltosFlightStatsTable statsTable; + + boolean fill_map(AltosRecordIterable records) { + boolean any_gps = false; + for (AltosRecord record : records) { + state = new AltosState(record, state); + if (state.gps.locked && state.gps.nsat >= 4) { + map.show(state, 0); + any_gps = true; + } + } + return any_gps; + } + + AltosGraphUI(AltosRecordIterable records, File file) throws InterruptedException, IOException { + super(file.getName()); + state = null; - AltosGraphUI(AltosRecordIterable records, String file) throws InterruptedException, IOException { pane = new JTabbedPane(); enable = new AltosUIEnable(); - AltosGraph graph = new AltosGraph(enable); + stats = new AltosFlightStats(records); + graphDataSet = new AltosGraphDataSet(records); + + graph = new AltosGraph(enable, stats, graphDataSet); + + statsTable = new AltosFlightStatsTable(stats); - graph.setDataSet(new AltosGraphDataSet(records)); + map = new AltosSiteMap(); pane.add("Flight Graph", graph.panel); pane.add("Configure Graph", enable); + pane.add("Flight Statistics", statsTable); - AltosFlightStatsTable stats = new AltosFlightStatsTable(new AltosFlightStats(records)); - pane.add("Flight Statistics", stats); + if (fill_map(records)) + pane.add("Map", map); setContentPane (pane); @@ -43,5 +69,7 @@ public class AltosGraphUI extends AltosUIFrame setDefaultCloseOperation(DISPOSE_ON_CLOSE); setVisible(true); + if (state != null) + map.centre(state); } }