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.
18 package org.altusmetrum.telegps;
22 import java.awt.event.*;
24 import javax.swing.event.*;
25 import org.altusmetrum.altoslib_11.*;
26 import org.altusmetrum.altosuilib_11.*;
28 public class TeleGPSConfigUI
30 implements ActionListener, ItemListener, DocumentListener, AltosConfigValues, AltosUnitsListener
37 JLabel frequency_label;
38 JLabel radio_calibration_label;
39 JLabel radio_frequency_label;
40 JLabel radio_enable_label;
42 JLabel aprs_interval_label;
43 JLabel aprs_ssid_label;
44 JLabel aprs_format_label;
45 JLabel flight_log_max_label;
46 JLabel callsign_label;
47 JLabel tracker_motion_label;
48 JLabel tracker_interval_label;
56 AltosUIFreqList radio_frequency_value;
57 JLabel radio_calibration_value;
58 JRadioButton radio_enable_value;
59 AltosUIRateList rate_value;
60 JComboBox<String> aprs_interval_value;
61 JComboBox<Integer> aprs_ssid_value;
62 JComboBox<String> aprs_format_value;
63 JComboBox<String> flight_log_max_value;
64 JTextField callsign_value;
65 JComboBox<String> tracker_motion_value;
66 JComboBox<String> tracker_interval_value;
73 ActionListener listener;
75 static String[] aprs_interval_values = {
82 static Integer[] aprs_ssid_values = {
83 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
86 static String[] tracker_motion_values_m = {
93 static String[] tracker_motion_values_ft = {
100 static String[] tracker_interval_values = {
107 /* A window listener to catch closing events and tell the config code */
108 class ConfigListener extends WindowAdapter {
111 public ConfigListener(TeleGPSConfigUI this_ui) {
115 public void windowClosing(WindowEvent e) {
116 ui.actionPerformed(new ActionEvent(e.getSource(),
117 ActionEvent.ACTION_PERFORMED,
122 public void set_pyros(AltosPyro[] new_pyros) {
125 public AltosPyro[] pyros() {
129 public void set_pyro_firing_time(double new_pyro_firing_time) {
132 public double pyro_firing_time() {
136 boolean is_telemetrum() {
137 String product = product_value.getText();
138 return product != null && product.startsWith("TeleGPS");
141 void set_radio_enable_tool_tip() {
142 if (radio_enable_value.isEnabled())
143 radio_enable_value.setToolTipText("Enable/Disable telemetry and RDF transmissions");
145 radio_enable_value.setToolTipText("Firmware version does not support disabling radio");
148 void set_rate_tool_tip() {
149 if (rate_value.isEnabled())
150 rate_value.setToolTipText("Select telemetry baud rate");
152 rate_value.setToolTipText("Firmware version does not support variable telemetry rates");
155 void set_aprs_interval_tool_tip() {
156 if (aprs_interval_value.isEnabled())
157 aprs_interval_value.setToolTipText("Enable APRS and set the interval between APRS reports");
159 aprs_interval_value.setToolTipText("Hardware doesn't support APRS");
162 void set_aprs_ssid_tool_tip() {
163 if (aprs_ssid_value.isEnabled())
164 aprs_ssid_value.setToolTipText("Set the APRS SSID (secondary station identifier)");
165 else if (aprs_ssid_value.isEnabled())
166 aprs_ssid_value.setToolTipText("Software version doesn't support setting the APRS SSID");
168 aprs_ssid_value.setToolTipText("Hardware doesn't support APRS");
171 void set_aprs_format_tool_tip() {
172 if (aprs_format_value.isEnabled())
173 aprs_format_value.setToolTipText("Set the APRS format (compressed/uncompressed)");
174 else if (aprs_format_value.isEnabled())
175 aprs_format_value.setToolTipText("Software version doesn't support setting the APRS format");
177 aprs_format_value.setToolTipText("Hardware doesn't support APRS");
180 void set_flight_log_max_tool_tip() {
181 if (flight_log_max_value.isEnabled())
182 flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)");
184 flight_log_max_value.setToolTipText("Cannot set max value with flight logs in memory");
187 /* Build the UI using a grid bag */
188 public TeleGPSConfigUI(JFrame in_owner) {
189 super (in_owner, "Configure Device", false);
192 GridBagConstraints c;
195 Insets il = new Insets(4,4,4,4);
196 Insets ir = new Insets(4,4,4,4);
198 pane = getContentPane();
199 pane.setLayout(new GridBagLayout());
202 c = new GridBagConstraints();
203 c.gridx = 0; c.gridy = row;
205 c.fill = GridBagConstraints.NONE;
206 c.anchor = GridBagConstraints.LINE_START;
208 product_label = new JLabel("Product:");
209 pane.add(product_label, c);
211 c = new GridBagConstraints();
212 c.gridx = 4; c.gridy = row;
214 c.fill = GridBagConstraints.HORIZONTAL;
216 c.anchor = GridBagConstraints.LINE_START;
218 product_value = new JLabel("");
219 pane.add(product_value, c);
223 c = new GridBagConstraints();
224 c.gridx = 0; c.gridy = row;
226 c.fill = GridBagConstraints.NONE;
227 c.anchor = GridBagConstraints.LINE_START;
230 version_label = new JLabel("Software version:");
231 pane.add(version_label, c);
233 c = new GridBagConstraints();
234 c.gridx = 4; c.gridy = row;
236 c.fill = GridBagConstraints.HORIZONTAL;
238 c.anchor = GridBagConstraints.LINE_START;
241 version_value = new JLabel("");
242 pane.add(version_value, c);
246 c = new GridBagConstraints();
247 c.gridx = 0; c.gridy = row;
249 c.fill = GridBagConstraints.NONE;
250 c.anchor = GridBagConstraints.LINE_START;
253 serial_label = new JLabel("Serial:");
254 pane.add(serial_label, c);
256 c = new GridBagConstraints();
257 c.gridx = 4; c.gridy = row;
259 c.fill = GridBagConstraints.HORIZONTAL;
261 c.anchor = GridBagConstraints.LINE_START;
264 serial_value = new JLabel("");
265 pane.add(serial_value, c);
269 c = new GridBagConstraints();
270 c.gridx = 0; c.gridy = row;
272 c.fill = GridBagConstraints.NONE;
273 c.anchor = GridBagConstraints.LINE_START;
276 radio_frequency_label = new JLabel("Frequency:");
277 pane.add(radio_frequency_label, c);
279 c = new GridBagConstraints();
280 c.gridx = 4; c.gridy = row;
282 c.fill = GridBagConstraints.HORIZONTAL;
284 c.anchor = GridBagConstraints.LINE_START;
287 radio_frequency_value = new AltosUIFreqList();
288 radio_frequency_value.addItemListener(this);
289 pane.add(radio_frequency_value, c);
290 radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency");
293 /* Radio Calibration */
294 c = new GridBagConstraints();
295 c.gridx = 0; c.gridy = row;
297 c.fill = GridBagConstraints.NONE;
298 c.anchor = GridBagConstraints.LINE_START;
301 radio_calibration_label = new JLabel("RF Calibration:");
302 pane.add(radio_calibration_label, c);
304 c = new GridBagConstraints();
305 c.gridx = 4; c.gridy = row;
307 c.fill = GridBagConstraints.HORIZONTAL;
309 c.anchor = GridBagConstraints.LINE_START;
312 radio_calibration_value = new JLabel(String.format("%d", 1186611));
313 pane.add(radio_calibration_value, c);
317 c = new GridBagConstraints();
318 c.gridx = 0; c.gridy = row;
320 c.fill = GridBagConstraints.NONE;
321 c.anchor = GridBagConstraints.LINE_START;
324 radio_enable_label = new JLabel("Telemetry/RDF/APRS Enable:");
325 pane.add(radio_enable_label, c);
327 c = new GridBagConstraints();
328 c.gridx = 4; c.gridy = row;
330 c.fill = GridBagConstraints.HORIZONTAL;
332 c.anchor = GridBagConstraints.LINE_START;
335 radio_enable_value = new JRadioButton("Enabled");
336 radio_enable_value.addItemListener(this);
337 pane.add(radio_enable_value, c);
338 set_radio_enable_tool_tip();
342 c = new GridBagConstraints();
343 c.gridx = 0; c.gridy = row;
345 c.fill = GridBagConstraints.NONE;
346 c.anchor = GridBagConstraints.LINE_START;
349 rate_label = new JLabel("Telemetry baud rate:");
350 pane.add(rate_label, c);
352 c = new GridBagConstraints();
353 c.gridx = 4; c.gridy = row;
355 c.fill = GridBagConstraints.HORIZONTAL;
357 c.anchor = GridBagConstraints.LINE_START;
360 rate_value = new AltosUIRateList();
361 rate_value.addItemListener(this);
362 pane.add(rate_value, c);
367 c = new GridBagConstraints();
368 c.gridx = 0; c.gridy = row;
370 c.fill = GridBagConstraints.NONE;
371 c.anchor = GridBagConstraints.LINE_START;
374 aprs_interval_label = new JLabel("APRS Interval(s):");
375 pane.add(aprs_interval_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 aprs_interval_value = new JComboBox<String>(aprs_interval_values);
386 aprs_interval_value.setEditable(true);
387 aprs_interval_value.addItemListener(this);
388 pane.add(aprs_interval_value, c);
389 set_aprs_interval_tool_tip();
393 c = new GridBagConstraints();
394 c.gridx = 0; c.gridy = row;
396 c.fill = GridBagConstraints.NONE;
397 c.anchor = GridBagConstraints.LINE_START;
400 aprs_ssid_label = new JLabel("APRS SSID:");
401 pane.add(aprs_ssid_label, c);
403 c = new GridBagConstraints();
404 c.gridx = 4; c.gridy = row;
406 c.fill = GridBagConstraints.HORIZONTAL;
408 c.anchor = GridBagConstraints.LINE_START;
411 aprs_ssid_value = new JComboBox<Integer>(aprs_ssid_values);
412 aprs_ssid_value.setEditable(false);
413 aprs_ssid_value.addItemListener(this);
414 aprs_ssid_value.setMaximumRowCount(aprs_ssid_values.length);
415 pane.add(aprs_ssid_value, c);
416 set_aprs_ssid_tool_tip();
420 c = new GridBagConstraints();
421 c.gridx = 0; c.gridy = row;
423 c.fill = GridBagConstraints.NONE;
424 c.anchor = GridBagConstraints.LINE_START;
427 aprs_format_label = new JLabel("APRS format:");
428 pane.add(aprs_format_label, c);
430 c = new GridBagConstraints();
431 c.gridx = 4; c.gridy = row;
433 c.fill = GridBagConstraints.HORIZONTAL;
435 c.anchor = GridBagConstraints.LINE_START;
438 aprs_format_value = new JComboBox<String>(AltosLib.ao_aprs_format_name);
439 aprs_format_value.setEditable(false);
440 aprs_format_value.addItemListener(this);
441 aprs_format_value.setMaximumRowCount(AltosLib.ao_aprs_format_name.length);
442 pane.add(aprs_format_value, c);
443 set_aprs_format_tool_tip();
447 c = new GridBagConstraints();
448 c.gridx = 0; c.gridy = row;
450 c.fill = GridBagConstraints.NONE;
451 c.anchor = GridBagConstraints.LINE_START;
454 callsign_label = new JLabel("Callsign:");
455 pane.add(callsign_label, c);
457 c = new GridBagConstraints();
458 c.gridx = 4; c.gridy = row;
460 c.fill = GridBagConstraints.HORIZONTAL;
462 c.anchor = GridBagConstraints.LINE_START;
465 callsign_value = new JTextField(AltosUIPreferences.callsign());
466 callsign_value.getDocument().addDocumentListener(this);
467 pane.add(callsign_value, c);
468 callsign_value.setToolTipText("Callsign reported in telemetry data");
472 c = new GridBagConstraints();
473 c.gridx = 0; c.gridy = row;
475 c.fill = GridBagConstraints.NONE;
476 c.anchor = GridBagConstraints.LINE_START;
479 flight_log_max_label = new JLabel("Maximum Log Size (kB):");
480 pane.add(flight_log_max_label, c);
482 c = new GridBagConstraints();
483 c.gridx = 4; c.gridy = row;
485 c.fill = GridBagConstraints.HORIZONTAL;
487 c.anchor = GridBagConstraints.LINE_START;
490 flight_log_max_value = new JComboBox<String>();
491 flight_log_max_value.setEditable(true);
492 flight_log_max_value.addItemListener(this);
493 pane.add(flight_log_max_value, c);
494 set_flight_log_max_tool_tip();
497 /* Tracker triger horiz distances */
498 c = new GridBagConstraints();
499 c.gridx = 0; c.gridy = row;
501 c.fill = GridBagConstraints.NONE;
502 c.anchor = GridBagConstraints.LINE_START;
505 tracker_motion_label = new JLabel(get_tracker_motion_label());
506 pane.add(tracker_motion_label, c);
508 c = new GridBagConstraints();
509 c.gridx = 4; c.gridy = row;
511 c.fill = GridBagConstraints.HORIZONTAL;
513 c.anchor = GridBagConstraints.LINE_START;
516 tracker_motion_value = new JComboBox<String>(tracker_motion_values());
517 tracker_motion_value.setEditable(true);
518 tracker_motion_value.addItemListener(this);
519 pane.add(tracker_motion_value, c);
522 /* Tracker triger vert distances */
523 c = new GridBagConstraints();
524 c.gridx = 0; c.gridy = row;
526 c.fill = GridBagConstraints.NONE;
527 c.anchor = GridBagConstraints.LINE_START;
530 tracker_interval_label = new JLabel("Position Reporting Interval (s):");
531 pane.add(tracker_interval_label, c);
533 c = new GridBagConstraints();
534 c.gridx = 4; c.gridy = row;
536 c.fill = GridBagConstraints.HORIZONTAL;
538 c.anchor = GridBagConstraints.LINE_START;
541 tracker_interval_value = new JComboBox<String>(tracker_interval_values);
542 tracker_interval_value.setEditable(true);
543 tracker_interval_value.addItemListener(this);
544 pane.add(tracker_interval_value, c);
545 set_tracker_tool_tip();
549 c = new GridBagConstraints();
550 c.gridx = 0; c.gridy = row;
552 c.fill = GridBagConstraints.NONE;
553 c.anchor = GridBagConstraints.LINE_START;
555 save = new JButton("Save");
557 save.addActionListener(this);
558 save.setActionCommand("Save");
560 c = new GridBagConstraints();
561 c.gridx = 2; c.gridy = row;
563 c.fill = GridBagConstraints.NONE;
564 c.anchor = GridBagConstraints.CENTER;
566 reset = new JButton("Reset");
568 reset.addActionListener(this);
569 reset.setActionCommand("Reset");
571 c = new GridBagConstraints();
572 c.gridx = 4; c.gridy = row;
574 c.fill = GridBagConstraints.NONE;
575 c.anchor = GridBagConstraints.CENTER;
577 reboot = new JButton("Reboot");
579 reboot.addActionListener(this);
580 reboot.setActionCommand("Reboot");
582 c = new GridBagConstraints();
583 c.gridx = 6; c.gridy = row;
585 c.fill = GridBagConstraints.NONE;
586 c.anchor = GridBagConstraints.LINE_END;
588 close = new JButton("Close");
590 close.addActionListener(this);
591 close.setActionCommand("Close");
593 addWindowListener(new ConfigListener(this));
594 AltosPreferences.register_units_listener(this);
597 /* Once the initial values are set, the config code will show the dialog */
598 public void make_visible() {
600 setLocationRelativeTo(owner);
604 /* If any values have been changed, confirm before closing */
605 public boolean check_dirty(String operation) {
607 Object[] options = { String.format("%s anyway", operation), "Keep editing" };
609 i = JOptionPane.showOptionDialog(this,
610 String.format("Configuration modified. %s anyway?", operation),
611 "Configuration Modified",
612 JOptionPane.DEFAULT_OPTION,
613 JOptionPane.WARNING_MESSAGE,
614 null, options, options[1]);
623 save.setEnabled(true);
626 public void set_clean() {
628 save.setEnabled(false);
631 public void dispose() {
632 AltosPreferences.unregister_units_listener(this);
636 /* Listen for events from our buttons */
637 public void actionPerformed(ActionEvent e) {
638 String cmd = e.getActionCommand();
640 if (cmd.equals("Close") || cmd.equals("Reboot"))
641 if (!check_dirty(cmd))
643 listener.actionPerformed(e);
644 if (cmd.equals("Close") || cmd.equals("Reboot")) {
651 /* ItemListener interface method */
652 public void itemStateChanged(ItemEvent e) {
656 /* DocumentListener interface methods */
657 public void changedUpdate(DocumentEvent e) {
661 public void insertUpdate(DocumentEvent e) {
665 public void removeUpdate(DocumentEvent e) {
669 /* Let the config code hook on a listener */
670 public void addActionListener(ActionListener l) {
674 public void units_changed(boolean imperial_units) {
675 boolean was_dirty = dirty;
677 if (tracker_motion_value.isEnabled()) {
678 String motion = tracker_motion_value.getSelectedItem().toString();
679 tracker_motion_label.setText(get_tracker_motion_label());
680 set_tracker_motion_values();
682 int m = (int) (AltosConvert.height.parse_locale(motion, !imperial_units) + 0.5);
683 set_tracker_motion(m);
684 } catch (ParseException pe) {
691 /* set and get all of the dialog values */
692 public void set_product(String product) {
693 radio_frequency_value.set_product(product);
694 product_value.setText(product);
695 set_flight_log_max_tool_tip();
698 public void set_version(String version) {
699 version_value.setText(version);
702 public void set_serial(int serial) {
703 radio_frequency_value.set_serial(serial);
704 serial_value.setText(String.format("%d", serial));
707 public void set_altitude_32(int altitude_32) {
710 public void set_main_deploy(int new_main_deploy) {
713 public int main_deploy() {
717 public void set_apogee_delay(int new_apogee_delay) { }
719 public int apogee_delay() {
723 public void set_apogee_lockout(int new_apogee_lockout) { }
725 public int apogee_lockout() { return -1; }
727 public void set_radio_frequency(double new_radio_frequency) {
728 radio_frequency_value.set_frequency(new_radio_frequency);
731 public double radio_frequency() {
732 return radio_frequency_value.frequency();
735 public void set_radio_calibration(int new_radio_calibration) {
736 radio_calibration_value.setVisible(new_radio_calibration >= 0);
737 if (new_radio_calibration < 0)
738 radio_calibration_value.setText("Disabled");
740 radio_calibration_value.setText(String.format("%d", new_radio_calibration));
743 private int parse_int(String name, String s, boolean split) throws AltosConfigDataException {
746 v = s.split("\\s+")[0];
748 return Integer.parseInt(v);
749 } catch (NumberFormatException ne) {
750 throw new AltosConfigDataException("Invalid %s \"%s\"", name, s);
754 public void set_radio_enable(int new_radio_enable) {
755 if (new_radio_enable >= 0) {
756 radio_enable_value.setSelected(new_radio_enable > 0);
757 radio_enable_value.setEnabled(true);
759 radio_enable_value.setSelected(true);
760 radio_enable_value.setVisible(radio_frequency() > 0);
761 radio_enable_value.setEnabled(false);
763 set_radio_enable_tool_tip();
766 public int radio_enable() {
767 if (radio_enable_value.isEnabled())
768 return radio_enable_value.isSelected() ? 1 : 0;
773 public void set_telemetry_rate(int new_rate) {
774 rate_value.set_rate(new_rate);
777 public int telemetry_rate() {
778 return rate_value.rate();
781 public void set_callsign(String new_callsign) {
782 callsign_value.setVisible(new_callsign != null);
783 callsign_value.setText(new_callsign);
786 public String callsign() {
787 return callsign_value.getText();
790 int flight_log_max_limit;
793 public String flight_log_max_label(int flight_log_max) {
794 if (flight_log_max_limit != 0) {
795 int nflight = flight_log_max_limit / flight_log_max;
796 String plural = nflight > 1 ? "s" : "";
798 return String.format("%d (%d flight%s)", flight_log_max, nflight, plural);
800 return String.format("%d", flight_log_max);
803 public void set_flight_log_max(int new_flight_log_max) {
804 flight_log_max_value.setSelectedItem(flight_log_max_label(new_flight_log_max));
805 flight_log_max = new_flight_log_max;
806 set_flight_log_max_tool_tip();
809 public void set_flight_log_max_enabled(boolean enable) {
810 flight_log_max_value.setEnabled(enable);
811 set_flight_log_max_tool_tip();
814 public int flight_log_max() throws AltosConfigDataException {
815 return parse_int("flight log max", flight_log_max_value.getSelectedItem().toString(), true);
818 public void set_flight_log_max_limit(int new_flight_log_max_limit) {
819 flight_log_max_limit = new_flight_log_max_limit;
820 flight_log_max_value.removeAllItems();
821 for (int i = 8; i >= 1; i--) {
822 int size = flight_log_max_limit / i;
823 flight_log_max_value.addItem(String.format("%d (%d flights)", size, i));
825 if (flight_log_max != 0)
826 set_flight_log_max(flight_log_max);
829 public void set_ignite_mode(int new_ignite_mode) { }
830 public int ignite_mode() { return -1; }
833 public void set_pad_orientation(int new_pad_orientation) { }
834 public int pad_orientation() { return -1; }
836 public void set_beep(int new_beep) { }
838 public int beep() { return -1; }
840 String[] tracker_motion_values() {
841 if (AltosConvert.imperial_units)
842 return tracker_motion_values_ft;
844 return tracker_motion_values_m;
847 void set_tracker_motion_values() {
848 String[] v = tracker_motion_values();
849 while (tracker_motion_value.getItemCount() > 0)
850 tracker_motion_value.removeItemAt(0);
851 for (int i = 0; i < v.length; i++)
852 tracker_motion_value.addItem(v[i]);
853 tracker_motion_value.setMaximumRowCount(v.length);
856 String get_tracker_motion_label() {
857 return String.format("Logging Trigger Motion (%s):", AltosConvert.height.parse_units());
860 void set_tracker_tool_tip() {
861 if (tracker_motion_value.isEnabled())
862 tracker_motion_value.setToolTipText("How far the device must move before logging");
864 tracker_motion_value.setToolTipText("This device doesn't disable logging when stationary");
865 if (tracker_interval_value.isEnabled())
866 tracker_interval_value.setToolTipText("How often to report GPS position");
868 tracker_interval_value.setToolTipText("This device can't configure interval");
871 public void set_tracker_motion(int tracker_motion) {
872 if (tracker_motion < 0) {
873 tracker_motion_value.setEnabled(false);
875 tracker_motion_value.setEnabled(true);
876 tracker_motion_value.setSelectedItem(AltosConvert.height.say(tracker_motion));
880 public int tracker_motion() throws AltosConfigDataException {
881 String str = tracker_motion_value.getSelectedItem().toString();
883 return (int) (AltosConvert.height.parse_locale(str) + 0.5);
884 } catch (ParseException pe) {
885 throw new AltosConfigDataException("invalid tracker motion %s", str);
889 public void set_tracker_interval(int tracker_interval) {
890 if (tracker_interval< 0) {
891 tracker_interval_value.setEnabled(false);
893 tracker_interval_value.setEnabled(true);
894 tracker_interval_value.setSelectedItem(String.format("%d", tracker_interval));
898 public int tracker_interval() throws AltosConfigDataException {
899 return parse_int ("tracker interval", tracker_interval_value.getSelectedItem().toString(), false);
902 public void set_aprs_interval(int new_aprs_interval) {
905 if (new_aprs_interval <= 0)
908 s = Integer.toString(new_aprs_interval);
909 aprs_interval_value.setSelectedItem(s);
910 aprs_interval_value.setVisible(new_aprs_interval >= 0);
911 set_aprs_interval_tool_tip();
914 public int aprs_interval() throws AltosConfigDataException {
915 String s = aprs_interval_value.getSelectedItem().toString();
917 if (s.equals("Disabled"))
919 return parse_int("aprs interval", s, false);
922 public void set_aprs_ssid(int new_aprs_ssid) {
923 aprs_ssid_value.setSelectedItem(Math.max(0,new_aprs_ssid));
924 aprs_ssid_value.setVisible(new_aprs_ssid >= 0);
925 set_aprs_ssid_tool_tip();
928 public int aprs_ssid() throws AltosConfigDataException {
929 Integer i = (Integer) aprs_ssid_value.getSelectedItem();
933 public void set_aprs_format(int new_aprs_format) {
934 aprs_format_value.setVisible(new_aprs_format >= 0);
935 aprs_format_label.setVisible(new_aprs_format >= 0);
937 aprs_format_value.setSelectedIndex(Math.max(0,new_aprs_format));
938 set_aprs_format_tool_tip();
941 public int aprs_format() throws AltosConfigDataException {
942 return aprs_format_value.getSelectedIndex();