projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/telelco-v3.0: Merge info into one screen
[fw/altos]
/
altosui
/
AltosIdleMonitorUI.java
diff --git
a/altosui/AltosIdleMonitorUI.java
b/altosui/AltosIdleMonitorUI.java
index 8d0d807e7e515405831cc6d502fc807f3f88c4b3..ba894c71885663a4a2962c719718c73f25c2a369 100644
(file)
--- a/
altosui/AltosIdleMonitorUI.java
+++ b/
altosui/AltosIdleMonitorUI.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-24,8
+25,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_1
1
.*;
-import org.altusmetrum.altosuilib_1
1
.*;
+import org.altusmetrum.altoslib_1
4
.*;
+import org.altusmetrum.altosuilib_1
4
.*;
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosIdleMonitorListener, DocumentListener {
AltosDevice device;
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosIdleMonitorListener, DocumentListener {
AltosDevice device;
@@
-33,12
+34,12
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
AltosPad pad;
AltosInfoTable flightInfo;
AltosFlightStatus flightStatus;
AltosPad pad;
AltosInfoTable flightInfo;
AltosFlightStatus flightStatus;
- AltosIgnitor ignit
o
r;
+ AltosIgnitor ignit
e
r;
AltosIdleMonitor thread;
AltosIdleMonitor thread;
- AltosUIMap
New
sitemap;
+ AltosUIMap
sitemap;
int serial;
boolean remote;
int serial;
boolean remote;
- boolean has_ignit
o
r;
+ boolean has_ignit
e
r;
boolean has_map;
void stop_display() {
boolean has_map;
void stop_display() {
@@
-74,15
+75,15
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
public void show(AltosState state, AltosListenerState listener_state) {
status_update.saved_state = state;
public void show(AltosState state, AltosListenerState listener_state) {
status_update.saved_state = state;
- if (ignit
o
r.should_show(state)) {
- if (!has_ignit
o
r) {
- pane.add("Ignitor", ignit
o
r);
- has_ignit
o
r = true;
+ if (ignit
e
r.should_show(state)) {
+ if (!has_ignit
e
r) {
+ pane.add("Ignitor", ignit
e
r);
+ has_ignit
e
r = true;
}
} else {
}
} else {
- if (has_ignit
o
r) {
- pane.remove(ignit
o
r);
- has_ignit
o
r = false;
+ if (has_ignit
e
r) {
+ pane.remove(ignit
e
r);
+ has_ignit
e
r = false;
}
}
if (state.gps != null && state.gps.connected) {
}
}
if (state.gps != null && state.gps.connected) {
@@
-101,8
+102,8
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
pad.show(state, listener_state);
flightStatus.show(state, listener_state);
flightInfo.show(state, listener_state);
pad.show(state, listener_state);
flightStatus.show(state, listener_state);
flightInfo.show(state, listener_state);
- if (has_ignit
o
r)
- ignit
o
r.show(state, listener_state);
+ if (has_ignit
e
r)
+ ignit
e
r.show(state, listener_state);
if (has_map)
sitemap.show(state, listener_state);
// } catch (Exception e) {
if (has_map)
sitemap.show(state, listener_state);
// } catch (Exception e) {
@@
-208,7
+209,7
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
device = AltosDeviceUIDialog.show(in_owner, Altos.product_any);
remote = false;
device = AltosDeviceUIDialog.show(in_owner, Altos.product_any);
remote = false;
- if (
!device.matchProduct(Altos.product_altimeter
))
+ if (
device.matchProduct(Altos.product_basestation
))
remote = true;
serial = device.getSerial();
remote = true;
serial = device.getSerial();
@@
-225,7
+226,7
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
/* We let the user set the freq/callsign, so don't bother with the cancel dialog */
link.set_cancel_enable(false);
/* We let the user set the freq/callsign, so don't bother with the cancel dialog */
link.set_cancel_enable(false);
- bag = get
Content
Pane();
+ bag = get
Scrollable
Pane();
bag.setLayout(new GridBagLayout());
setTitle(String.format("AltOS %s", device.toShortString()));
bag.setLayout(new GridBagLayout());
setTitle(String.format("AltOS %s", device.toShortString()));
@@
-273,9
+274,9
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
flightInfo = new AltosInfoTable();
pane.add("Table", new JScrollPane(flightInfo));
flightInfo = new AltosInfoTable();
pane.add("Table", new JScrollPane(flightInfo));
- ignit
o
r = new AltosIgnitor();
+ ignit
e
r = new AltosIgnitor();
- sitemap = new AltosUIMap
New
();
+ sitemap = new AltosUIMap();
/* Make the tabbed pane use the rest of the window space */
bag.add(pane, constraints(0, 4, GridBagConstraints.BOTH));
/* Make the tabbed pane use the rest of the window space */
bag.add(pane, constraints(0, 4, GridBagConstraints.BOTH));
@@
-294,7
+295,9
@@
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
pack();
setVisible(true);
pack();
setVisible(true);
- thread = new AltosIdleMonitor((AltosIdleMonitorListener) this, link, (boolean) remote);
+ thread = new AltosIdleMonitor(this, link, (boolean) remote);
+
+ thread.set_frequency(AltosUIPreferences.frequency(serial));
status_update = new AltosFlightStatusUpdate(flightStatus);
status_update = new AltosFlightStatusUpdate(flightStatus);