projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosdroid: tidy up old messages
[fw/altos]
/
altosui
/
AltosIgniteUI.java
diff --git
a/altosui/AltosIgniteUI.java
b/altosui/AltosIgniteUI.java
index 42120b92d0250d7124d0cccb2adcdcd7ab9c5650..78eba8e66bec1d9473c951335a82455e5edf6371 100644
(file)
--- a/
altosui/AltosIgniteUI.java
+++ b/
altosui/AltosIgniteUI.java
@@
-28,9
+28,10
@@
import java.util.*;
import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.*;
import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.*;
+import org.altusmetrum.AltosLib.*;
public class AltosIgniteUI
public class AltosIgniteUI
- extends
J
Dialog
+ extends
Altos
Dialog
implements ActionListener
{
AltosDevice device;
implements ActionListener
{
AltosDevice device;
@@
-43,6
+44,7
@@
public class AltosIgniteUI
JToggleButton arm;
JButton fire;
javax.swing.Timer timer;
JToggleButton arm;
JButton fire;
javax.swing.Timer timer;
+ JButton close;
int apogee_status;
int main_status;
int apogee_status;
int main_status;
@@
-70,12
+72,15
@@
public class AltosIgniteUI
public void run () {
try {
public void run () {
try {
- ignite = new AltosIgnite(device);
+ AltosSerial serial = new AltosSerial(device);
+ serial.set_frame(owner);
+ ignite = new AltosIgnite(serial,
+ !device.matchProduct(Altos.product_altimeter));
+
} catch (Exception e) {
send_exception(e);
return;
}
} catch (Exception e) {
send_exception(e);
return;
}
- ignite.set_frame(owner);
for (;;) {
Runnable r;
for (;;) {
Runnable r;
@@
-121,8
+126,7
@@
public class AltosIgniteUI
void ignite_exception(Exception e) {
if (e instanceof FileNotFoundException) {
JOptionPane.showMessageDialog(owner,
void ignite_exception(Exception e) {
if (e instanceof FileNotFoundException) {
JOptionPane.showMessageDialog(owner,
- String.format("Cannot open device \"%s\"",
- device.toShortString()),
+ ((FileNotFoundException) e).getMessage(),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} else if (e instanceof AltosSerialInUseException) {
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} else if (e instanceof AltosSerialInUseException) {
@@
-340,8
+344,8
@@
public class AltosIgniteUI
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.CENTER;
c.insets = i;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.CENTER;
c.insets = i;
- c.weightx =
1
;
- c.weighty =
1
;
+ c.weightx =
0
;
+ c.weighty =
0
;
c.gridx = 0;
c.gridy = 0;
c.gridx = 0;
c.gridy = 0;
@@
-402,6
+406,15
@@
public class AltosIgniteUI
fire.addActionListener(this);
fire.setActionCommand("fire");
fire.addActionListener(this);
fire.setActionCommand("fire");
+ c.gridx = 0;
+ c.gridy = 4;
+ c.gridwidth = 2;
+ c.anchor = GridBagConstraints.CENTER;
+ close = new JButton ("Close");
+ pane.add(close, c);
+ close.addActionListener(this);
+ close.setActionCommand("close");
+
pack();
setLocationRelativeTo(owner);
pack();
setLocationRelativeTo(owner);