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_2.*;
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() {
136 String product = product_value.getText();
137 return product != null && product.startsWith("TeleMini");
140 boolean is_telemetrum() {
141 String product = product_value.getText();
142 return product != null && product.startsWith("TeleMetrum");
145 void set_radio_calibration_tool_tip() {
146 if (radio_calibration_value.isEnabled())
147 radio_calibration_value.setToolTipText("Tune radio output to match desired frequency");
149 radio_calibration_value.setToolTipText("Cannot tune radio while connected over packet mode");
152 void set_radio_enable_tool_tip() {
153 if (radio_enable_value.isEnabled())
154 radio_enable_value.setToolTipText("Enable/Disable telemetry and RDF transmissions");
156 radio_enable_value.setToolTipText("Firmware version does not support disabling radio");
159 void set_aprs_interval_tool_tip() {
160 if (aprs_interval_value.isEnabled())
161 aprs_interval_value.setToolTipText("Enable APRS and set the interval between APRS reports");
163 aprs_interval_value.setToolTipText("Hardware doesn't support APRS");
166 void set_flight_log_max_tool_tip() {
167 if (flight_log_max_value.isEnabled())
168 flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)");
171 flight_log_max_value.setToolTipText("Cannot set max value with flight logs in memory");
172 else if (is_telemini())
173 flight_log_max_value.setToolTipText("TeleMini stores only one flight");
175 flight_log_max_value.setToolTipText("Cannot set max flight log value");
179 void set_ignite_mode_tool_tip() {
180 if (ignite_mode_value.isEnabled())
181 ignite_mode_value.setToolTipText("Select when igniters will be fired");
183 ignite_mode_value.setToolTipText("Older firmware could not select ignite mode");
186 void set_pad_orientation_tool_tip() {
187 if (pad_orientation_value.isEnabled())
188 pad_orientation_value.setToolTipText("How will the computer be mounted in the airframe");
191 pad_orientation_value.setToolTipText("Older TeleMetrum firmware must fly antenna forward");
192 else if (is_telemini())
193 pad_orientation_value.setToolTipText("TeleMini doesn't care how it is mounted");
195 pad_orientation_value.setToolTipText("Can't select orientation");
199 /* Build the UI using a grid bag */
200 public AltosConfigUI(JFrame in_owner, boolean remote) {
201 super (in_owner, "Configure Flight Computer", false);
204 GridBagConstraints c;
207 Insets il = new Insets(4,4,4,4);
208 Insets ir = new Insets(4,4,4,4);
210 pane = getContentPane();
211 pane.setLayout(new GridBagLayout());
214 c = new GridBagConstraints();
215 c.gridx = 0; c.gridy = row;
217 c.fill = GridBagConstraints.NONE;
218 c.anchor = GridBagConstraints.LINE_START;
220 product_label = new JLabel("Product:");
221 pane.add(product_label, c);
223 c = new GridBagConstraints();
224 c.gridx = 4; c.gridy = row;
226 c.fill = GridBagConstraints.HORIZONTAL;
228 c.anchor = GridBagConstraints.LINE_START;
230 product_value = new JLabel("");
231 pane.add(product_value, c);
235 c = new GridBagConstraints();
236 c.gridx = 0; c.gridy = row;
238 c.fill = GridBagConstraints.NONE;
239 c.anchor = GridBagConstraints.LINE_START;
242 version_label = new JLabel("Software version:");
243 pane.add(version_label, c);
245 c = new GridBagConstraints();
246 c.gridx = 4; c.gridy = row;
248 c.fill = GridBagConstraints.HORIZONTAL;
250 c.anchor = GridBagConstraints.LINE_START;
253 version_value = new JLabel("");
254 pane.add(version_value, c);
258 c = new GridBagConstraints();
259 c.gridx = 0; c.gridy = row;
261 c.fill = GridBagConstraints.NONE;
262 c.anchor = GridBagConstraints.LINE_START;
265 serial_label = new JLabel("Serial:");
266 pane.add(serial_label, c);
268 c = new GridBagConstraints();
269 c.gridx = 4; c.gridy = row;
271 c.fill = GridBagConstraints.HORIZONTAL;
273 c.anchor = GridBagConstraints.LINE_START;
276 serial_value = new JLabel("");
277 pane.add(serial_value, c);
281 c = new GridBagConstraints();
282 c.gridx = 0; c.gridy = row;
284 c.fill = GridBagConstraints.NONE;
285 c.anchor = GridBagConstraints.LINE_START;
288 main_deploy_label = new JLabel(get_main_deploy_label());
289 pane.add(main_deploy_label, c);
291 c = new GridBagConstraints();
292 c.gridx = 4; c.gridy = row;
294 c.fill = GridBagConstraints.HORIZONTAL;
296 c.anchor = GridBagConstraints.LINE_START;
299 main_deploy_value = new JComboBox(main_deploy_values());
300 main_deploy_value.setEditable(true);
301 main_deploy_value.addItemListener(this);
302 pane.add(main_deploy_value, c);
303 main_deploy_value.setToolTipText("Height above pad altitude to fire main charge");
307 c = new GridBagConstraints();
308 c.gridx = 0; c.gridy = row;
310 c.fill = GridBagConstraints.NONE;
311 c.anchor = GridBagConstraints.LINE_START;
314 apogee_delay_label = new JLabel("Apogee Delay(s):");
315 pane.add(apogee_delay_label, c);
317 c = new GridBagConstraints();
318 c.gridx = 4; c.gridy = row;
320 c.fill = GridBagConstraints.HORIZONTAL;
322 c.anchor = GridBagConstraints.LINE_START;
325 apogee_delay_value = new JComboBox(apogee_delay_values);
326 apogee_delay_value.setEditable(true);
327 apogee_delay_value.addItemListener(this);
328 pane.add(apogee_delay_value, c);
329 apogee_delay_value.setToolTipText("Delay after apogee before charge fires");
333 c = new GridBagConstraints();
334 c.gridx = 0; c.gridy = row;
336 c.fill = GridBagConstraints.NONE;
337 c.anchor = GridBagConstraints.LINE_START;
340 apogee_lockout_label = new JLabel("Apogee Lockout(s):");
341 pane.add(apogee_lockout_label, c);
343 c = new GridBagConstraints();
344 c.gridx = 4; c.gridy = row;
346 c.fill = GridBagConstraints.HORIZONTAL;
348 c.anchor = GridBagConstraints.LINE_START;
351 apogee_lockout_value = new JComboBox(apogee_lockout_values);
352 apogee_lockout_value.setEditable(true);
353 apogee_lockout_value.addItemListener(this);
354 pane.add(apogee_lockout_value, c);
355 apogee_lockout_value.setToolTipText("Time after boost while apogee detection is locked out");
359 c = new GridBagConstraints();
360 c.gridx = 0; c.gridy = row;
362 c.fill = GridBagConstraints.NONE;
363 c.anchor = GridBagConstraints.LINE_START;
366 radio_frequency_label = new JLabel("Frequency:");
367 pane.add(radio_frequency_label, c);
369 c = new GridBagConstraints();
370 c.gridx = 4; c.gridy = row;
372 c.fill = GridBagConstraints.HORIZONTAL;
374 c.anchor = GridBagConstraints.LINE_START;
377 radio_frequency_value = new AltosFreqList();
378 radio_frequency_value.addItemListener(this);
379 pane.add(radio_frequency_value, c);
380 radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency");
383 /* Radio Calibration */
384 c = new GridBagConstraints();
385 c.gridx = 0; c.gridy = row;
387 c.fill = GridBagConstraints.NONE;
388 c.anchor = GridBagConstraints.LINE_START;
391 radio_calibration_label = new JLabel("RF Calibration:");
392 pane.add(radio_calibration_label, c);
394 c = new GridBagConstraints();
395 c.gridx = 4; c.gridy = row;
397 c.fill = GridBagConstraints.HORIZONTAL;
399 c.anchor = GridBagConstraints.LINE_START;
402 radio_calibration_value = new JTextField(String.format("%d", 1186611));
403 radio_calibration_value.getDocument().addDocumentListener(this);
405 radio_calibration_value.setEnabled(false);
406 pane.add(radio_calibration_value, c);
407 set_radio_calibration_tool_tip();
411 c = new GridBagConstraints();
412 c.gridx = 0; c.gridy = row;
414 c.fill = GridBagConstraints.NONE;
415 c.anchor = GridBagConstraints.LINE_START;
418 radio_enable_label = new JLabel("Telemetry/RDF/APRS Enable:");
419 pane.add(radio_enable_label, c);
421 c = new GridBagConstraints();
422 c.gridx = 4; c.gridy = row;
424 c.fill = GridBagConstraints.HORIZONTAL;
426 c.anchor = GridBagConstraints.LINE_START;
429 radio_enable_value = new JRadioButton("Enabled");
430 radio_enable_value.addItemListener(this);
431 pane.add(radio_enable_value, c);
432 set_radio_enable_tool_tip();
436 c = new GridBagConstraints();
437 c.gridx = 0; c.gridy = row;
439 c.fill = GridBagConstraints.NONE;
440 c.anchor = GridBagConstraints.LINE_START;
443 aprs_interval_label = new JLabel("APRS Interval(s):");
444 pane.add(aprs_interval_label, c);
446 c = new GridBagConstraints();
447 c.gridx = 4; c.gridy = row;
449 c.fill = GridBagConstraints.HORIZONTAL;
451 c.anchor = GridBagConstraints.LINE_START;
454 aprs_interval_value = new JComboBox(aprs_interval_values);
455 aprs_interval_value.setEditable(true);
456 aprs_interval_value.addItemListener(this);
457 pane.add(aprs_interval_value, c);
458 set_aprs_interval_tool_tip();
462 c = new GridBagConstraints();
463 c.gridx = 0; c.gridy = row;
465 c.fill = GridBagConstraints.NONE;
466 c.anchor = GridBagConstraints.LINE_START;
469 callsign_label = new JLabel("Callsign:");
470 pane.add(callsign_label, c);
472 c = new GridBagConstraints();
473 c.gridx = 4; c.gridy = row;
475 c.fill = GridBagConstraints.HORIZONTAL;
477 c.anchor = GridBagConstraints.LINE_START;
480 callsign_value = new JTextField(AltosUIPreferences.callsign());
481 callsign_value.getDocument().addDocumentListener(this);
482 pane.add(callsign_value, c);
483 callsign_value.setToolTipText("Callsign reported in telemetry data");
487 c = new GridBagConstraints();
488 c.gridx = 0; c.gridy = row;
490 c.fill = GridBagConstraints.NONE;
491 c.anchor = GridBagConstraints.LINE_START;
494 flight_log_max_label = new JLabel("Maximum Flight Log Size:");
495 pane.add(flight_log_max_label, c);
497 c = new GridBagConstraints();
498 c.gridx = 4; c.gridy = row;
500 c.fill = GridBagConstraints.HORIZONTAL;
502 c.anchor = GridBagConstraints.LINE_START;
505 flight_log_max_value = new JComboBox(flight_log_max_values);
506 flight_log_max_value.setEditable(true);
507 flight_log_max_value.addItemListener(this);
508 pane.add(flight_log_max_value, c);
509 set_flight_log_max_tool_tip();
513 c = new GridBagConstraints();
514 c.gridx = 0; c.gridy = row;
516 c.fill = GridBagConstraints.NONE;
517 c.anchor = GridBagConstraints.LINE_START;
520 ignite_mode_label = new JLabel("Igniter Firing Mode:");
521 pane.add(ignite_mode_label, c);
523 c = new GridBagConstraints();
524 c.gridx = 4; c.gridy = row;
526 c.fill = GridBagConstraints.HORIZONTAL;
528 c.anchor = GridBagConstraints.LINE_START;
531 ignite_mode_value = new JComboBox(ignite_mode_values);
532 ignite_mode_value.setEditable(false);
533 ignite_mode_value.addItemListener(this);
534 pane.add(ignite_mode_value, c);
535 set_ignite_mode_tool_tip();
538 /* Pad orientation */
539 c = new GridBagConstraints();
540 c.gridx = 0; c.gridy = row;
542 c.fill = GridBagConstraints.NONE;
543 c.anchor = GridBagConstraints.LINE_START;
546 pad_orientation_label = new JLabel("Pad Orientation:");
547 pane.add(pad_orientation_label, c);
549 c = new GridBagConstraints();
550 c.gridx = 4; c.gridy = row;
552 c.fill = GridBagConstraints.HORIZONTAL;
554 c.anchor = GridBagConstraints.LINE_START;
557 pad_orientation_value = new JComboBox(pad_orientation_values);
558 pad_orientation_value.setEditable(false);
559 pad_orientation_value.addItemListener(this);
560 pane.add(pad_orientation_value, c);
561 set_pad_orientation_tool_tip();
565 c = new GridBagConstraints();
566 c.gridx = 4; c.gridy = row;
568 c.fill = GridBagConstraints.HORIZONTAL;
569 c.anchor = GridBagConstraints.LINE_START;
572 pyro = new JButton("Configure Pyro Channels");
574 pyro.addActionListener(this);
575 pyro.setActionCommand("Pyro");
579 c = new GridBagConstraints();
580 c.gridx = 0; c.gridy = row;
582 c.fill = GridBagConstraints.NONE;
583 c.anchor = GridBagConstraints.LINE_START;
585 save = new JButton("Save");
587 save.addActionListener(this);
588 save.setActionCommand("Save");
590 c = new GridBagConstraints();
591 c.gridx = 2; c.gridy = row;
593 c.fill = GridBagConstraints.NONE;
594 c.anchor = GridBagConstraints.CENTER;
596 reset = new JButton("Reset");
598 reset.addActionListener(this);
599 reset.setActionCommand("Reset");
601 c = new GridBagConstraints();
602 c.gridx = 4; c.gridy = row;
604 c.fill = GridBagConstraints.NONE;
605 c.anchor = GridBagConstraints.CENTER;
607 reboot = new JButton("Reboot");
609 reboot.addActionListener(this);
610 reboot.setActionCommand("Reboot");
612 c = new GridBagConstraints();
613 c.gridx = 6; c.gridy = row;
615 c.fill = GridBagConstraints.NONE;
616 c.anchor = GridBagConstraints.LINE_END;
618 close = new JButton("Close");
620 close.addActionListener(this);
621 close.setActionCommand("Close");
623 addWindowListener(new ConfigListener(this));
624 AltosPreferences.register_units_listener(this);
627 /* Once the initial values are set, the config code will show the dialog */
628 public void make_visible() {
630 setLocationRelativeTo(owner);
634 /* If any values have been changed, confirm before closing */
635 public boolean check_dirty(String operation) {
637 Object[] options = { String.format("%s anyway", operation), "Keep editing" };
639 i = JOptionPane.showOptionDialog(this,
640 String.format("Configuration modified. %s anyway?", operation),
641 "Configuration Modified",
642 JOptionPane.DEFAULT_OPTION,
643 JOptionPane.WARNING_MESSAGE,
644 null, options, options[1]);
653 save.setEnabled(true);
656 public void set_clean() {
658 save.setEnabled(false);
661 AltosConfigPyroUI pyro_ui;
663 public void dispose() {
666 AltosPreferences.unregister_units_listener(this);
670 /* Listen for events from our buttons */
671 public void actionPerformed(ActionEvent e) {
672 String cmd = e.getActionCommand();
674 if (cmd.equals("Pyro")) {
675 if (pyro_ui == null && pyros != null)
676 pyro_ui = new AltosConfigPyroUI(this, pyros);
678 pyro_ui.make_visible();
682 if (cmd.equals("Close") || cmd.equals("Reboot"))
683 if (!check_dirty(cmd))
685 listener.actionPerformed(e);
686 if (cmd.equals("Close") || cmd.equals("Reboot")) {
693 /* ItemListener interface method */
694 public void itemStateChanged(ItemEvent e) {
698 /* DocumentListener interface methods */
699 public void changedUpdate(DocumentEvent e) {
703 public void insertUpdate(DocumentEvent e) {
707 public void removeUpdate(DocumentEvent e) {
711 /* Let the config code hook on a listener */
712 public void addActionListener(ActionListener l) {
716 /* set and get all of the dialog values */
717 public void set_product(String product) {
718 radio_frequency_value.set_product(product);
719 product_value.setText(product);
720 set_pad_orientation_tool_tip();
721 set_flight_log_max_tool_tip();
724 public void set_version(String version) {
725 version_value.setText(version);
728 public void set_serial(int serial) {
729 radio_frequency_value.set_serial(serial);
730 serial_value.setText(String.format("%d", serial));
733 public void set_main_deploy(int new_main_deploy) {
734 main_deploy_value.setSelectedItem(AltosConvert.height.say(new_main_deploy));
735 main_deploy_value.setEnabled(new_main_deploy >= 0);
738 public int main_deploy() {
739 return (int) (AltosConvert.height.parse(main_deploy_value.getSelectedItem().toString()) + 0.5);
742 String get_main_deploy_label() {
743 return String.format("Main Deploy Altitude(%s):", AltosConvert.height.show_units());
746 String[] main_deploy_values() {
747 if (AltosConvert.imperial_units)
748 return main_deploy_values_ft;
750 return main_deploy_values_m;
753 void set_main_deploy_values() {
754 String[] v = main_deploy_values();
755 while (main_deploy_value.getItemCount() > 0)
756 main_deploy_value.removeItemAt(0);
757 for (int i = 0; i < v.length; i++)
758 main_deploy_value.addItem(v[i]);
759 main_deploy_value.setMaximumRowCount(v.length);
762 public void units_changed(boolean imperial_units) {
763 String v = main_deploy_value.getSelectedItem().toString();
764 main_deploy_label.setText(get_main_deploy_label());
765 set_main_deploy_values();
766 int m = (int) (AltosConvert.height.parse(v, !imperial_units) + 0.5);
770 public void set_apogee_delay(int new_apogee_delay) {
771 apogee_delay_value.setSelectedItem(Integer.toString(new_apogee_delay));
772 apogee_delay_value.setEnabled(new_apogee_delay >= 0);
775 public int apogee_delay() {
776 return Integer.parseInt(apogee_delay_value.getSelectedItem().toString());
779 public void set_apogee_lockout(int new_apogee_lockout) {
780 apogee_lockout_value.setSelectedItem(Integer.toString(new_apogee_lockout));
781 apogee_lockout_value.setEnabled(new_apogee_lockout >= 0);
784 public int apogee_lockout() {
785 return Integer.parseInt(apogee_lockout_value.getSelectedItem().toString());
788 public void set_radio_frequency(double new_radio_frequency) {
789 radio_frequency_value.set_frequency(new_radio_frequency);
792 public double radio_frequency() {
793 return radio_frequency_value.frequency();
796 public void set_radio_calibration(int new_radio_calibration) {
797 radio_calibration_value.setVisible(new_radio_calibration >= 0);
798 if (new_radio_calibration < 0)
799 radio_calibration_value.setText("Disabled");
801 radio_calibration_value.setText(String.format("%d", new_radio_calibration));
804 public int radio_calibration() {
805 return Integer.parseInt(radio_calibration_value.getText());
808 public void set_radio_enable(int new_radio_enable) {
809 if (new_radio_enable >= 0) {
810 radio_enable_value.setSelected(new_radio_enable > 0);
811 radio_enable_value.setEnabled(true);
813 radio_enable_value.setSelected(true);
814 radio_enable_value.setVisible(radio_frequency() > 0);
815 radio_enable_value.setEnabled(false);
817 set_radio_enable_tool_tip();
820 public int radio_enable() {
821 if (radio_enable_value.isEnabled())
822 return radio_enable_value.isSelected() ? 1 : 0;
827 public void set_callsign(String new_callsign) {
828 callsign_value.setVisible(new_callsign != null);
829 callsign_value.setText(new_callsign);
832 public String callsign() {
833 return callsign_value.getText();
836 public void set_flight_log_max(int new_flight_log_max) {
837 flight_log_max_value.setEnabled(new_flight_log_max > 0);
838 flight_log_max_value.setSelectedItem(Integer.toString(new_flight_log_max));
839 set_flight_log_max_tool_tip();
842 public void set_flight_log_max_enabled(boolean enable) {
843 flight_log_max_value.setEnabled(enable);
844 set_flight_log_max_tool_tip();
847 public int flight_log_max() {
848 return Integer.parseInt(flight_log_max_value.getSelectedItem().toString());
851 public void set_flight_log_max_limit(int flight_log_max_limit) {
852 //boolean any_added = false;
853 flight_log_max_value.removeAllItems();
854 for (int i = 0; i < flight_log_max_values.length; i++) {
855 if (Integer.parseInt(flight_log_max_values[i]) < flight_log_max_limit){
856 flight_log_max_value.addItem(flight_log_max_values[i]);
860 flight_log_max_value.addItem(String.format("%d", flight_log_max_limit));
863 public void set_ignite_mode(int new_ignite_mode) {
864 if (new_ignite_mode >= ignite_mode_values.length)
866 if (new_ignite_mode < 0) {
867 ignite_mode_value.setEnabled(false);
870 ignite_mode_value.setEnabled(true);
872 ignite_mode_value.setSelectedIndex(new_ignite_mode);
873 set_ignite_mode_tool_tip();
876 public int ignite_mode() {
877 if (ignite_mode_value.isEnabled())
878 return ignite_mode_value.getSelectedIndex();
884 public void set_pad_orientation(int new_pad_orientation) {
885 if (new_pad_orientation >= pad_orientation_values.length)
886 new_pad_orientation = 0;
887 if (new_pad_orientation < 0) {
888 pad_orientation_value.setVisible(false);
889 new_pad_orientation = 0;
891 pad_orientation_value.setVisible(true);
893 pad_orientation_value.setSelectedIndex(new_pad_orientation);
894 set_pad_orientation_tool_tip();
897 public int pad_orientation() {
898 if (pad_orientation_value.isEnabled())
899 return pad_orientation_value.getSelectedIndex();
904 public void set_pyros(AltosPyro[] new_pyros) {
906 pyro.setVisible(pyros != null);
907 if (pyros != null && pyro_ui != null)
908 pyro_ui.set_pyros(pyros);
911 public AltosPyro[] pyros() {
913 pyros = pyro_ui.get_pyros();
917 public void set_aprs_interval(int new_aprs_interval) {
920 if (new_aprs_interval <= 0)
923 s = Integer.toString(new_aprs_interval);
924 aprs_interval_value.setSelectedItem(s);
925 aprs_interval_value.setVisible(new_aprs_interval >= 0);
926 set_aprs_interval_tool_tip();
929 public int aprs_interval() {
930 String s = aprs_interval_value.getSelectedItem().toString();
932 if (s.equals("Disabled"))
934 return Integer.parseInt(s);