summaryrefslogtreecommitdiff
path: root/altosui/AltosConfigUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-25 00:02:06 -0800
committerKeith Packard <keithp@keithp.com>2013-11-25 00:02:06 -0800
commit82b42935d047d2f7c2f7a63a3efb72a3f1d5594e (patch)
tree6290de009ca976bed1a1cd40f1fc5dc00213e5c1 /altosui/AltosConfigUI.java
parent8da565bbafa2925aa889cf9249497a709a814b7f (diff)
altosui: Handle units in pyro config.
This lets you edit the pyro configuration using imperial units if desired. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfigUI.java')
-rw-r--r--altosui/AltosConfigUI.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java
index a6d27977..e07984b9 100644
--- a/altosui/AltosConfigUI.java
+++ b/altosui/AltosConfigUI.java
@@ -185,7 +185,7 @@ public class AltosConfigUI
void set_pad_orientation_tool_tip() {
if (pad_orientation_value.isEnabled())
- pad_orientation_value.setToolTipText("How will TeleMetrum be mounted in the airframe");
+ pad_orientation_value.setToolTipText("How will the computer be mounted in the airframe");
else {
if (is_telemetrum())
pad_orientation_value.setToolTipText("Older TeleMetrum firmware must fly antenna forward");
@@ -198,7 +198,7 @@ public class AltosConfigUI
/* Build the UI using a grid bag */
public AltosConfigUI(JFrame in_owner, boolean remote) {
- super (in_owner, "Configure TeleMetrum", false);
+ super (in_owner, "Configure Flight Computer", false);
owner = in_owner;
GridBagConstraints c;
@@ -661,7 +661,10 @@ public class AltosConfigUI
AltosConfigPyroUI pyro_ui;
public void dispose() {
+ if (pyro_ui != null)
+ pyro_ui.dispose();
AltosPreferences.unregister_units_listener(this);
+ super.dispose();
}
/* Listen for events from our buttons */
@@ -669,10 +672,10 @@ public class AltosConfigUI
String cmd = e.getActionCommand();
if (cmd.equals("Pyro")) {
- if (pyro_ui == null && pyros != null) {
+ if (pyro_ui == null && pyros != null)
pyro_ui = new AltosConfigPyroUI(this, pyros);
+ if (pyro_ui != null)
pyro_ui.make_visible();
- }
return;
}
@@ -757,9 +760,11 @@ public class AltosConfigUI
}
public void units_changed(boolean imperial_units) {
+ String v = main_deploy_value.getSelectedItem().toString();
main_deploy_label.setText(get_main_deploy_label());
set_main_deploy_values();
- listener.actionPerformed(new ActionEvent(this, 0, "Reset"));
+ int m = (int) (AltosConvert.height.parse(v, !imperial_units) + 0.5);
+ set_main_deploy(m);
}
public void set_apogee_delay(int new_apogee_delay) {