summaryrefslogtreecommitdiff
path: root/altosui
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-03-10 09:29:52 -0600
committerKeith Packard <keithp@keithp.com>2015-03-10 09:29:52 -0600
commit2c4ebe9b4b392531cd1a5bbafc4ddc38a9391af5 (patch)
tree23439dde5b930876606b77d10d5861a6145508ff /altosui
parentdec8de9c642fea1df924a667a4779a6c6c8c3453 (diff)
altosui: Add map to MonitorIdle display
Nice to be able to verify that maps are working by using this mode, instead of needing to use flight monitoring. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui')
-rw-r--r--altosui/AltosIdleMonitorUI.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java
index 204d81ed..88243c5d 100644
--- a/altosui/AltosIdleMonitorUI.java
+++ b/altosui/AltosIdleMonitorUI.java
@@ -35,9 +35,11 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
AltosFlightStatus flightStatus;
AltosIgnitor ignitor;
AltosIdleMonitor thread;
+ AltosUIMap sitemap;
int serial;
boolean remote;
boolean has_ignitor;
+ boolean has_map;
void stop_display() {
if (thread != null) {
@@ -83,11 +85,26 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
has_ignitor = false;
}
}
+ if (state.gps != null && state.gps.connected) {
+ if (!has_map) {
+ pane.add("Site Map", sitemap);
+ has_map = true;
+ }
+ } else {
+ if (has_map) {
+ pane.remove(sitemap);
+ has_map = false;
+ }
+ }
+
// try {
pad.show(state, listener_state);
flightStatus.show(state, listener_state);
flightInfo.show(state, listener_state);
- ignitor.show(state, listener_state);
+ if (has_ignitor)
+ ignitor.show(state, listener_state);
+ if (has_map)
+ sitemap.show(state, listener_state);
// } catch (Exception e) {
// System.out.print("Show exception " + e);
// }
@@ -261,6 +278,8 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
ignitor = new AltosIgnitor();
+ sitemap = new AltosUIMap();
+
/* Make the tabbed pane use the rest of the window space */
bag.add(pane, constraints(0, 3, GridBagConstraints.BOTH));