2 * Copyright © 2010 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 import java.awt.event.*;
23 import javax.swing.event.*;
24 import org.altusmetrum.altoslib_3.*;
25 import org.altusmetrum.altosuilib_1.*;
27 public class AltosConfigUI
29 implements ActionListener, ItemListener, DocumentListener, AltosConfigValues, AltosUnitsListener
36 JLabel main_deploy_label;
37 JLabel apogee_delay_label;
38 JLabel apogee_lockout_label;
39 JLabel frequency_label;
40 JLabel radio_calibration_label;
41 JLabel radio_frequency_label;
42 JLabel radio_enable_label;
43 JLabel aprs_interval_label;
44 JLabel flight_log_max_label;
45 JLabel ignite_mode_label;
46 JLabel pad_orientation_label;
47 JLabel callsign_label;
55 JComboBox main_deploy_value;
56 JComboBox apogee_delay_value;
57 JComboBox apogee_lockout_value;
58 AltosFreqList radio_frequency_value;
59 JTextField radio_calibration_value;
60 JRadioButton radio_enable_value;
61 JComboBox aprs_interval_value;
62 JComboBox flight_log_max_value;
63 JComboBox ignite_mode_value;
64 JComboBox pad_orientation_value;
65 JTextField callsign_value;
76 ActionListener listener;
78 static String[] main_deploy_values_m = {
79 "100", "150", "200", "250", "300", "350",
83 static String[] main_deploy_values_ft = {
84 "250", "500", "750", "1000", "1250", "1500",
88 static String[] apogee_delay_values = {
89 "0", "1", "2", "3", "4", "5"
92 static String[] apogee_lockout_values = {
93 "0", "5", "10", "15", "20"
96 static String[] flight_log_max_values = {
97 "64", "128", "192", "256", "320",
98 "384", "448", "512", "576", "640",
99 "704", "768", "832", "896", "960",
102 static String[] ignite_mode_values = {
108 static String[] aprs_interval_values = {
115 static String[] pad_orientation_values = {
120 /* A window listener to catch closing events and tell the config code */
121 class ConfigListener extends WindowAdapter {
124 public ConfigListener(AltosConfigUI this_ui) {
128 public void windowClosing(WindowEvent e) {
129 ui.actionPerformed(new ActionEvent(e.getSource(),
130 ActionEvent.ACTION_PERFORMED,
135 boolean is_telemini_v1() {
136 String product = product_value.getText();
137 return product != null && product.startsWith("TeleMini-v1");
140 boolean is_telemini() {
141 String product = product_value.getText();
142 return product != null && product.startsWith("TeleMini");
145 boolean is_easymini() {
146 String product = product_value.getText();
147 return product != null && product.startsWith("EasyMini");
150 boolean is_telemetrum() {
151 String product = product_value.getText();
152 return product != null && product.startsWith("TeleMetrum");
155 void set_radio_calibration_tool_tip() {
156 if (radio_calibration_value.isEnabled())
157 radio_calibration_value.setToolTipText("Tune radio output to match desired frequency");
159 radio_calibration_value.setToolTipText("Cannot tune radio while connected over packet mode");
162 void set_radio_enable_tool_tip() {
163 if (radio_enable_value.isEnabled())
164 radio_enable_value.setToolTipText("Enable/Disable telemetry and RDF transmissions");
166 radio_enable_value.setToolTipText("Firmware version does not support disabling radio");
169 void set_aprs_interval_tool_tip() {
170 if (aprs_interval_value.isEnabled())
171 aprs_interval_value.setToolTipText("Enable APRS and set the interval between APRS reports");
173 aprs_interval_value.setToolTipText("Hardware doesn't support APRS");
176 void set_flight_log_max_tool_tip() {
177 if (flight_log_max_value.isEnabled())
178 flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)");
180 if (is_telemini_v1())
181 flight_log_max_value.setToolTipText("TeleMini-v1 stores only one flight");
183 flight_log_max_value.setToolTipText("Cannot set max value with flight logs in memory");
187 void set_ignite_mode_tool_tip() {
188 if (ignite_mode_value.isEnabled())
189 ignite_mode_value.setToolTipText("Select when igniters will be fired");
191 ignite_mode_value.setToolTipText("Older firmware could not select ignite mode");
194 void set_pad_orientation_tool_tip() {
195 if (pad_orientation_value.isEnabled())
196 pad_orientation_value.setToolTipText("How will the computer be mounted in the airframe");
199 pad_orientation_value.setToolTipText("Older TeleMetrum firmware must fly antenna forward");
200 else if (is_telemini() || is_easymini())
201 pad_orientation_value.setToolTipText("TeleMini and EasyMini don't care how they are mounted");
203 pad_orientation_value.setToolTipText("Can't select orientation");
207 /* Build the UI using a grid bag */
208 public AltosConfigUI(JFrame in_owner, boolean remote) {
209 super (in_owner, "Configure Flight Computer", false);
212 GridBagConstraints c;
215 Insets il = new Insets(4,4,4,4);
216 Insets ir = new Insets(4,4,4,4);
218 pane = getContentPane();
219 pane.setLayout(new GridBagLayout());
222 c = new GridBagConstraints();
223 c.gridx = 0; c.gridy = row;
225 c.fill = GridBagConstraints.NONE;
226 c.anchor = GridBagConstraints.LINE_START;
228 product_label = new JLabel("Product:");
229 pane.add(product_label, c);
231 c = new GridBagConstraints();
232 c.gridx = 4; c.gridy = row;
234 c.fill = GridBagConstraints.HORIZONTAL;
236 c.anchor = GridBagConstraints.LINE_START;
238 product_value = new JLabel("");
239 pane.add(product_value, c);
243 c = new GridBagConstraints();
244 c.gridx = 0; c.gridy = row;
246 c.fill = GridBagConstraints.NONE;
247 c.anchor = GridBagConstraints.LINE_START;
250 version_label = new JLabel("Software version:");
251 pane.add(version_label, c);
253 c = new GridBagConstraints();
254 c.gridx = 4; c.gridy = row;
256 c.fill = GridBagConstraints.HORIZONTAL;
258 c.anchor = GridBagConstraints.LINE_START;
261 version_value = new JLabel("");
262 pane.add(version_value, c);
266 c = new GridBagConstraints();
267 c.gridx = 0; c.gridy = row;
269 c.fill = GridBagConstraints.NONE;
270 c.anchor = GridBagConstraints.LINE_START;
273 serial_label = new JLabel("Serial:");
274 pane.add(serial_label, c);
276 c = new GridBagConstraints();
277 c.gridx = 4; c.gridy = row;
279 c.fill = GridBagConstraints.HORIZONTAL;
281 c.anchor = GridBagConstraints.LINE_START;
284 serial_value = new JLabel("");
285 pane.add(serial_value, c);
289 c = new GridBagConstraints();
290 c.gridx = 0; c.gridy = row;
292 c.fill = GridBagConstraints.NONE;
293 c.anchor = GridBagConstraints.LINE_START;
296 main_deploy_label = new JLabel(get_main_deploy_label());
297 pane.add(main_deploy_label, c);
299 c = new GridBagConstraints();
300 c.gridx = 4; c.gridy = row;
302 c.fill = GridBagConstraints.HORIZONTAL;
304 c.anchor = GridBagConstraints.LINE_START;
307 main_deploy_value = new JComboBox(main_deploy_values());
308 main_deploy_value.setEditable(true);
309 main_deploy_value.addItemListener(this);
310 pane.add(main_deploy_value, c);
311 main_deploy_value.setToolTipText("Height above pad altitude to fire main charge");
315 c = new GridBagConstraints();
316 c.gridx = 0; c.gridy = row;
318 c.fill = GridBagConstraints.NONE;
319 c.anchor = GridBagConstraints.LINE_START;
322 apogee_delay_label = new JLabel("Apogee Delay(s):");
323 pane.add(apogee_delay_label, c);
325 c = new GridBagConstraints();
326 c.gridx = 4; c.gridy = row;
328 c.fill = GridBagConstraints.HORIZONTAL;
330 c.anchor = GridBagConstraints.LINE_START;
333 apogee_delay_value = new JComboBox(apogee_delay_values);
334 apogee_delay_value.setEditable(true);
335 apogee_delay_value.addItemListener(this);
336 pane.add(apogee_delay_value, c);
337 apogee_delay_value.setToolTipText("Delay after apogee before charge fires");
341 c = new GridBagConstraints();
342 c.gridx = 0; c.gridy = row;
344 c.fill = GridBagConstraints.NONE;
345 c.anchor = GridBagConstraints.LINE_START;
348 apogee_lockout_label = new JLabel("Apogee Lockout(s):");
349 pane.add(apogee_lockout_label, c);
351 c = new GridBagConstraints();
352 c.gridx = 4; c.gridy = row;
354 c.fill = GridBagConstraints.HORIZONTAL;
356 c.anchor = GridBagConstraints.LINE_START;
359 apogee_lockout_value = new JComboBox(apogee_lockout_values);
360 apogee_lockout_value.setEditable(true);
361 apogee_lockout_value.addItemListener(this);
362 pane.add(apogee_lockout_value, c);
363 apogee_lockout_value.setToolTipText("Time after boost while apogee detection is locked out");
367 c = new GridBagConstraints();
368 c.gridx = 0; c.gridy = row;
370 c.fill = GridBagConstraints.NONE;
371 c.anchor = GridBagConstraints.LINE_START;
374 radio_frequency_label = new JLabel("Frequency:");
375 pane.add(radio_frequency_label, c);
377 c = new GridBagConstraints();
378 c.gridx = 4; c.gridy = row;
380 c.fill = GridBagConstraints.HORIZONTAL;
382 c.anchor = GridBagConstraints.LINE_START;
385 radio_frequency_value = new AltosFreqList();
386 radio_frequency_value.addItemListener(this);
387 pane.add(radio_frequency_value, c);
388 radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency");
391 /* Radio Calibration */
392 c = new GridBagConstraints();
393 c.gridx = 0; c.gridy = row;
395 c.fill = GridBagConstraints.NONE;
396 c.anchor = GridBagConstraints.LINE_START;
399 radio_calibration_label = new JLabel("RF Calibration:");
400 pane.add(radio_calibration_label, c);
402 c = new GridBagConstraints();
403 c.gridx = 4; c.gridy = row;
405 c.fill = GridBagConstraints.HORIZONTAL;
407 c.anchor = GridBagConstraints.LINE_START;
410 radio_calibration_value = new JTextField(String.format("%d", 1186611));
411 radio_calibration_value.getDocument().addDocumentListener(this);
413 radio_calibration_value.setEnabled(false);
414 pane.add(radio_calibration_value, c);
415 set_radio_calibration_tool_tip();
419 c = new GridBagConstraints();
420 c.gridx = 0; c.gridy = row;
422 c.fill = GridBagConstraints.NONE;
423 c.anchor = GridBagConstraints.LINE_START;
426 radio_enable_label = new JLabel("Telemetry/RDF/APRS Enable:");
427 pane.add(radio_enable_label, c);
429 c = new GridBagConstraints();
430 c.gridx = 4; c.gridy = row;
432 c.fill = GridBagConstraints.HORIZONTAL;
434 c.anchor = GridBagConstraints.LINE_START;
437 radio_enable_value = new JRadioButton("Enabled");
438 radio_enable_value.addItemListener(this);
439 pane.add(radio_enable_value, c);
440 set_radio_enable_tool_tip();
444 c = new GridBagConstraints();
445 c.gridx = 0; c.gridy = row;
447 c.fill = GridBagConstraints.NONE;
448 c.anchor = GridBagConstraints.LINE_START;
451 aprs_interval_label = new JLabel("APRS Interval(s):");
452 pane.add(aprs_interval_label, c);
454 c = new GridBagConstraints();
455 c.gridx = 4; c.gridy = row;
457 c.fill = GridBagConstraints.HORIZONTAL;
459 c.anchor = GridBagConstraints.LINE_START;
462 aprs_interval_value = new JComboBox(aprs_interval_values);
463 aprs_interval_value.setEditable(true);
464 aprs_interval_value.addItemListener(this);
465 pane.add(aprs_interval_value, c);
466 set_aprs_interval_tool_tip();
470 c = new GridBagConstraints();
471 c.gridx = 0; c.gridy = row;
473 c.fill = GridBagConstraints.NONE;
474 c.anchor = GridBagConstraints.LINE_START;
477 callsign_label = new JLabel("Callsign:");
478 pane.add(callsign_label, c);
480 c = new GridBagConstraints();
481 c.gridx = 4; c.gridy = row;
483 c.fill = GridBagConstraints.HORIZONTAL;
485 c.anchor = GridBagConstraints.LINE_START;
488 callsign_value = new JTextField(AltosUIPreferences.callsign());
489 callsign_value.getDocument().addDocumentListener(this);
490 pane.add(callsign_value, c);
491 callsign_value.setToolTipText("Callsign reported in telemetry data");
495 c = new GridBagConstraints();
496 c.gridx = 0; c.gridy = row;
498 c.fill = GridBagConstraints.NONE;
499 c.anchor = GridBagConstraints.LINE_START;
502 flight_log_max_label = new JLabel("Maximum Flight Log Size:");
503 pane.add(flight_log_max_label, c);
505 c = new GridBagConstraints();
506 c.gridx = 4; c.gridy = row;
508 c.fill = GridBagConstraints.HORIZONTAL;
510 c.anchor = GridBagConstraints.LINE_START;
513 flight_log_max_value = new JComboBox(flight_log_max_values);
514 flight_log_max_value.setEditable(true);
515 flight_log_max_value.addItemListener(this);
516 pane.add(flight_log_max_value, c);
517 set_flight_log_max_tool_tip();
521 c = new GridBagConstraints();
522 c.gridx = 0; c.gridy = row;
524 c.fill = GridBagConstraints.NONE;
525 c.anchor = GridBagConstraints.LINE_START;
528 ignite_mode_label = new JLabel("Igniter Firing Mode:");
529 pane.add(ignite_mode_label, c);
531 c = new GridBagConstraints();
532 c.gridx = 4; c.gridy = row;
534 c.fill = GridBagConstraints.HORIZONTAL;
536 c.anchor = GridBagConstraints.LINE_START;
539 ignite_mode_value = new JComboBox(ignite_mode_values);
540 ignite_mode_value.setEditable(false);
541 ignite_mode_value.addItemListener(this);
542 pane.add(ignite_mode_value, c);
543 set_ignite_mode_tool_tip();
546 /* Pad orientation */
547 c = new GridBagConstraints();
548 c.gridx = 0; c.gridy = row;
550 c.fill = GridBagConstraints.NONE;
551 c.anchor = GridBagConstraints.LINE_START;
554 pad_orientation_label = new JLabel("Pad Orientation:");
555 pane.add(pad_orientation_label, c);
557 c = new GridBagConstraints();
558 c.gridx = 4; c.gridy = row;
560 c.fill = GridBagConstraints.HORIZONTAL;
562 c.anchor = GridBagConstraints.LINE_START;
565 pad_orientation_value = new JComboBox(pad_orientation_values);
566 pad_orientation_value.setEditable(false);
567 pad_orientation_value.addItemListener(this);
568 pane.add(pad_orientation_value, c);
569 set_pad_orientation_tool_tip();
573 c = new GridBagConstraints();
574 c.gridx = 4; c.gridy = row;
576 c.fill = GridBagConstraints.HORIZONTAL;
577 c.anchor = GridBagConstraints.LINE_START;
580 pyro = new JButton("Configure Pyro Channels");
582 pyro.addActionListener(this);
583 pyro.setActionCommand("Pyro");
587 c = new GridBagConstraints();
588 c.gridx = 0; c.gridy = row;
590 c.fill = GridBagConstraints.NONE;
591 c.anchor = GridBagConstraints.LINE_START;
593 save = new JButton("Save");
595 save.addActionListener(this);
596 save.setActionCommand("Save");
598 c = new GridBagConstraints();
599 c.gridx = 2; c.gridy = row;
601 c.fill = GridBagConstraints.NONE;
602 c.anchor = GridBagConstraints.CENTER;
604 reset = new JButton("Reset");
606 reset.addActionListener(this);
607 reset.setActionCommand("Reset");
609 c = new GridBagConstraints();
610 c.gridx = 4; c.gridy = row;
612 c.fill = GridBagConstraints.NONE;
613 c.anchor = GridBagConstraints.CENTER;
615 reboot = new JButton("Reboot");
617 reboot.addActionListener(this);
618 reboot.setActionCommand("Reboot");
620 c = new GridBagConstraints();
621 c.gridx = 6; c.gridy = row;
623 c.fill = GridBagConstraints.NONE;
624 c.anchor = GridBagConstraints.LINE_END;
626 close = new JButton("Close");
628 close.addActionListener(this);
629 close.setActionCommand("Close");
631 addWindowListener(new ConfigListener(this));
632 AltosPreferences.register_units_listener(this);
635 /* Once the initial values are set, the config code will show the dialog */
636 public void make_visible() {
638 setLocationRelativeTo(owner);
642 /* If any values have been changed, confirm before closing */
643 public boolean check_dirty(String operation) {
645 Object[] options = { String.format("%s anyway", operation), "Keep editing" };
647 i = JOptionPane.showOptionDialog(this,
648 String.format("Configuration modified. %s anyway?", operation),
649 "Configuration Modified",
650 JOptionPane.DEFAULT_OPTION,
651 JOptionPane.WARNING_MESSAGE,
652 null, options, options[1]);
661 save.setEnabled(true);
664 public void set_clean() {
666 save.setEnabled(false);
669 AltosConfigPyroUI pyro_ui;
671 public void dispose() {
674 AltosPreferences.unregister_units_listener(this);
678 /* Listen for events from our buttons */
679 public void actionPerformed(ActionEvent e) {
680 String cmd = e.getActionCommand();
682 if (cmd.equals("Pyro")) {
683 if (pyro_ui == null && pyros != null)
684 pyro_ui = new AltosConfigPyroUI(this, pyros);
686 pyro_ui.make_visible();
690 if (cmd.equals("Close") || cmd.equals("Reboot"))
691 if (!check_dirty(cmd))
693 listener.actionPerformed(e);
694 if (cmd.equals("Close") || cmd.equals("Reboot")) {
701 /* ItemListener interface method */
702 public void itemStateChanged(ItemEvent e) {
706 /* DocumentListener interface methods */
707 public void changedUpdate(DocumentEvent e) {
711 public void insertUpdate(DocumentEvent e) {
715 public void removeUpdate(DocumentEvent e) {
719 /* Let the config code hook on a listener */
720 public void addActionListener(ActionListener l) {
724 /* set and get all of the dialog values */
725 public void set_product(String product) {
726 radio_frequency_value.set_product(product);
727 product_value.setText(product);
728 set_pad_orientation_tool_tip();
729 set_flight_log_max_tool_tip();
732 public void set_version(String version) {
733 version_value.setText(version);
736 public void set_serial(int serial) {
737 radio_frequency_value.set_serial(serial);
738 serial_value.setText(String.format("%d", serial));
741 public void set_main_deploy(int new_main_deploy) {
742 main_deploy_value.setSelectedItem(AltosConvert.height.say(new_main_deploy));
743 main_deploy_value.setEnabled(new_main_deploy >= 0);
746 public int main_deploy() {
747 return (int) (AltosConvert.height.parse(main_deploy_value.getSelectedItem().toString()) + 0.5);
750 String get_main_deploy_label() {
751 return String.format("Main Deploy Altitude(%s):", AltosConvert.height.show_units());
754 String[] main_deploy_values() {
755 if (AltosConvert.imperial_units)
756 return main_deploy_values_ft;
758 return main_deploy_values_m;
761 void set_main_deploy_values() {
762 String[] v = main_deploy_values();
763 while (main_deploy_value.getItemCount() > 0)
764 main_deploy_value.removeItemAt(0);
765 for (int i = 0; i < v.length; i++)
766 main_deploy_value.addItem(v[i]);
767 main_deploy_value.setMaximumRowCount(v.length);
770 public void units_changed(boolean imperial_units) {
771 String v = main_deploy_value.getSelectedItem().toString();
772 main_deploy_label.setText(get_main_deploy_label());
773 set_main_deploy_values();
774 int m = (int) (AltosConvert.height.parse(v, !imperial_units) + 0.5);
778 public void set_apogee_delay(int new_apogee_delay) {
779 apogee_delay_value.setSelectedItem(Integer.toString(new_apogee_delay));
780 apogee_delay_value.setEnabled(new_apogee_delay >= 0);
783 public int apogee_delay() {
784 return Integer.parseInt(apogee_delay_value.getSelectedItem().toString());
787 public void set_apogee_lockout(int new_apogee_lockout) {
788 apogee_lockout_value.setSelectedItem(Integer.toString(new_apogee_lockout));
789 apogee_lockout_value.setEnabled(new_apogee_lockout >= 0);
792 public int apogee_lockout() {
793 return Integer.parseInt(apogee_lockout_value.getSelectedItem().toString());
796 public void set_radio_frequency(double new_radio_frequency) {
797 radio_frequency_value.set_frequency(new_radio_frequency);
800 public double radio_frequency() {
801 return radio_frequency_value.frequency();
804 public void set_radio_calibration(int new_radio_calibration) {
805 radio_calibration_value.setVisible(new_radio_calibration >= 0);
806 if (new_radio_calibration < 0)
807 radio_calibration_value.setText("Disabled");
809 radio_calibration_value.setText(String.format("%d", new_radio_calibration));
812 public int radio_calibration() {
813 return Integer.parseInt(radio_calibration_value.getText());
816 public void set_radio_enable(int new_radio_enable) {
817 if (new_radio_enable >= 0) {
818 radio_enable_value.setSelected(new_radio_enable > 0);
819 radio_enable_value.setEnabled(true);
821 radio_enable_value.setSelected(true);
822 radio_enable_value.setVisible(radio_frequency() > 0);
823 radio_enable_value.setEnabled(false);
825 set_radio_enable_tool_tip();
828 public int radio_enable() {
829 if (radio_enable_value.isEnabled())
830 return radio_enable_value.isSelected() ? 1 : 0;
835 public void set_callsign(String new_callsign) {
836 callsign_value.setVisible(new_callsign != null);
837 callsign_value.setText(new_callsign);
840 public String callsign() {
841 return callsign_value.getText();
844 public void set_flight_log_max(int new_flight_log_max) {
845 flight_log_max_value.setSelectedItem(Integer.toString(new_flight_log_max));
846 set_flight_log_max_tool_tip();
849 public void set_flight_log_max_enabled(boolean enable) {
850 flight_log_max_value.setEnabled(enable);
851 set_flight_log_max_tool_tip();
854 public int flight_log_max() {
855 return Integer.parseInt(flight_log_max_value.getSelectedItem().toString());
858 public void set_flight_log_max_limit(int flight_log_max_limit) {
859 //boolean any_added = false;
860 flight_log_max_value.removeAllItems();
861 for (int i = 0; i < flight_log_max_values.length; i++) {
862 if (Integer.parseInt(flight_log_max_values[i]) < flight_log_max_limit){
863 flight_log_max_value.addItem(flight_log_max_values[i]);
867 flight_log_max_value.addItem(String.format("%d", flight_log_max_limit));
870 public void set_ignite_mode(int new_ignite_mode) {
871 if (new_ignite_mode >= ignite_mode_values.length)
873 if (new_ignite_mode < 0) {
874 ignite_mode_value.setEnabled(false);
877 ignite_mode_value.setEnabled(true);
879 ignite_mode_value.setSelectedIndex(new_ignite_mode);
880 set_ignite_mode_tool_tip();
883 public int ignite_mode() {
884 if (ignite_mode_value.isEnabled())
885 return ignite_mode_value.getSelectedIndex();
891 public void set_pad_orientation(int new_pad_orientation) {
892 if (new_pad_orientation >= pad_orientation_values.length)
893 new_pad_orientation = 0;
894 if (new_pad_orientation < 0) {
895 pad_orientation_value.setVisible(false);
896 new_pad_orientation = 0;
898 pad_orientation_value.setVisible(true);
900 pad_orientation_value.setSelectedIndex(new_pad_orientation);
901 set_pad_orientation_tool_tip();
904 public int pad_orientation() {
905 if (pad_orientation_value.isEnabled())
906 return pad_orientation_value.getSelectedIndex();
911 public void set_pyros(AltosPyro[] new_pyros) {
913 pyro.setVisible(pyros != null);
914 if (pyros != null && pyro_ui != null)
915 pyro_ui.set_pyros(pyros);
918 public AltosPyro[] pyros() {
920 pyros = pyro_ui.get_pyros();
924 public void set_aprs_interval(int new_aprs_interval) {
927 if (new_aprs_interval <= 0)
930 s = Integer.toString(new_aprs_interval);
931 aprs_interval_value.setSelectedItem(s);
932 aprs_interval_value.setVisible(new_aprs_interval >= 0);
933 set_aprs_interval_tool_tip();
936 public int aprs_interval() {
937 String s = aprs_interval_value.getSelectedItem().toString();
939 if (s.equals("Disabled"))
941 return Integer.parseInt(s);