X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosGraphUI.java;h=2f3575a4387bbbd9e39f0e58a4a8394ce53a1f27;hp=ac20f84b26a23ad7bfc4b22b6374348829778318;hb=2120d362cefceba69e75996b6391d9558978c01d;hpb=cbd9dd989a662f41ddcb0c9e0f4453840687fd4a diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index ac20f84b..2f3575a4 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -23,12 +23,15 @@ public class AltosGraphUI extends AltosUIFrame 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.data.gps != null) { + if (state.gps.locked && state.gps.nsat >= 4) { map.show(state, 0); any_gps = true; } @@ -36,24 +39,26 @@ public class AltosGraphUI extends AltosUIFrame return any_gps; } - AltosGraphUI(AltosRecordIterable records, String file) throws InterruptedException, IOException { + AltosGraphUI(AltosRecordIterable records, File file) throws InterruptedException, IOException { + super(file.getName()); state = null; pane = new JTabbedPane(); enable = new AltosUIEnable(); - AltosGraph graph = new AltosGraph(enable); + stats = new AltosFlightStats(records); + graphDataSet = new AltosGraphDataSet(records); - graph.setDataSet(new AltosGraphDataSet(records)); + graph = new AltosGraph(enable, stats, graphDataSet); + + statsTable = new AltosFlightStatsTable(stats); 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); + pane.add("Flight Statistics", statsTable); if (fill_map(records)) pane.add("Map", map);