projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosuilib: Remove old map bits
[fw/altos]
/
altosui
/
AltosIdleMonitorUI.java
diff --git
a/altosui/AltosIdleMonitorUI.java
b/altosui/AltosIdleMonitorUI.java
index 0230ff2f767959a2c73301e4c5d2ae21748a26e4..4f6fdd48149bd775007fa9354e00147949aea510 100644
(file)
--- a/
altosui/AltosIdleMonitorUI.java
+++ b/
altosui/AltosIdleMonitorUI.java
@@
-24,8
+24,8
@@
import javax.swing.event.*;
import java.io.*;
import java.util.concurrent.*;
import java.util.Arrays;
import java.io.*;
import java.util.concurrent.*;
import java.util.Arrays;
-import org.altusmetrum.altoslib_
5
.*;
-import org.altusmetrum.altosuilib_
3
.*;
+import org.altusmetrum.altoslib_
7
.*;
+import org.altusmetrum.altosuilib_
7
.*;
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosIdleMonitorListener, DocumentListener {
AltosDevice device;
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosIdleMonitorListener, DocumentListener {
AltosDevice device;
@@
-35,9
+35,11
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
AltosFlightStatus flightStatus;
AltosIgnitor ignitor;
AltosIdleMonitor thread;
AltosFlightStatus flightStatus;
AltosIgnitor ignitor;
AltosIdleMonitor thread;
+ AltosUIMapNew sitemap;
int serial;
boolean remote;
boolean has_ignitor;
int serial;
boolean remote;
boolean has_ignitor;
+ boolean has_map;
void stop_display() {
if (thread != null) {
void stop_display() {
if (thread != null) {
@@
-83,11
+85,26
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
has_ignitor = false;
}
}
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);
// 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);
// }
// } catch (Exception e) {
// System.out.print("Show exception " + e);
// }
@@
-261,6
+278,8
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
ignitor = new AltosIgnitor();
ignitor = new AltosIgnitor();
+ sitemap = new AltosUIMapNew();
+
/* Make the tabbed pane use the rest of the window space */
bag.add(pane, constraints(0, 3, GridBagConstraints.BOTH));
/* Make the tabbed pane use the rest of the window space */
bag.add(pane, constraints(0, 3, GridBagConstraints.BOTH));