summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-08-22 23:05:20 -0700
committerKeith Packard <keithp@keithp.com>2010-08-22 23:05:20 -0700
commit953bc3438b10b21f3d65d292356c4ab2de23cddd (patch)
tree734b5d31700e93f462e19e0076df1f0956d5a581 /ao-tools/altosui/AltosUI.java
parente1463d8e265dfd42c824d90088cd2a51b4cf8131 (diff)
altosui: Add TeleMetrum configuration
This presents a dialog with all of the user-settable options in the TeleMetrum set for editing. Combo boxes are used for everything except the callsign. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosUI.java')
-rw-r--r--ao-tools/altosui/AltosUI.java33
1 files changed, 18 insertions, 15 deletions
diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java
index 33ce274a..49d1f11a 100644
--- a/ao-tools/altosui/AltosUI.java
+++ b/ao-tools/altosui/AltosUI.java
@@ -40,6 +40,7 @@ import altosui.AltosLog;
import altosui.AltosVoice;
import altosui.AltosFlightStatusTableModel;
import altosui.AltosFlightInfoTableModel;
+import altosui.AltosChannelMenu;
import libaltosJNI.*;
@@ -453,6 +454,9 @@ public class AltosUI extends JFrame {
}
}
+ void ConfigureTeleMetrum() {
+ new AltosConfig(AltosUI.this);
+ }
/*
* Open an existing telemetry file and replay it in realtime
*/
@@ -628,6 +632,15 @@ public class AltosUI extends JFrame {
});
menu.add(item);
+
+ item = new JMenuItem("Configure TeleMetrum device",KeyEvent.VK_T);
+ item.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ ConfigureTeleMetrum();
+ }
+ });
+
+ menu.add(item);
}
// Log menu
{
@@ -680,26 +693,16 @@ public class AltosUI extends JFrame {
// Channel menu
{
- menu = new JMenu("Channel", true);
- menu.setMnemonic(KeyEvent.VK_C);
- menubar.add(menu);
- ButtonGroup group = new ButtonGroup();
-
- for (int c = 0; c <= 9; c++) {
- radioitem = new JRadioButtonMenuItem(String.format("Channel %1d (%7.3fMHz)", c,
- 434.550 + c * 0.1),
- c == AltosPreferences.channel());
- radioitem.setActionCommand(String.format("%d", c));
- radioitem.addActionListener(new ActionListener() {
+ menu = new AltosChannelMenu(AltosPreferences.channel());
+ menu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int new_channel = Integer.parseInt(e.getActionCommand());
AltosPreferences.set_channel(new_channel);
serial_line.set_channel(new_channel);
}
- });
- menu.add(radioitem);
- group.add(radioitem);
- }
+ });
+ menu.setMnemonic(KeyEvent.VK_C);
+ menubar.add(menu);
}
this.setJMenuBar(menubar);