altosui: Disable radio configation over packet link.
authorKeith Packard <keithp@keithp.com>
Wed, 24 Nov 2010 03:09:31 +0000 (19:09 -0800)
committerKeith Packard <keithp@keithp.com>
Wed, 24 Nov 2010 03:10:27 +0000 (19:10 -0800)
Attempting to configure the radio over the packet link will only end
up confusing the user, so disable it. This also works around a bug in
older TM code which would lock up when trying to do this.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/altosui/AltosConfig.java
ao-tools/altosui/AltosConfigUI.java

index 52dbfd795998b98d7ce7f84f828519cdd27ba2ad..b1acd41072e35d138f00c2d47b027ec263165117 100644 (file)
@@ -149,7 +149,7 @@ public class AltosConfig implements Runnable, ActionListener {
        }
 
        void init_ui () throws InterruptedException, TimeoutException {
        }
 
        void init_ui () throws InterruptedException, TimeoutException {
-               config_ui = new AltosConfigUI(owner);
+               config_ui = new AltosConfigUI(owner, remote);
                config_ui.addActionListener(this);
                set_ui();
        }
                config_ui.addActionListener(this);
                set_ui();
        }
@@ -191,8 +191,10 @@ public class AltosConfig implements Runnable, ActionListener {
                        start_serial();
                        serial_line.printf("c m %d\n", main_deploy.get());
                        serial_line.printf("c d %d\n", apogee_delay.get());
                        start_serial();
                        serial_line.printf("c m %d\n", main_deploy.get());
                        serial_line.printf("c d %d\n", apogee_delay.get());
-                       serial_line.printf("c r %d\n", radio_channel.get());
-                       serial_line.printf("c f %d\n", radio_calibration.get());
+                       if (!remote) {
+                               serial_line.printf("c r %d\n", radio_channel.get());
+                               serial_line.printf("c f %d\n", radio_calibration.get());
+                       }
                        serial_line.printf("c c %s\n", callsign.get());
                        serial_line.printf("c w\n");
                } catch (InterruptedException ie) {
                        serial_line.printf("c c %s\n", callsign.get());
                        serial_line.printf("c w\n");
                } catch (InterruptedException ie) {
index ca89f58d39de23b6f9becc002336efe0e43639e3..cfa5d7b9ee7b5982d7b497d8aaeeb448ef35f38e 100644 (file)
@@ -98,7 +98,7 @@ public class AltosConfigUI
        }
 
        /* Build the UI using a grid bag */
        }
 
        /* Build the UI using a grid bag */
-       public AltosConfigUI(JFrame in_owner) {
+       public AltosConfigUI(JFrame in_owner, boolean remote) {
                super (in_owner, "Configure TeleMetrum", false);
 
                owner = in_owner;
                super (in_owner, "Configure TeleMetrum", false);
 
                owner = in_owner;
@@ -244,6 +244,8 @@ public class AltosConfigUI
                radio_channel_value = new JComboBox(radio_channel_values);
                radio_channel_value.setEditable(false);
                radio_channel_value.addItemListener(this);
                radio_channel_value = new JComboBox(radio_channel_values);
                radio_channel_value.setEditable(false);
                radio_channel_value.addItemListener(this);
+               if (remote)
+                       radio_channel_value.setEnabled(false);
                pane.add(radio_channel_value, c);
 
                /* Radio Calibration */
                pane.add(radio_channel_value, c);
 
                /* Radio Calibration */
@@ -267,6 +269,8 @@ public class AltosConfigUI
                c.ipady = 5;
                radio_calibration_value = new JTextField(String.format("%d", 1186611));
                radio_calibration_value.getDocument().addDocumentListener(this);
                c.ipady = 5;
                radio_calibration_value = new JTextField(String.format("%d", 1186611));
                radio_calibration_value.getDocument().addDocumentListener(this);
+               if (remote)
+                       radio_calibration_value.setEnabled(false);
                pane.add(radio_calibration_value, c);
 
                /* Callsign */
                pane.add(radio_calibration_value, c);
 
                /* Callsign */