projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Fix distance/bearing computations. Deal with large values
[fw/altos]
/
altosui
/
AltosEepromManage.java
diff --git
a/altosui/AltosEepromManage.java
b/altosui/AltosEepromManage.java
index 5fb70a8413cba0e1e5b9be39f4421b46cc3467a8..083c73725d44e4f2fa928ce8532b2fd8f7bb363d 100644
(file)
--- a/
altosui/AltosEepromManage.java
+++ b/
altosui/AltosEepromManage.java
@@
-44,7
+44,10
@@
public class AltosEepromManage implements ActionListener {
public void finish() {
if (serial_line != null) {
public void finish() {
if (serial_line != null) {
- serial_line.flush_input();
+ try {
+ serial_line.flush_input();
+ } catch (InterruptedException ie) {
+ }
serial_line.close();
serial_line = null;
}
serial_line.close();
serial_line = null;
}
@@
-168,17
+171,23
@@
public class AltosEepromManage implements ActionListener {
AltosEepromManage manage;
public void run () {
AltosEepromManage manage;
public void run () {
+ Runnable r;
try {
flights = new AltosEepromList(serial_line, remote);
try {
flights = new AltosEepromList(serial_line, remote);
-
Runnable
r = new Runnable() {
+ r = new Runnable() {
public void run() {
public void run() {
-
manage.
got_flights(flights);
+ got_flights(flights);
}
};
}
};
- SwingUtilities.invokeLater(r);
} catch (Exception e) {
} catch (Exception e) {
- manage.got_exception(e);
+ final Exception f_e = e;
+ r = new Runnable() {
+ public void run() {
+ got_exception(f_e);
+ }
+ };
}
}
+ SwingUtilities.invokeLater(r);
}
public EepromGetList(AltosEepromManage in_manage) {
}
public EepromGetList(AltosEepromManage in_manage) {
@@
-191,7
+200,7
@@
public class AltosEepromManage implements ActionListener {
boolean running = false;
frame = given_frame;
boolean running = false;
frame = given_frame;
- device = AltosDeviceDialog.show(frame, Altos
Device
.product_any);
+ device = AltosDeviceDialog.show(frame, Altos.product_any);
remote = false;
any_download = false;
remote = false;
any_download = false;
@@
-200,7
+209,7
@@
public class AltosEepromManage implements ActionListener {
if (device != null) {
try {
serial_line = new AltosSerial(device);
if (device != null) {
try {
serial_line = new AltosSerial(device);
- if (
!device.matchProduct(AltosDevice.product_telemetrum
))
+ if (
device.matchProduct(Altos.product_basestation
))
remote = true;
serial_line.set_frame(frame);
remote = true;
serial_line.set_frame(frame);
@@
-210,8
+219,7
@@
public class AltosEepromManage implements ActionListener {
t.start();
} catch (FileNotFoundException ee) {
JOptionPane.showMessageDialog(frame,
t.start();
} catch (FileNotFoundException ee) {
JOptionPane.showMessageDialog(frame,
- String.format("Cannot open device \"%s\"",
- device.toShortString()),
+ ee.getMessage(),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} catch (AltosSerialInUseException si) {
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} catch (AltosSerialInUseException si) {