X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosUI.java;h=49d1f11a67f23e04c52d69ea768d9d0a9aff8393;hp=33ce274a26d7393f31e2fc2f43f150fcb82b3e8d;hb=953bc3438b10b21f3d65d292356c4ab2de23cddd;hpb=e1463d8e265dfd42c824d90088cd2a51b4cf8131;ds=sidebyside 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);