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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 package org.altusmetrum.telegps;
23 import java.awt.event.*;
25 import javax.swing.event.*;
26 import org.altusmetrum.altoslib_11.*;
27 import org.altusmetrum.altosuilib_11.*;
29 public class TeleGPSConfigUI
31 implements ActionListener, ItemListener, DocumentListener, AltosConfigValues, AltosUnitsListener
38 JLabel frequency_label;
39 JLabel radio_calibration_label;
40 JLabel radio_frequency_label;
41 JLabel radio_enable_label;
43 JLabel aprs_interval_label;
44 JLabel aprs_ssid_label;
45 JLabel aprs_format_label;
46 JLabel flight_log_max_label;
47 JLabel callsign_label;
48 JLabel tracker_motion_label;
49 JLabel tracker_interval_label;
57 AltosUIFreqList radio_frequency_value;
58 JLabel radio_calibration_value;
59 JRadioButton radio_enable_value;
60 AltosUIRateList rate_value;
61 JComboBox<String> aprs_interval_value;
62 JComboBox<Integer> aprs_ssid_value;
63 JComboBox<String> aprs_format_value;
64 JComboBox<String> flight_log_max_value;
65 JTextField callsign_value;
66 JComboBox<String> tracker_motion_value;
67 JComboBox<String> tracker_interval_value;
74 ActionListener listener;
76 static String[] aprs_interval_values = {
83 static Integer[] aprs_ssid_values = {
84 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
87 static String[] tracker_motion_values_m = {
94 static String[] tracker_motion_values_ft = {
101 static String[] tracker_interval_values = {
108 /* A window listener to catch closing events and tell the config code */
109 class ConfigListener extends WindowAdapter {
112 public ConfigListener(TeleGPSConfigUI this_ui) {
116 public void windowClosing(WindowEvent e) {
117 ui.actionPerformed(new ActionEvent(e.getSource(),
118 ActionEvent.ACTION_PERFORMED,
123 public void set_pyros(AltosPyro[] new_pyros) {
126 public AltosPyro[] pyros() {
130 public void set_pyro_firing_time(double new_pyro_firing_time) {
133 public double pyro_firing_time() {
137 boolean is_telemetrum() {
138 String product = product_value.getText();
139 return product != null && product.startsWith("TeleGPS");
142 void set_radio_enable_tool_tip() {
143 if (radio_enable_value.isEnabled())
144 radio_enable_value.setToolTipText("Enable/Disable telemetry and RDF transmissions");
146 radio_enable_value.setToolTipText("Firmware version does not support disabling radio");
149 void set_rate_tool_tip() {
150 if (rate_value.isEnabled())
151 rate_value.setToolTipText("Select telemetry baud rate");
153 rate_value.setToolTipText("Firmware version does not support variable telemetry rates");
156 void set_aprs_interval_tool_tip() {
157 if (aprs_interval_value.isEnabled())
158 aprs_interval_value.setToolTipText("Enable APRS and set the interval between APRS reports");
160 aprs_interval_value.setToolTipText("Hardware doesn't support APRS");
163 void set_aprs_ssid_tool_tip() {
164 if (aprs_ssid_value.isEnabled())
165 aprs_ssid_value.setToolTipText("Set the APRS SSID (secondary station identifier)");
166 else if (aprs_ssid_value.isEnabled())
167 aprs_ssid_value.setToolTipText("Software version doesn't support setting the APRS SSID");
169 aprs_ssid_value.setToolTipText("Hardware doesn't support APRS");
172 void set_aprs_format_tool_tip() {
173 if (aprs_format_value.isEnabled())
174 aprs_format_value.setToolTipText("Set the APRS format (compressed/uncompressed)");
175 else if (aprs_format_value.isEnabled())
176 aprs_format_value.setToolTipText("Software version doesn't support setting the APRS format");
178 aprs_format_value.setToolTipText("Hardware doesn't support APRS");
181 void set_flight_log_max_tool_tip() {
182 if (flight_log_max_value.isEnabled())
183 flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)");
185 flight_log_max_value.setToolTipText("Cannot set max value with flight logs in memory");
188 /* Build the UI using a grid bag */
189 public TeleGPSConfigUI(JFrame in_owner) {
190 super (in_owner, "Configure Device", false);
193 GridBagConstraints c;
196 Insets il = new Insets(4,4,4,4);
197 Insets ir = new Insets(4,4,4,4);
199 pane = getContentPane();
200 pane.setLayout(new GridBagLayout());
203 c = new GridBagConstraints();
204 c.gridx = 0; c.gridy = row;
206 c.fill = GridBagConstraints.NONE;
207 c.anchor = GridBagConstraints.LINE_START;
209 product_label = new JLabel("Product:");
210 pane.add(product_label, c);
212 c = new GridBagConstraints();
213 c.gridx = 4; c.gridy = row;
215 c.fill = GridBagConstraints.HORIZONTAL;
217 c.anchor = GridBagConstraints.LINE_START;
219 product_value = new JLabel("");
220 pane.add(product_value, c);
224 c = new GridBagConstraints();
225 c.gridx = 0; c.gridy = row;
227 c.fill = GridBagConstraints.NONE;
228 c.anchor = GridBagConstraints.LINE_START;
231 version_label = new JLabel("Software version:");
232 pane.add(version_label, c);
234 c = new GridBagConstraints();
235 c.gridx = 4; c.gridy = row;
237 c.fill = GridBagConstraints.HORIZONTAL;
239 c.anchor = GridBagConstraints.LINE_START;
242 version_value = new JLabel("");
243 pane.add(version_value, c);
247 c = new GridBagConstraints();
248 c.gridx = 0; c.gridy = row;
250 c.fill = GridBagConstraints.NONE;
251 c.anchor = GridBagConstraints.LINE_START;
254 serial_label = new JLabel("Serial:");
255 pane.add(serial_label, c);
257 c = new GridBagConstraints();
258 c.gridx = 4; c.gridy = row;
260 c.fill = GridBagConstraints.HORIZONTAL;
262 c.anchor = GridBagConstraints.LINE_START;
265 serial_value = new JLabel("");
266 pane.add(serial_value, c);
270 c = new GridBagConstraints();
271 c.gridx = 0; c.gridy = row;
273 c.fill = GridBagConstraints.NONE;
274 c.anchor = GridBagConstraints.LINE_START;
277 radio_frequency_label = new JLabel("Frequency:");
278 pane.add(radio_frequency_label, c);
280 c = new GridBagConstraints();
281 c.gridx = 4; c.gridy = row;
283 c.fill = GridBagConstraints.HORIZONTAL;
285 c.anchor = GridBagConstraints.LINE_START;
288 radio_frequency_value = new AltosUIFreqList();
289 radio_frequency_value.addItemListener(this);
290 pane.add(radio_frequency_value, c);
291 radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency");
294 /* Radio Calibration */
295 c = new GridBagConstraints();
296 c.gridx = 0; c.gridy = row;
298 c.fill = GridBagConstraints.NONE;
299 c.anchor = GridBagConstraints.LINE_START;
302 radio_calibration_label = new JLabel("RF Calibration:");
303 pane.add(radio_calibration_label, c);
305 c = new GridBagConstraints();
306 c.gridx = 4; c.gridy = row;
308 c.fill = GridBagConstraints.HORIZONTAL;
310 c.anchor = GridBagConstraints.LINE_START;
313 radio_calibration_value = new JLabel(String.format("%d", 1186611));
314 pane.add(radio_calibration_value, c);
318 c = new GridBagConstraints();
319 c.gridx = 0; c.gridy = row;
321 c.fill = GridBagConstraints.NONE;
322 c.anchor = GridBagConstraints.LINE_START;
325 radio_enable_label = new JLabel("Telemetry/RDF/APRS Enable:");
326 pane.add(radio_enable_label, c);
328 c = new GridBagConstraints();
329 c.gridx = 4; c.gridy = row;
331 c.fill = GridBagConstraints.HORIZONTAL;
333 c.anchor = GridBagConstraints.LINE_START;
336 radio_enable_value = new JRadioButton("Enabled");
337 radio_enable_value.addItemListener(this);
338 pane.add(radio_enable_value, c);
339 set_radio_enable_tool_tip();
343 c = new GridBagConstraints();
344 c.gridx = 0; c.gridy = row;
346 c.fill = GridBagConstraints.NONE;
347 c.anchor = GridBagConstraints.LINE_START;
350 rate_label = new JLabel("Telemetry baud rate:");
351 pane.add(rate_label, c);
353 c = new GridBagConstraints();
354 c.gridx = 4; c.gridy = row;
356 c.fill = GridBagConstraints.HORIZONTAL;
358 c.anchor = GridBagConstraints.LINE_START;
361 rate_value = new AltosUIRateList();
362 rate_value.addItemListener(this);
363 pane.add(rate_value, c);
368 c = new GridBagConstraints();
369 c.gridx = 0; c.gridy = row;
371 c.fill = GridBagConstraints.NONE;
372 c.anchor = GridBagConstraints.LINE_START;
375 aprs_interval_label = new JLabel("APRS Interval(s):");
376 pane.add(aprs_interval_label, c);
378 c = new GridBagConstraints();
379 c.gridx = 4; c.gridy = row;
381 c.fill = GridBagConstraints.HORIZONTAL;
383 c.anchor = GridBagConstraints.LINE_START;
386 aprs_interval_value = new JComboBox<String>(aprs_interval_values);
387 aprs_interval_value.setEditable(true);
388 aprs_interval_value.addItemListener(this);
389 pane.add(aprs_interval_value, c);
390 set_aprs_interval_tool_tip();
394 c = new GridBagConstraints();
395 c.gridx = 0; c.gridy = row;
397 c.fill = GridBagConstraints.NONE;
398 c.anchor = GridBagConstraints.LINE_START;
401 aprs_ssid_label = new JLabel("APRS SSID:");
402 pane.add(aprs_ssid_label, c);
404 c = new GridBagConstraints();
405 c.gridx = 4; c.gridy = row;
407 c.fill = GridBagConstraints.HORIZONTAL;
409 c.anchor = GridBagConstraints.LINE_START;
412 aprs_ssid_value = new JComboBox<Integer>(aprs_ssid_values);
413 aprs_ssid_value.setEditable(false);
414 aprs_ssid_value.addItemListener(this);
415 aprs_ssid_value.setMaximumRowCount(aprs_ssid_values.length);
416 pane.add(aprs_ssid_value, c);
417 set_aprs_ssid_tool_tip();
421 c = new GridBagConstraints();
422 c.gridx = 0; c.gridy = row;
424 c.fill = GridBagConstraints.NONE;
425 c.anchor = GridBagConstraints.LINE_START;
428 aprs_format_label = new JLabel("APRS format:");
429 pane.add(aprs_format_label, c);
431 c = new GridBagConstraints();
432 c.gridx = 4; c.gridy = row;
434 c.fill = GridBagConstraints.HORIZONTAL;
436 c.anchor = GridBagConstraints.LINE_START;
439 aprs_format_value = new JComboBox<String>(AltosLib.ao_aprs_format_name);
440 aprs_format_value.setEditable(false);
441 aprs_format_value.addItemListener(this);
442 aprs_format_value.setMaximumRowCount(AltosLib.ao_aprs_format_name.length);
443 pane.add(aprs_format_value, c);
444 set_aprs_format_tool_tip();
448 c = new GridBagConstraints();
449 c.gridx = 0; c.gridy = row;
451 c.fill = GridBagConstraints.NONE;
452 c.anchor = GridBagConstraints.LINE_START;
455 callsign_label = new JLabel("Callsign:");
456 pane.add(callsign_label, c);
458 c = new GridBagConstraints();
459 c.gridx = 4; c.gridy = row;
461 c.fill = GridBagConstraints.HORIZONTAL;
463 c.anchor = GridBagConstraints.LINE_START;
466 callsign_value = new JTextField(AltosUIPreferences.callsign());
467 callsign_value.getDocument().addDocumentListener(this);
468 pane.add(callsign_value, c);
469 callsign_value.setToolTipText("Callsign reported in telemetry data");
473 c = new GridBagConstraints();
474 c.gridx = 0; c.gridy = row;
476 c.fill = GridBagConstraints.NONE;
477 c.anchor = GridBagConstraints.LINE_START;
480 flight_log_max_label = new JLabel("Maximum Log Size (kB):");
481 pane.add(flight_log_max_label, c);
483 c = new GridBagConstraints();
484 c.gridx = 4; c.gridy = row;
486 c.fill = GridBagConstraints.HORIZONTAL;
488 c.anchor = GridBagConstraints.LINE_START;
491 flight_log_max_value = new JComboBox<String>();
492 flight_log_max_value.setEditable(true);
493 flight_log_max_value.addItemListener(this);
494 pane.add(flight_log_max_value, c);
495 set_flight_log_max_tool_tip();
498 /* Tracker triger horiz distances */
499 c = new GridBagConstraints();
500 c.gridx = 0; c.gridy = row;
502 c.fill = GridBagConstraints.NONE;
503 c.anchor = GridBagConstraints.LINE_START;
506 tracker_motion_label = new JLabel(get_tracker_motion_label());
507 pane.add(tracker_motion_label, c);
509 c = new GridBagConstraints();
510 c.gridx = 4; c.gridy = row;
512 c.fill = GridBagConstraints.HORIZONTAL;
514 c.anchor = GridBagConstraints.LINE_START;
517 tracker_motion_value = new JComboBox<String>(tracker_motion_values());
518 tracker_motion_value.setEditable(true);
519 tracker_motion_value.addItemListener(this);
520 pane.add(tracker_motion_value, c);
523 /* Tracker triger vert distances */
524 c = new GridBagConstraints();
525 c.gridx = 0; c.gridy = row;
527 c.fill = GridBagConstraints.NONE;
528 c.anchor = GridBagConstraints.LINE_START;
531 tracker_interval_label = new JLabel("Position Reporting Interval (s):");
532 pane.add(tracker_interval_label, c);
534 c = new GridBagConstraints();
535 c.gridx = 4; c.gridy = row;
537 c.fill = GridBagConstraints.HORIZONTAL;
539 c.anchor = GridBagConstraints.LINE_START;
542 tracker_interval_value = new JComboBox<String>(tracker_interval_values);
543 tracker_interval_value.setEditable(true);
544 tracker_interval_value.addItemListener(this);
545 pane.add(tracker_interval_value, c);
546 set_tracker_tool_tip();
550 c = new GridBagConstraints();
551 c.gridx = 0; c.gridy = row;
553 c.fill = GridBagConstraints.NONE;
554 c.anchor = GridBagConstraints.LINE_START;
556 save = new JButton("Save");
558 save.addActionListener(this);
559 save.setActionCommand("Save");
561 c = new GridBagConstraints();
562 c.gridx = 2; c.gridy = row;
564 c.fill = GridBagConstraints.NONE;
565 c.anchor = GridBagConstraints.CENTER;
567 reset = new JButton("Reset");
569 reset.addActionListener(this);
570 reset.setActionCommand("Reset");
572 c = new GridBagConstraints();
573 c.gridx = 4; c.gridy = row;
575 c.fill = GridBagConstraints.NONE;
576 c.anchor = GridBagConstraints.CENTER;
578 reboot = new JButton("Reboot");
580 reboot.addActionListener(this);
581 reboot.setActionCommand("Reboot");
583 c = new GridBagConstraints();
584 c.gridx = 6; c.gridy = row;
586 c.fill = GridBagConstraints.NONE;
587 c.anchor = GridBagConstraints.LINE_END;
589 close = new JButton("Close");
591 close.addActionListener(this);
592 close.setActionCommand("Close");
594 addWindowListener(new ConfigListener(this));
595 AltosPreferences.register_units_listener(this);
598 /* Once the initial values are set, the config code will show the dialog */
599 public void make_visible() {
601 setLocationRelativeTo(owner);
605 /* If any values have been changed, confirm before closing */
606 public boolean check_dirty(String operation) {
608 Object[] options = { String.format("%s anyway", operation), "Keep editing" };
610 i = JOptionPane.showOptionDialog(this,
611 String.format("Configuration modified. %s anyway?", operation),
612 "Configuration Modified",
613 JOptionPane.DEFAULT_OPTION,
614 JOptionPane.WARNING_MESSAGE,
615 null, options, options[1]);
624 save.setEnabled(true);
627 public void set_clean() {
629 save.setEnabled(false);
632 public void dispose() {
633 AltosPreferences.unregister_units_listener(this);
637 /* Listen for events from our buttons */
638 public void actionPerformed(ActionEvent e) {
639 String cmd = e.getActionCommand();
641 if (cmd.equals("Close") || cmd.equals("Reboot"))
642 if (!check_dirty(cmd))
644 listener.actionPerformed(e);
645 if (cmd.equals("Close") || cmd.equals("Reboot")) {
652 /* ItemListener interface method */
653 public void itemStateChanged(ItemEvent e) {
657 /* DocumentListener interface methods */
658 public void changedUpdate(DocumentEvent e) {
662 public void insertUpdate(DocumentEvent e) {
666 public void removeUpdate(DocumentEvent e) {
670 /* Let the config code hook on a listener */
671 public void addActionListener(ActionListener l) {
675 public void units_changed(boolean imperial_units) {
676 boolean was_dirty = dirty;
678 if (tracker_motion_value.isEnabled()) {
679 String motion = tracker_motion_value.getSelectedItem().toString();
680 tracker_motion_label.setText(get_tracker_motion_label());
681 set_tracker_motion_values();
683 int m = (int) (AltosConvert.height.parse_locale(motion, !imperial_units) + 0.5);
684 set_tracker_motion(m);
685 } catch (ParseException pe) {
692 /* set and get all of the dialog values */
693 public void set_product(String product) {
694 radio_frequency_value.set_product(product);
695 product_value.setText(product);
696 set_flight_log_max_tool_tip();
699 public void set_version(String version) {
700 version_value.setText(version);
703 public void set_serial(int serial) {
704 radio_frequency_value.set_serial(serial);
705 serial_value.setText(String.format("%d", serial));
708 public void set_altitude_32(int altitude_32) {
711 public void set_main_deploy(int new_main_deploy) {
714 public int main_deploy() {
718 public void set_apogee_delay(int new_apogee_delay) { }
720 public int apogee_delay() {
724 public void set_apogee_lockout(int new_apogee_lockout) { }
726 public int apogee_lockout() { return -1; }
728 public void set_radio_frequency(double new_radio_frequency) {
729 radio_frequency_value.set_frequency(new_radio_frequency);
732 public double radio_frequency() {
733 return radio_frequency_value.frequency();
736 public void set_radio_calibration(int new_radio_calibration) {
737 radio_calibration_value.setVisible(new_radio_calibration >= 0);
738 if (new_radio_calibration < 0)
739 radio_calibration_value.setText("Disabled");
741 radio_calibration_value.setText(String.format("%d", new_radio_calibration));
744 private int parse_int(String name, String s, boolean split) throws AltosConfigDataException {
747 v = s.split("\\s+")[0];
749 return Integer.parseInt(v);
750 } catch (NumberFormatException ne) {
751 throw new AltosConfigDataException("Invalid %s \"%s\"", name, s);
755 public void set_radio_enable(int new_radio_enable) {
756 if (new_radio_enable >= 0) {
757 radio_enable_value.setSelected(new_radio_enable > 0);
758 radio_enable_value.setEnabled(true);
760 radio_enable_value.setSelected(true);
761 radio_enable_value.setVisible(radio_frequency() > 0);
762 radio_enable_value.setEnabled(false);
764 set_radio_enable_tool_tip();
767 public int radio_enable() {
768 if (radio_enable_value.isEnabled())
769 return radio_enable_value.isSelected() ? 1 : 0;
774 public void set_telemetry_rate(int new_rate) {
775 rate_value.set_rate(new_rate);
778 public int telemetry_rate() {
779 return rate_value.rate();
782 public void set_callsign(String new_callsign) {
783 callsign_value.setVisible(new_callsign != null);
784 callsign_value.setText(new_callsign);
787 public String callsign() {
788 return callsign_value.getText();
791 int flight_log_max_limit;
794 public String flight_log_max_label(int flight_log_max) {
795 if (flight_log_max_limit != 0) {
796 int nflight = flight_log_max_limit / flight_log_max;
797 String plural = nflight > 1 ? "s" : "";
799 return String.format("%d (%d flight%s)", flight_log_max, nflight, plural);
801 return String.format("%d", flight_log_max);
804 public void set_flight_log_max(int new_flight_log_max) {
805 flight_log_max_value.setSelectedItem(flight_log_max_label(new_flight_log_max));
806 flight_log_max = new_flight_log_max;
807 set_flight_log_max_tool_tip();
810 public void set_flight_log_max_enabled(boolean enable) {
811 flight_log_max_value.setEnabled(enable);
812 set_flight_log_max_tool_tip();
815 public int flight_log_max() throws AltosConfigDataException {
816 return parse_int("flight log max", flight_log_max_value.getSelectedItem().toString(), true);
819 public void set_flight_log_max_limit(int new_flight_log_max_limit) {
820 flight_log_max_limit = new_flight_log_max_limit;
821 flight_log_max_value.removeAllItems();
822 for (int i = 8; i >= 1; i--) {
823 int size = flight_log_max_limit / i;
824 flight_log_max_value.addItem(String.format("%d (%d flights)", size, i));
826 if (flight_log_max != 0)
827 set_flight_log_max(flight_log_max);
830 public void set_ignite_mode(int new_ignite_mode) { }
831 public int ignite_mode() { return -1; }
834 public void set_pad_orientation(int new_pad_orientation) { }
835 public int pad_orientation() { return -1; }
837 public void set_beep(int new_beep) { }
839 public int beep() { return -1; }
841 String[] tracker_motion_values() {
842 if (AltosConvert.imperial_units)
843 return tracker_motion_values_ft;
845 return tracker_motion_values_m;
848 void set_tracker_motion_values() {
849 String[] v = tracker_motion_values();
850 while (tracker_motion_value.getItemCount() > 0)
851 tracker_motion_value.removeItemAt(0);
852 for (int i = 0; i < v.length; i++)
853 tracker_motion_value.addItem(v[i]);
854 tracker_motion_value.setMaximumRowCount(v.length);
857 String get_tracker_motion_label() {
858 return String.format("Logging Trigger Motion (%s):", AltosConvert.height.parse_units());
861 void set_tracker_tool_tip() {
862 if (tracker_motion_value.isEnabled())
863 tracker_motion_value.setToolTipText("How far the device must move before logging");
865 tracker_motion_value.setToolTipText("This device doesn't disable logging when stationary");
866 if (tracker_interval_value.isEnabled())
867 tracker_interval_value.setToolTipText("How often to report GPS position");
869 tracker_interval_value.setToolTipText("This device can't configure interval");
872 public void set_tracker_motion(int tracker_motion) {
873 if (tracker_motion < 0) {
874 tracker_motion_value.setEnabled(false);
876 tracker_motion_value.setEnabled(true);
877 tracker_motion_value.setSelectedItem(AltosConvert.height.say(tracker_motion));
881 public int tracker_motion() throws AltosConfigDataException {
882 String str = tracker_motion_value.getSelectedItem().toString();
884 return (int) (AltosConvert.height.parse_locale(str) + 0.5);
885 } catch (ParseException pe) {
886 throw new AltosConfigDataException("invalid tracker motion %s", str);
890 public void set_tracker_interval(int tracker_interval) {
891 if (tracker_interval< 0) {
892 tracker_interval_value.setEnabled(false);
894 tracker_interval_value.setEnabled(true);
895 tracker_interval_value.setSelectedItem(String.format("%d", tracker_interval));
899 public int tracker_interval() throws AltosConfigDataException {
900 return parse_int ("tracker interval", tracker_interval_value.getSelectedItem().toString(), false);
903 public void set_aprs_interval(int new_aprs_interval) {
906 if (new_aprs_interval <= 0)
909 s = Integer.toString(new_aprs_interval);
910 aprs_interval_value.setSelectedItem(s);
911 aprs_interval_value.setVisible(new_aprs_interval >= 0);
912 set_aprs_interval_tool_tip();
915 public int aprs_interval() throws AltosConfigDataException {
916 String s = aprs_interval_value.getSelectedItem().toString();
918 if (s.equals("Disabled"))
920 return parse_int("aprs interval", s, false);
923 public void set_aprs_ssid(int new_aprs_ssid) {
924 aprs_ssid_value.setSelectedItem(Math.max(0,new_aprs_ssid));
925 aprs_ssid_value.setVisible(new_aprs_ssid >= 0);
926 set_aprs_ssid_tool_tip();
929 public int aprs_ssid() throws AltosConfigDataException {
930 Integer i = (Integer) aprs_ssid_value.getSelectedItem();
934 public void set_aprs_format(int new_aprs_format) {
935 aprs_format_value.setVisible(new_aprs_format >= 0);
936 aprs_format_label.setVisible(new_aprs_format >= 0);
938 aprs_format_value.setSelectedIndex(Math.max(0,new_aprs_format));
939 set_aprs_format_tool_tip();
942 public int aprs_format() throws AltosConfigDataException {
943 return aprs_format_value.getSelectedIndex();