X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=telegps%2FTeleGPSConfigUI.java;fp=telegps%2FTeleGPSConfigUI.java;h=5617b8e435e09818b53b7e94932819675a1d18e7;hp=465916ec81ea0c2efebdc26cef86f9ede96c81f9;hb=3e7661761f6ea81b6a9732359edf4c5ada3e8e20;hpb=58a0a242f31ebe4532564f5c04162e8fb82f9aeb diff --git a/telegps/TeleGPSConfigUI.java b/telegps/TeleGPSConfigUI.java index 465916ec..5617b8e4 100644 --- a/telegps/TeleGPSConfigUI.java +++ b/telegps/TeleGPSConfigUI.java @@ -39,6 +39,7 @@ public class TeleGPSConfigUI JLabel radio_calibration_label; JLabel radio_frequency_label; JLabel radio_enable_label; + JLabel radio_10mw_label; JLabel rate_label; JLabel aprs_interval_label; JLabel aprs_ssid_label; @@ -58,6 +59,7 @@ public class TeleGPSConfigUI AltosUIFreqList radio_frequency_value; JLabel radio_calibration_value; JRadioButton radio_enable_value; + JRadioButton radio_10mw_value; AltosUIRateList rate_value; JComboBox aprs_interval_value; JComboBox aprs_ssid_value; @@ -152,6 +154,13 @@ public class TeleGPSConfigUI radio_enable_value.setToolTipText("Firmware version does not support disabling radio"); } + void set_radio_10mw_tool_tip() { + if (radio_10mw_value.isVisible()) + radio_10mw_value.setToolTipText("Should transmitter power be limited to 10mW"); + else + radio_10mw_value.setToolTipText("Older firmware could not limit radio power"); + } + void set_rate_tool_tip() { if (rate_value.isVisible()) rate_value.setToolTipText("Select telemetry baud rate"); @@ -354,6 +363,31 @@ public class TeleGPSConfigUI set_radio_enable_tool_tip(); row++; + /* Radio 10mW limit */ + 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; + radio_10mw_label = new JLabel("Limit transmit to 10mW:"); + pane.add(radio_10mw_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; + radio_10mw_value = new JRadioButton("Limited"); + radio_10mw_value.addItemListener(this); + pane.add(radio_10mw_value, c); + set_radio_10mw_tool_tip(); + row++; + /* Telemetry Rate */ c = new GridBagConstraints(); c.gridx = 0; c.gridy = row; @@ -811,6 +845,22 @@ public class TeleGPSConfigUI return AltosLib.MISSING; } + public void set_radio_10mw(int new_radio_10mw) { + if (new_radio_10mw != AltosLib.MISSING) { + radio_10mw_value.setSelected(new_radio_10mw != 0); + } + radio_10mw_value.setVisible(new_radio_10mw != AltosLib.MISSING); + radio_10mw_label.setVisible(new_radio_10mw != AltosLib.MISSING); + set_radio_10mw_tool_tip(); + } + + public int radio_10mw() { + if (radio_10mw_value.isVisible()) + return radio_10mw_value.isSelected() ? 1 : 0; + else + return AltosLib.MISSING; + } + public void set_telemetry_rate(int new_rate) { if (new_rate != AltosLib.MISSING) rate_value.set_rate(new_rate);