summaryrefslogtreecommitdiff
path: root/altosui/AltosGraphUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-02-11 10:34:47 -0800
committerKeith Packard <keithp@keithp.com>2013-02-11 10:40:19 -0800
commit59365eb4e1f63a1ced1667ac233058a06a8eecef (patch)
tree790fbb2caaf5a3595e3b2eb2496eb8ba52ca22c6 /altosui/AltosGraphUI.java
parent2a9ca1dcd00da2cfdd0a2ea616308dfb64ee80d4 (diff)
altosui: Remove graph series which aren't available
Make sure all graph series have actual data underlying them by checking the available data before creating the series objects. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosGraphUI.java')
-rw-r--r--altosui/AltosGraphUI.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java
index 2dded9a2..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;
}
@@ -44,17 +47,18 @@ public class AltosGraphUI extends AltosUIFrame
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);