diff options
author | Keith Packard <keithp@keithp.com> | 2011-08-02 19:07:56 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-08-02 19:07:56 -0700 |
commit | 6492218fc316f8cf6214a577807a8dd0a80a9b6a (patch) | |
tree | 27c0c590dd237c481dbf576b709010c141ecab3b /altosui/AltosConfig.java | |
parent | 11a2bb8e28df7ed87542f2ee726f877971f5d52a (diff) |
altos/altosui: Add pad orientation configure option
Allow TeleMetrum to be operated with the antenna pointing downwards on
the pad. This provides some additional flexibility when designing an
ebay.
The accelerometer calibration levels are flipped around to match, so
no re-calibration should be required.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfig.java')
-rw-r--r-- | altosui/AltosConfig.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index e3c30d4d..04d75528 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -71,6 +71,7 @@ public class AltosConfig implements ActionListener { int_ref radio_calibration; int_ref flight_log_max; int_ref ignite_mode; + int_ref pad_orientation; string_ref version; string_ref product; string_ref callsign; @@ -132,6 +133,7 @@ public class AltosConfig implements ActionListener { config_ui.set_radio_calibration(radio_calibration.get()); config_ui.set_flight_log_max(flight_log_max.get()); config_ui.set_ignite_mode(ignite_mode.get()); + config_ui.set_pad_orientation(pad_orientation.get()); config_ui.set_callsign(callsign.get()); config_ui.set_clean(); config_ui.make_visible(); @@ -139,12 +141,10 @@ public class AltosConfig implements ActionListener { void process_line(String line) { if (line == null) { - System.out.printf("timeout\n"); abort(); return; } if (line.equals("done")) { - System.out.printf("done\n"); if (serial_line != null) update_ui(); return; @@ -156,6 +156,7 @@ public class AltosConfig implements ActionListener { get_int(line, "Radio cal:", radio_calibration); get_int(line, "Max flight log:", flight_log_max); get_int(line, "Ignite mode:", ignite_mode); + get_int(line, "Pad orientation:", pad_orientation); get_string(line, "Callsign:", callsign); get_string(line,"software-version", version); get_string(line,"product", product); @@ -229,6 +230,8 @@ public class AltosConfig implements ActionListener { serial_line.printf("c l %d\n", flight_log_max.get()); if (ignite_mode.get() >= 0) serial_line.printf("c i %d\n", ignite_mode.get()); + if (pad_orientation.get() >= 0) + serial_line.printf("c o %d\n", pad_orientation.get()); serial_line.printf("c w\n"); } catch (InterruptedException ie) { } finally { @@ -312,6 +315,7 @@ public class AltosConfig implements ActionListener { radio_calibration.set(config_ui.radio_calibration()); flight_log_max.set(config_ui.flight_log_max()); ignite_mode.set(config_ui.ignite_mode()); + pad_orientation.set(config_ui.pad_orientation()); callsign.set(config_ui.callsign()); run_serial_thread(serial_mode_save); } @@ -347,6 +351,7 @@ public class AltosConfig implements ActionListener { radio_calibration = new int_ref(1186611); flight_log_max = new int_ref(0); ignite_mode = new int_ref(-1); + pad_orientation = new int_ref(-1); callsign = new string_ref("N0CALL"); version = new string_ref("unknown"); product = new string_ref("unknown"); |