projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Use installed arm compiler for LPC
[fw/altos]
/
altosui
/
AltosIgniteUI.java
diff --git
a/altosui/AltosIgniteUI.java
b/altosui/AltosIgniteUI.java
index 806b87b9d4e9fcdb60d7eb27a1d4e6c508461b52..14d4eebcbaf210013215e704ae3b7849613a2161 100644
(file)
--- a/
altosui/AltosIgniteUI.java
+++ b/
altosui/AltosIgniteUI.java
@@
-20,17
+20,14
@@
package altosui;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
-import javax.swing.filechooser.FileNameExtensionFilter;
-import javax.swing.table.*;
-import javax.swing.event.*;
import java.io.*;
import java.io.*;
-import java.util.*;
import java.text.*;
import java.text.*;
-import java.util.prefs.*;
import java.util.concurrent.*;
import java.util.concurrent.*;
+import org.altusmetrum.altoslib_1.*;
+import org.altusmetrum.altosuilib_1.*;
public class AltosIgniteUI
public class AltosIgniteUI
- extends
J
Dialog
+ extends
AltosUI
Dialog
implements ActionListener
{
AltosDevice device;
implements ActionListener
{
AltosDevice device;
@@
-71,12
+68,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;
@@
-122,8
+122,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) {
@@
-306,7
+305,7
@@
public class AltosIgniteUI
private boolean open() {
command_queue = new LinkedBlockingQueue<String>();
private boolean open() {
command_queue = new LinkedBlockingQueue<String>();
- device = AltosDeviceDialog.show(owner, Altos.product_any);
+ device = AltosDevice
UI
Dialog.show(owner, Altos.product_any);
if (device != null) {
IgniteHandler handler = new IgniteHandler(owner);
Thread t = new Thread(handler);
if (device != null) {
IgniteHandler handler = new IgniteHandler(owner);
Thread t = new Thread(handler);
@@
-341,8
+340,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;
@@
-412,7
+411,6
@@
public class AltosIgniteUI
close.addActionListener(this);
close.setActionCommand("close");
close.addActionListener(this);
close.setActionCommand("close");
-
pack();
setLocationRelativeTo(owner);
pack();
setLocationRelativeTo(owner);