From 8463ffcaca6bcd31e645aba71c171f548dce96d8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Nov 2010 15:19:14 -0800 Subject: altosui: Eliminate unncessary import altosui lines Java appears to automatically import every module from the current package. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosUI.java | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'ao-tools/altosui/AltosUI.java') diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 2861444d..9ab451de 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -28,25 +28,6 @@ import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; -import altosui.Altos; -import altosui.AltosSerial; -import altosui.AltosSerialMonitor; -import altosui.AltosRecord; -import altosui.AltosTelemetry; -import altosui.AltosState; -import altosui.AltosDeviceDialog; -import altosui.AltosPreferences; -import altosui.AltosLog; -import altosui.AltosVoice; -import altosui.AltosFlightInfoTableModel; -import altosui.AltosFlashUI; -import altosui.AltosLogfileChooser; -import altosui.AltosCSVUI; -import altosui.AltosLine; -import altosui.AltosStatusTable; -import altosui.AltosInfoTable; -import altosui.AltosDisplayThread; - import libaltosJNI.*; public class AltosUI extends JFrame { -- cgit v1.2.3 From dcfa56498d1b65a213b8aba9cbd6c4806532383c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Nov 2010 16:07:04 -0800 Subject: altosui: Open serial device at 'new' time. Prohibit duplicate opens. With the per-serial UI, there's never a reason to create a serial device without opening it right away. This eliminates the bug caused by not opening the serial device for telemetry reception. Serial devices can now be opened only once; this eliminates errors when trying to reflash or configure devices while receiving telemetry. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosConfig.java | 9 +++++++-- ao-tools/altosui/AltosDebug.java | 11 ++++++++--- ao-tools/altosui/AltosEepromDownload.java | 9 +++++++-- ao-tools/altosui/AltosFlash.java | 13 +++++-------- ao-tools/altosui/AltosFlashUI.java | 11 ++++++++--- ao-tools/altosui/AltosSerial.java | 28 +++++++++++++++++----------- ao-tools/altosui/AltosTelemetryReader.java | 5 +++-- ao-tools/altosui/AltosUI.java | 6 ++++++ ao-tools/altosui/Makefile.am | 1 + 9 files changed, 62 insertions(+), 31 deletions(-) (limited to 'ao-tools/altosui/AltosUI.java') diff --git a/ao-tools/altosui/AltosConfig.java b/ao-tools/altosui/AltosConfig.java index 30f7d541..09e204a9 100644 --- a/ao-tools/altosui/AltosConfig.java +++ b/ao-tools/altosui/AltosConfig.java @@ -231,10 +231,9 @@ public class AltosConfig implements Runnable, ActionListener { product = new string_ref("unknown"); device = AltosDeviceDialog.show(owner, AltosDevice.product_any); - serial_line = new AltosSerial(); if (device != null) { try { - serial_line.open(device); + serial_line = new AltosSerial(device); if (!device.matchProduct(AltosDevice.product_telemetrum)) remote = true; config_thread = new Thread(this); @@ -245,6 +244,12 @@ public class AltosConfig implements Runnable, ActionListener { device.getPath()), "Cannot open target device", JOptionPane.ERROR_MESSAGE); + } catch (AltosSerialInUseException si) { + JOptionPane.showMessageDialog(owner, + String.format("Device \"%s\" already in use", + device.getPath()), + "Device in use", + JOptionPane.ERROR_MESSAGE); } catch (IOException ee) { JOptionPane.showMessageDialog(owner, device.getPath(), diff --git a/ao-tools/altosui/AltosDebug.java b/ao-tools/altosui/AltosDebug.java index 9c10129d..9aa35d3f 100644 --- a/ao-tools/altosui/AltosDebug.java +++ b/ao-tools/altosui/AltosDebug.java @@ -19,9 +19,10 @@ package altosui; import java.lang.*; import java.io.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.LinkedList; -import java.util.Iterator; +import java.util.concurrent.*; +import java.util.*; + +import libaltosJNI.*; public class AltosDebug extends AltosSerial { @@ -259,4 +260,8 @@ public class AltosDebug extends AltosSerial { public void reset() { printf ("R\n"); } + + public AltosDebug (altos_device in_device) throws FileNotFoundException, AltosSerialInUseException { + super(in_device); + } } \ No newline at end of file diff --git a/ao-tools/altosui/AltosEepromDownload.java b/ao-tools/altosui/AltosEepromDownload.java index bd9e4b48..8996b924 100644 --- a/ao-tools/altosui/AltosEepromDownload.java +++ b/ao-tools/altosui/AltosEepromDownload.java @@ -244,12 +244,11 @@ public class AltosEepromDownload implements Runnable { frame = given_frame; device = AltosDeviceDialog.show(frame, AltosDevice.product_any); - serial_line = new AltosSerial(); remote = false; if (device != null) { try { - serial_line.open(device); + serial_line = new AltosSerial(device); if (!device.matchProduct(AltosDevice.product_telemetrum)) remote = true; eeprom_thread = new Thread(this); @@ -260,6 +259,12 @@ public class AltosEepromDownload implements Runnable { device.getPath()), "Cannot open target device", JOptionPane.ERROR_MESSAGE); + } catch (AltosSerialInUseException si) { + JOptionPane.showMessageDialog(frame, + String.format("Device \"%s\" already in use", + device.getPath()), + "Device in use", + JOptionPane.ERROR_MESSAGE); } catch (IOException ee) { JOptionPane.showMessageDialog(frame, device.getPath(), diff --git a/ao-tools/altosui/AltosFlash.java b/ao-tools/altosui/AltosFlash.java index 25b4a06e..fa2465d3 100644 --- a/ao-tools/altosui/AltosFlash.java +++ b/ao-tools/altosui/AltosFlash.java @@ -329,17 +329,14 @@ public class AltosFlash { return rom_config; } - public void open() throws IOException, FileNotFoundException, InterruptedException { + public AltosFlash(File in_file, AltosDevice in_debug_dongle) + throws IOException, FileNotFoundException, AltosSerialInUseException, InterruptedException { + file = in_file; + debug_dongle = in_debug_dongle; + debug = new AltosDebug(in_debug_dongle); input = new FileInputStream(file); image = new AltosHexfile(input); - debug.open(debug_dongle); if (!debug.check_connection()) throw new IOException("Debug port not connected"); } - - public AltosFlash(File in_file, AltosDevice in_debug_dongle) { - file = in_file; - debug_dongle = in_debug_dongle; - debug = new AltosDebug(); - } } \ No newline at end of file diff --git a/ao-tools/altosui/AltosFlashUI.java b/ao-tools/altosui/AltosFlashUI.java index 70c8c549..b09cb594 100644 --- a/ao-tools/altosui/AltosFlashUI.java +++ b/ao-tools/altosui/AltosFlashUI.java @@ -65,10 +65,9 @@ public class AltosFlashUI } public void run() { - flash = new AltosFlash(file, debug_dongle); - flash.addActionListener(this); try { - flash.open(); + flash = new AltosFlash(file, debug_dongle); + flash.addActionListener(this); AltosRomconfigUI romconfig_ui = new AltosRomconfigUI (frame); romconfig_ui.set(flash.romconfig()); @@ -88,6 +87,12 @@ public class AltosFlashUI "Cannot open image", file.toString(), JOptionPane.ERROR_MESSAGE); + } catch (AltosSerialInUseException si) { + JOptionPane.showMessageDialog(frame, + String.format("Device \"%s\" already in use", + debug_dongle.getPath()), + "Device in use", + JOptionPane.ERROR_MESSAGE); } catch (IOException e) { JOptionPane.showMessageDialog(frame, e.getMessage(), diff --git a/ao-tools/altosui/AltosSerial.java b/ao-tools/altosui/AltosSerial.java index 6787e0c8..99a92fdb 100644 --- a/ao-tools/altosui/AltosSerial.java +++ b/ao-tools/altosui/AltosSerial.java @@ -23,9 +23,8 @@ package altosui; import java.lang.*; import java.io.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.LinkedList; -import java.util.Iterator; +import java.util.concurrent.*; +import java.util.*; import libaltosJNI.*; @@ -37,6 +36,9 @@ import libaltosJNI.*; public class AltosSerial implements Runnable { + static List devices_opened = Collections.synchronizedList(new LinkedList()); + + altos_device device; SWIGTYPE_p_altos_file altos; LinkedList> monitors; LinkedBlockingQueue reply_queue; @@ -141,10 +143,6 @@ public class AltosSerial implements Runnable { set_monitor(false); } - public boolean opened() { - return altos != null; - } - public void close() { if (altos != null) { libaltos.altos_close(altos); @@ -161,6 +159,9 @@ public class AltosSerial implements Runnable { libaltos.altos_free(altos); altos = null; } + synchronized (devices_opened) { + devices_opened.remove(device.getPath()); + } } public void putc(char c) { @@ -178,7 +179,12 @@ public class AltosSerial implements Runnable { print(String.format(format, arguments)); } - public void open(altos_device device) throws FileNotFoundException { + private void open() throws FileNotFoundException, AltosSerialInUseException { + synchronized (devices_opened) { + if (devices_opened.contains(device.getPath())) + throw new AltosSerialInUseException(device); + devices_opened.add(device.getPath()); + } close(); altos = libaltos.altos_open(device); if (altos == null) @@ -220,12 +226,12 @@ public class AltosSerial implements Runnable { } } - public AltosSerial() { - altos = null; - input_thread = null; + public AltosSerial(altos_device in_device) throws FileNotFoundException, AltosSerialInUseException { + device = in_device; line = ""; monitor_mode = false; monitors = new LinkedList> (); reply_queue = new LinkedBlockingQueue (); + open(); } } diff --git a/ao-tools/altosui/AltosTelemetryReader.java b/ao-tools/altosui/AltosTelemetryReader.java index 0b5509eb..ff02c722 100644 --- a/ao-tools/altosui/AltosTelemetryReader.java +++ b/ao-tools/altosui/AltosTelemetryReader.java @@ -50,9 +50,10 @@ class AltosTelemetryReader extends AltosFlightReader { serial.set_callsign(callsign); } - public AltosTelemetryReader (AltosDevice in_device) throws FileNotFoundException, IOException { + public AltosTelemetryReader (AltosDevice in_device) + throws FileNotFoundException, AltosSerialInUseException, IOException { device = in_device; - serial = new AltosSerial(); + serial = new AltosSerial(device); log = new AltosLog(serial); name = device.getPath(); diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 9ab451de..0d8f0e8d 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -56,6 +56,12 @@ public class AltosUI extends JFrame { device.getPath()), "Cannot open target device", JOptionPane.ERROR_MESSAGE); + } catch (AltosSerialInUseException si) { + JOptionPane.showMessageDialog(AltosUI.this, + String.format("Device \"%s\" already in use", + device.getPath()), + "Device in use", + JOptionPane.ERROR_MESSAGE); } catch (IOException ee) { JOptionPane.showMessageDialog(AltosUI.this, device.getPath(), diff --git a/ao-tools/altosui/Makefile.am b/ao-tools/altosui/Makefile.am index 267bae63..f4c743df 100644 --- a/ao-tools/altosui/Makefile.am +++ b/ao-tools/altosui/Makefile.am @@ -58,6 +58,7 @@ altosui_JAVA = \ AltosRomconfig.java \ AltosRomconfigUI.java \ AltosSerial.java \ + AltosSerialInUseException.java \ AltosSerialMonitor.java \ AltosState.java \ AltosStatusTable.java \ -- cgit v1.2.3 From 511903704f7e1b22e88dd3e3cc35fd3c0583820e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 14 Nov 2010 03:26:57 -0800 Subject: altosui: With --replay option, exit when replay window is closed Otherwise, the application hangs around forever. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosFlightUI.java | 10 ++++++++- ao-tools/altosui/AltosUI.java | 41 +++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 21 deletions(-) (limited to 'ao-tools/altosui/AltosUI.java') diff --git a/ao-tools/altosui/AltosFlightUI.java b/ao-tools/altosui/AltosFlightUI.java index ae31048d..5134a24e 100644 --- a/ao-tools/altosui/AltosFlightUI.java +++ b/ao-tools/altosui/AltosFlightUI.java @@ -56,6 +56,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { int cur_tab = 0; + boolean exit_on_close = false; + int which_tab(AltosState state) { if (state.state < Altos.ao_flight_boost) return tab_pad; @@ -122,8 +124,12 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { flightInfo.show(state, crc_errors); } + public void set_exit_on_close() { + exit_on_close = true; + } + public AltosFlightUI(AltosVoice in_voice, AltosFlightReader in_reader, final int serial) { - AltosPreferences.init(this); + AltosPreferences.init(this); voice = in_voice; reader = in_reader; @@ -191,6 +197,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { disconnect(); setVisible(false); dispose(); + if (exit_on_close) + System.exit(0); } }); diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 0d8f0e8d..a2e416ba 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -443,26 +443,27 @@ public class AltosUI extends JFrame { public static void main(final String[] args) { int process = 0; /* Handle batch-mode */ - if (args.length == 2 && args[0].equals("--replay")) { - String filename = args[1]; - FileInputStream in; - try { - in = new FileInputStream(filename); - } catch (Exception e) { - System.out.printf("Failed to open file '%s'\n", filename); - return; - } - AltosRecordIterable recs; - AltosReplayReader reader; - if (filename.endsWith("eeprom")) { - recs = new AltosEepromIterable(in); - } else { - recs = new AltosTelemetryIterable(in); - } - reader = new AltosReplayReader(recs.iterator(), filename); - new AltosFlightUI(new AltosVoice(), reader); - return; - } else if (args.length > 0) { + if (args.length == 2 && args[0].equals("--replay")) { + String filename = args[1]; + FileInputStream in; + try { + in = new FileInputStream(filename); + } catch (Exception e) { + System.out.printf("Failed to open file '%s'\n", filename); + return; + } + AltosRecordIterable recs; + AltosReplayReader reader; + if (filename.endsWith("eeprom")) { + recs = new AltosEepromIterable(in); + } else { + recs = new AltosTelemetryIterable(in); + } + reader = new AltosReplayReader(recs.iterator(), filename); + AltosFlightUI flight_ui = new AltosFlightUI(new AltosVoice(), reader); + flight_ui.set_exit_on_close(); + return; + } else if (args.length > 0) { for (int i = 0; i < args.length; i++) { if (args[i].equals("--kml")) process |= process_kml; -- cgit v1.2.3 From 257e97137325f5dbbd6aa034f20fd6937b67df90 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 15 Nov 2010 22:38:35 +0800 Subject: altosui: eliminate menu bar, moving elements to buttons. This adds a new 'configure AltosUI' dialog to set the log directory and voice preferences. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosConfigureUI.java | 120 +++++++++++++++++++++++++ ao-tools/altosui/AltosUI.java | 158 +++++---------------------------- ao-tools/altosui/Makefile.am | 1 + 3 files changed, 144 insertions(+), 135 deletions(-) create mode 100644 ao-tools/altosui/AltosConfigureUI.java (limited to 'ao-tools/altosui/AltosUI.java') diff --git a/ao-tools/altosui/AltosConfigureUI.java b/ao-tools/altosui/AltosConfigureUI.java new file mode 100644 index 00000000..88c180f1 --- /dev/null +++ b/ao-tools/altosui/AltosConfigureUI.java @@ -0,0 +1,120 @@ +/* + * Copyright © 2010 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +package altosui; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import javax.swing.filechooser.FileNameExtensionFilter; +import javax.swing.table.*; +import java.io.*; +import java.util.*; +import java.text.*; +import java.util.prefs.*; +import java.util.concurrent.LinkedBlockingQueue; + +public class AltosConfigureUI extends JDialog { + JFrame owner; + AltosVoice voice; + Container pane; + + JRadioButton enable_voice; + JButton test_voice; + JButton close; + + JButton configure_log; + JTextField log_directory; + + public AltosConfigureUI(JFrame in_owner, AltosVoice in_voice) { + super(in_owner, "Configure AltosUI", false); + + GridBagConstraints c; + + Insets insets = new Insets(4, 4, 4, 4); + + owner = in_owner; + voice = in_voice; + pane = getContentPane(); + pane.setLayout(new GridBagLayout()); + + c = new GridBagConstraints(); + c.insets = insets; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.CENTER; + + /* Enable Voice */ + c.gridx = 0; + c.gridy = 0; + enable_voice = new JRadioButton("Enable Voice", AltosPreferences.voice()); + enable_voice.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + JRadioButton item = (JRadioButton) e.getSource(); + boolean enabled = item.isSelected(); + AltosPreferences.set_voice(enabled); + if (enabled) + voice.speak_always("Enable voice."); + else + voice.speak_always("Disable voice."); + } + }); + pane.add(enable_voice, c); + c.gridx = 1; + c.gridy = 0; + test_voice = new JButton("Test Voice"); + test_voice.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + voice.speak("That's one small step for man; one giant leap for mankind."); + } + }); + pane.add(test_voice, c); + + close = new JButton("Close"); + close.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + setVisible(false); + } + }); + c.gridx = 0; + c.gridy = 3; + c.gridwidth = 2; + pane.add(close, c); + + configure_log = new JButton("Configure Log"); + configure_log.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + AltosPreferences.ConfigureLog(); + log_directory.setText(AltosPreferences.logdir().getPath()); + } + }); + c.gridwidth = 1; + + c.gridx = 0; + c.gridy = 2; + pane.add(configure_log, c); + + log_directory = new JTextField(AltosPreferences.logdir().getPath()); + c.gridx = 1; + c.gridy = 2; + c.fill = GridBagConstraints.BOTH; + pane.add(log_directory, c); + + pack(); + setLocationRelativeTo(owner); + setVisible(true); + } +} diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index a2e416ba..bedf2459 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -144,9 +144,28 @@ public class AltosUI extends JFrame { } }); - setTitle("AltOS"); + b = addButton(0, 2, "Configure AltosUI"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + ConfigureAltosUI(); + } + }); + + b = addButton(1, 2, "Flash Image"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + FlashImage(); + } + }); + + b = addButton(2, 2, "Quit"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.exit(0); + } + }); - createMenu(); + setTitle("AltOS"); pane.doLayout(); pane.validate(); @@ -232,139 +251,8 @@ public class AltosUI extends JFrame { new AltosGraphUI(AltosUI.this); } - /* Create the AltosUI menus - */ - private void createMenu() { - JMenuBar menubar = new JMenuBar(); - JMenu menu; - JMenuItem item; - JRadioButtonMenuItem radioitem; - - // File menu - { - menu = new JMenu("File"); - menu.setMnemonic(KeyEvent.VK_F); - menubar.add(menu); - - item = new JMenuItem("Flash Image",KeyEvent.VK_I); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - FlashImage(); - } - }); - menu.add(item); - - item = new JMenuItem("Export Data",KeyEvent.VK_E); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - ExportData(); - } - }); - menu.add(item); - - item = new JMenuItem("Graph Data",KeyEvent.VK_G); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - GraphData(); - } - }); - menu.add(item); - - item = new JMenuItem("Quit",KeyEvent.VK_Q); - item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, - ActionEvent.CTRL_MASK)); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - System.out.printf("exiting\n"); - System.exit(0); - } - }); - menu.add(item); - } - - // Device menu - if (false) { - menu = new JMenu("Device"); - menu.setMnemonic(KeyEvent.VK_D); - menubar.add(menu); - - item = new JMenuItem("Connect to Device",KeyEvent.VK_C); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - ConnectToDevice(); - } - }); - menu.add(item); - - menu.addSeparator(); - - item = new JMenuItem("Set Callsign",KeyEvent.VK_S); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - ConfigureCallsign(); - } - }); - - 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 - { - menu = new JMenu("Log"); - menu.setMnemonic(KeyEvent.VK_L); - menubar.add(menu); - - item = new JMenuItem("New Log",KeyEvent.VK_N); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - } - }); - menu.add(item); - - item = new JMenuItem("Configure Log",KeyEvent.VK_C); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - AltosPreferences.ConfigureLog(); - } - }); - menu.add(item); - } - // Voice menu - { - menu = new JMenu("Voice", true); - menu.setMnemonic(KeyEvent.VK_V); - menubar.add(menu); - - radioitem = new JRadioButtonMenuItem("Enable Voice", AltosPreferences.voice()); - radioitem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - JRadioButtonMenuItem item = (JRadioButtonMenuItem) e.getSource(); - boolean enabled = item.isSelected(); - AltosPreferences.set_voice(enabled); - if (enabled) - voice.speak_always("Enable voice."); - else - voice.speak_always("Disable voice."); - } - }); - menu.add(radioitem); - item = new JMenuItem("Test Voice",KeyEvent.VK_T); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - voice.speak("That's one small step for man; one giant leap for mankind."); - } - }); - menu.add(item); - } - this.setJMenuBar(menubar); + private void ConfigureAltosUI() { + new AltosConfigureUI(AltosUI.this, voice); } static AltosRecordIterable open_logfile(String filename) { diff --git a/ao-tools/altosui/Makefile.am b/ao-tools/altosui/Makefile.am index d11ea3e2..8d0fe16e 100644 --- a/ao-tools/altosui/Makefile.am +++ b/ao-tools/altosui/Makefile.am @@ -14,6 +14,7 @@ altosui_JAVA = \ AltosChannelMenu.java \ AltosConfig.java \ AltosConfigUI.java \ + AltosConfigureUI.java \ AltosConvert.java \ AltosCRCException.java \ AltosCSV.java \ -- cgit v1.2.3