diff options
author | Keith Packard <keithp@keithp.com> | 2014-06-22 21:06:24 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-06-22 21:06:24 -0700 |
commit | 6cc2d671c0e335fbedb0e97699f8f273502c6807 (patch) | |
tree | d940a8054ff9c4266b11ea8dfc3e927780f5775a /telegps/TeleGPSConfigUI.java | |
parent | 3f3382126bf1122b1a78abe8458af5ec112a1f95 (diff) |
altosui/telegps: Expose configurable APRS SSID
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'telegps/TeleGPSConfigUI.java')
-rw-r--r-- | telegps/TeleGPSConfigUI.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/telegps/TeleGPSConfigUI.java b/telegps/TeleGPSConfigUI.java index dfbff12d..1fdfd70c 100644 --- a/telegps/TeleGPSConfigUI.java +++ b/telegps/TeleGPSConfigUI.java @@ -38,6 +38,7 @@ public class TeleGPSConfigUI JLabel radio_frequency_label; JLabel radio_enable_label; JLabel aprs_interval_label; + JLabel aprs_ssid_label; JLabel flight_log_max_label; JLabel callsign_label; JLabel tracker_motion_label; @@ -53,6 +54,7 @@ public class TeleGPSConfigUI JTextField radio_calibration_value; JRadioButton radio_enable_value; JComboBox<String> aprs_interval_value; + JComboBox<Integer> aprs_ssid_value; JComboBox<String> flight_log_max_value; JTextField callsign_value; JComboBox<String> tracker_motion_value; @@ -72,6 +74,10 @@ public class TeleGPSConfigUI "10" }; + static Integer[] aprs_ssid_values = { + 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 + }; + static String[] tracker_motion_values_m = { "2", "5", @@ -148,6 +154,15 @@ public class TeleGPSConfigUI aprs_interval_value.setToolTipText("Hardware doesn't support APRS"); } + void set_aprs_ssid_tool_tip() { + if (aprs_ssid_value.isEnabled()) + aprs_interval_value.setToolTipText("Set the APRS SSID (secondary station identifier)"); + else if (aprs_interval_value.isEnabled()) + aprs_interval_value.setToolTipText("Software version doesn't support setting the APRS SSID"); + else + aprs_interval_value.setToolTipText("Hardware doesn't support APRS"); + } + void set_flight_log_max_tool_tip() { if (flight_log_max_value.isEnabled()) flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)"); @@ -341,6 +356,33 @@ public class TeleGPSConfigUI set_aprs_interval_tool_tip(); row++; + /* APRS SSID */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + aprs_ssid_label = new JLabel("APRS SSID:"); + pane.add(aprs_ssid_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + aprs_ssid_value = new JComboBox<Integer>(aprs_ssid_values); + aprs_ssid_value.setEditable(false); + aprs_ssid_value.addItemListener(this); + aprs_ssid_value.setMaximumRowCount(aprs_ssid_values.length); + pane.add(aprs_ssid_value, c); + set_aprs_ssid_tool_tip(); + row++; + /* Callsign */ c = new GridBagConstraints(); c.gridx = 0; c.gridy = row; @@ -786,4 +828,15 @@ public class TeleGPSConfigUI return 0; return parse_int("aprs interval", s, false); } + + public void set_aprs_ssid(int new_aprs_ssid) { + aprs_ssid_value.setSelectedItem(Math.max(0,new_aprs_ssid)); + aprs_ssid_value.setVisible(new_aprs_ssid >= 0); + set_aprs_ssid_tool_tip(); + } + + public int aprs_ssid() throws AltosConfigDataException { + Integer i = (Integer) aprs_ssid_value.getSelectedItem(); + return i; + } } |