projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc: Add 1.9.5 release notes
[fw/altos]
/
altosuilib
/
AltosFlashUI.java
diff --git
a/altosuilib/AltosFlashUI.java
b/altosuilib/AltosFlashUI.java
index ffb39b8c2aae4e4e7b2035a9e780355114808bf8..33fdb6887238f8e530a71f7954a7d6b068fb54ba 100644
(file)
--- a/
altosuilib/AltosFlashUI.java
+++ b/
altosuilib/AltosFlashUI.java
@@
-16,7
+16,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altosuilib_1
3
;
+package org.altusmetrum.altosuilib_1
4
;
import java.awt.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.event.*;
@@
-24,7
+24,7
@@
import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.io.*;
import java.util.concurrent.*;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.io.*;
import java.util.concurrent.*;
-import org.altusmetrum.altoslib_1
3
.*;
+import org.altusmetrum.altoslib_1
4
.*;
public class AltosFlashUI
extends AltosUIDialog
public class AltosFlashUI
extends AltosUIDialog
@@
-64,8
+64,7
@@
public class AltosFlashUI
"telemetrum-v1",
"telemini-v1",
"telenano",
"telemetrum-v1",
"telemini-v1",
"telenano",
- "teleshield",
- "teleterra"
+ "teleshield"
};
private static final String[] pair_programmed_devices = {
};
private static final String[] pair_programmed_devices = {
@@
-78,8
+77,7
@@
public class AltosFlashUI
"TeleMetrum-v1",
"TeleMini-v1",
"TeleNano",
"TeleMetrum-v1",
"TeleMini-v1",
"TeleNano",
- "TeleShield",
- "TeleTerra"
+ "TeleShield"
};
private boolean is_pair_programmed() {
};
private boolean is_pair_programmed() {
@@
-133,7
+131,7
@@
public class AltosFlashUI
Insets il = new Insets(4,4,4,4);
Insets ir = new Insets(4,4,4,4);
Insets il = new Insets(4,4,4,4);
Insets ir = new Insets(4,4,4,4);
- pane = get
Content
Pane();
+ pane = get
Scrollable
Pane();
pane.setLayout(new GridBagLayout());
c = new GridBagConstraints();
pane.setLayout(new GridBagLayout());
c = new GridBagConstraints();
@@
-319,7
+317,7
@@
public class AltosFlashUI
return false;
}
return false;
}
- if (existing_config.radio_calibration_broken) {
+ if (existing_config
!= null && existing_config
.radio_calibration_broken) {
int ret = JOptionPane.showConfirmDialog(this,
String.format("Radio calibration value %d may be incorrect\nFlash anyways?",
existing_config.radio_calibration),
int ret = JOptionPane.showConfirmDialog(this,
String.format("Radio calibration value %d may be incorrect\nFlash anyways?",
existing_config.radio_calibration),
@@
-481,12
+479,24
@@
public class AltosFlashUI
public void run () {
try {
AltosLink link = null;
public void run () {
try {
AltosLink link = null;
+ boolean new_device = false;
for (;;) {
System.out.printf("Attempting to open %s\n", device.toShortString());
for (;;) {
System.out.printf("Attempting to open %s\n", device.toShortString());
- link = new AltosSerial(device);
+ for (int i = 0; i < 20; i++) {
+ link = new AltosSerial(device);
+ if (link != null)
+ break;
+
+ if (!new_device)
+ break;
+
+ System.out.printf("Waiting for device to become ready\n");
+
+ Thread.sleep(1000);
+ }
if (link == null)
throw new IOException(String.format("%s: open failed",
device.toShortString()));
if (link == null)
throw new IOException(String.format("%s: open failed",
device.toShortString()));
@@
-536,6
+546,7
@@
public class AltosFlashUI
if (!matched) {
System.out.printf("Identified new device %s\n", d.toShortString());
device = (AltosUSBDevice) d;
if (!matched) {
System.out.printf("Identified new device %s\n", d.toShortString());
device = (AltosUSBDevice) d;
+ new_device = true;
break;
}
}
break;
}
}
@@
-626,7
+637,7
@@
public class AltosFlashUI
super(in_owner, "Open Flash Target Device", true);
owner = in_owner;
super(in_owner, "Open Flash Target Device", true);
owner = in_owner;
- Container pane = get
Content
Pane();
+ Container pane = get
Scrollable
Pane();
GridBagConstraints c = new GridBagConstraints();
Insets i = new Insets(4,4,4,4);
GridBagConstraints c = new GridBagConstraints();
Insets i = new Insets(4,4,4,4);