projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Fix available flight log storage computation
[fw/altos]
/
altosui
/
AltosUI.java
diff --git
a/altosui/AltosUI.java
b/altosui/AltosUI.java
index b5cbefe73a352ae78362c3d1c4679b5eef21a8c9..a6742f2f360d04e47b3de019a18602fead237d19 100644
(file)
--- a/
altosui/AltosUI.java
+++ b/
altosui/AltosUI.java
@@
-22,9
+22,10
@@
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
-import org.altusmetrum.AltosLib.*;
+import org.altusmetrum.altoslib_1.*;
+import org.altusmetrum.altosuilib_1.*;
-public class AltosUI extends AltosFrame {
+public class AltosUI extends Altos
UI
Frame {
public AltosVoice voice = new AltosVoice();
public static boolean load_library(Frame frame) {
public AltosVoice voice = new AltosVoice();
public static boolean load_library(Frame frame) {
@@
-47,7
+48,7
@@
public class AltosUI extends AltosFrame {
} catch (FileNotFoundException ee) {
JOptionPane.showMessageDialog(AltosUI.this,
ee.getMessage(),
} catch (FileNotFoundException ee) {
JOptionPane.showMessageDialog(AltosUI.this,
ee.getMessage(),
-
"Cannot open target device"
,
+
String.format ("Cannot open %s", device.toShortString())
,
JOptionPane.ERROR_MESSAGE);
} catch (AltosSerialInUseException si) {
JOptionPane.showMessageDialog(AltosUI.this,
JOptionPane.ERROR_MESSAGE);
} catch (AltosSerialInUseException si) {
JOptionPane.showMessageDialog(AltosUI.this,
@@
-57,17
+58,17
@@
public class AltosUI extends AltosFrame {
JOptionPane.ERROR_MESSAGE);
} catch (IOException ee) {
JOptionPane.showMessageDialog(AltosUI.this,
JOptionPane.ERROR_MESSAGE);
} catch (IOException ee) {
JOptionPane.showMessageDialog(AltosUI.this,
-
device.toShortString(
),
- "Unk
on
wn I/O error",
+
String.format ("Unknown I/O error on %s", device.toShortString()
),
+ "Unk
no
wn I/O error",
JOptionPane.ERROR_MESSAGE);
} catch (TimeoutException te) {
JOptionPane.showMessageDialog(this,
JOptionPane.ERROR_MESSAGE);
} catch (TimeoutException te) {
JOptionPane.showMessageDialog(this,
-
device.toShortString(
),
+
String.format ("Timeout on %s", device.toShortString()
),
"Timeout error",
JOptionPane.ERROR_MESSAGE);
} catch (InterruptedException ie) {
JOptionPane.showMessageDialog(this,
"Timeout error",
JOptionPane.ERROR_MESSAGE);
} catch (InterruptedException ie) {
JOptionPane.showMessageDialog(this,
-
device.toShortString(
),
+
String.format("Interrupted %s", device.toShortString()
),
"Interrupted exception",
JOptionPane.ERROR_MESSAGE);
}
"Interrupted exception",
JOptionPane.ERROR_MESSAGE);
}
@@
-223,14
+224,6
@@
public class AltosUI extends AltosFrame {
doLayout();
validate();
doLayout();
validate();
- setVisible(true);
-
- Insets i = getInsets();
- Dimension ps = rootPane.getPreferredSize();
- ps.width += i.left + i.right;
- ps.height += i.top + i.bottom;
- setPreferredSize(ps);
- setSize(ps);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
@@
-238,10
+231,15
@@
public class AltosUI extends AltosFrame {
System.exit(0);
}
});
System.exit(0);
}
});
+
+ setLocationByPlatform(false);
+
+ /* Insets aren't set before the window is visible */
+ setVisible(true);
}
private void ConnectToDevice() {
}
private void ConnectToDevice() {
- AltosDevice device = AltosDeviceDialog.show(AltosUI.this,
+ AltosDevice device = AltosDevice
UI
Dialog.show(AltosUI.this,
Altos.product_basestation);
if (device != null)
Altos.product_basestation);
if (device != null)
@@
-444,6
+442,8
@@
public class AltosUI extends AltosFrame {
//AltosReplayReader reader;
if (file.getName().endsWith("eeprom")) {
recs = new AltosEepromIterable(in);
//AltosReplayReader reader;
if (file.getName().endsWith("eeprom")) {
recs = new AltosEepromIterable(in);
+ } else if (file.getName().endsWith("mega")) {
+ recs = new AltosEepromMegaIterable(in);
} else {
recs = new AltosTelemetryIterable(in);
}
} else {
recs = new AltosTelemetryIterable(in);
}
@@
-549,7
+549,6
@@
public class AltosUI extends AltosFrame {
/* Handle batch-mode */
if (args.length == 0) {
AltosUI altosui = new AltosUI();
/* Handle batch-mode */
if (args.length == 0) {
AltosUI altosui = new AltosUI();
- altosui.setVisible(true);
java.util.List<AltosDevice> devices = AltosUSBDevice.list(Altos.product_basestation);
for (AltosDevice device : devices)
java.util.List<AltosDevice> devices = AltosUSBDevice.list(Altos.product_basestation);
for (AltosDevice device : devices)