summaryrefslogtreecommitdiff
path: root/altosui/AltosConfigUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-07-04 23:41:16 -0700
committerKeith Packard <keithp@keithp.com>2014-07-05 00:38:10 -0700
commitefb86669b5a74f244e2218f3385db633c36208af (patch)
tree5dbec18cd814c927b8ceb390f9bedc94d3520396 /altosui/AltosConfigUI.java
parent9557a24b02911a93d74ee29ce359e40266cb4fed (diff)
altosui: Support telemetry data rates
Add combo box to flight UI and flight hardware configuration UIs Add telemetry rate to the TD/TBT config dialog Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfigUI.java')
-rw-r--r--altosui/AltosConfigUI.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java
index 91c37fd5..e3a1a24f 100644
--- a/altosui/AltosConfigUI.java
+++ b/altosui/AltosConfigUI.java
@@ -40,6 +40,7 @@ public class AltosConfigUI
JLabel radio_calibration_label;
JLabel radio_frequency_label;
JLabel radio_enable_label;
+ JLabel rate_label;
JLabel aprs_interval_label;
JLabel aprs_ssid_label;
JLabel flight_log_max_label;
@@ -62,6 +63,7 @@ public class AltosConfigUI
AltosUIFreqList radio_frequency_value;
JTextField radio_calibration_value;
JRadioButton radio_enable_value;
+ AltosUIRateList rate_value;
JComboBox<String> aprs_interval_value;
JComboBox<Integer> aprs_ssid_value;
JComboBox<String> flight_log_max_value;
@@ -200,6 +202,13 @@ public class AltosConfigUI
radio_enable_value.setToolTipText("Firmware version does not support disabling radio");
}
+ void set_rate_tool_tip() {
+ if (rate_value.isEnabled())
+ rate_value.setToolTipText("Select telemetry baud rate");
+ else
+ rate_value.setToolTipText("Firmware version does not support variable telemetry rates");
+ }
+
void set_aprs_interval_tool_tip() {
if (aprs_interval_value.isEnabled())
aprs_interval_value.setToolTipText("Enable APRS and set the interval between APRS reports");
@@ -490,6 +499,31 @@ public class AltosConfigUI
set_radio_enable_tool_tip();
row++;
+ /* Telemetry Rate */
+ 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;
+ rate_label = new JLabel("Telemetry baud rate:");
+ pane.add(radio_enable_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;
+ rate_value = new AltosUIRateList();
+ rate_value.addItemListener(this);
+ pane.add(rate_value, c);
+ set_rate_tool_tip();
+ row++;
+
/* APRS interval */
c = new GridBagConstraints();
c.gridx = 0; c.gridy = row;
@@ -1009,6 +1043,14 @@ public class AltosConfigUI
return -1;
}
+ public void set_telemetry_rate(int new_rate) {
+ rate_value.set_rate(new_rate);
+ }
+
+ public int telemetry_rate() {
+ return rate_value.rate();
+ }
+
public void set_callsign(String new_callsign) {
callsign_value.setVisible(new_callsign != null);
callsign_value.setText(new_callsign);