X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosConfigData.java;h=4ada1d3bbb309442a893171712a75340cb89e692;hp=134a0ed2ce0e1d7b3196794b1a45a57187475df7;hb=46f08f8709c538f3fee8e166598f0bb930df6e3c;hpb=4828be0ca5252ac9cd6061209385dcd6c4c57965 diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index 134a0ed2..4ada1d3b 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -58,6 +58,7 @@ public class AltosConfigData implements Iterable { /* HAS_LOG */ public int flight_log_max; + public int log_fixed; /* HAS_IGNITE */ public int ignite_mode; @@ -244,6 +245,7 @@ public class AltosConfigData implements Iterable { pad_orientation = -1; flight_log_max = -1; + log_fixed = -1; ignite_mode = -1; aes_key = ""; @@ -316,6 +318,7 @@ public class AltosConfigData implements Iterable { /* HAS_LOG */ try { flight_log_max = get_int(line, "Max flight log:"); } catch (Exception e) {} + try { log_fixed = get_int(line, "Log fixed:"); } catch (Exception e) {} /* HAS_IGNITE */ try { ignite_mode = get_int(line, "Ignite mode:"); } catch (Exception e) {} @@ -383,6 +386,10 @@ public class AltosConfigData implements Iterable { return radio_frequency >= 0 || radio_setting >= 0 || radio_channel >= 0; } + public boolean has_telemetry_rate() { + return telemetry_rate >= 0; + } + public void set_frequency(double freq) { int frequency = radio_frequency; int setting = radio_setting; @@ -498,6 +505,9 @@ public class AltosConfigData implements Iterable { if (log_space() == 0) max_enabled = false; + if (log_fixed > 0) + max_enabled = false; + switch (log_format) { case AltosLib.AO_LOG_FORMAT_TINY: max_enabled = false; @@ -552,20 +562,39 @@ public class AltosConfigData implements Iterable { radio_calibration); /* When remote, reset the dongle frequency at the same time */ if (remote) { + link.flush_output(); link.stop_remote(); link.set_radio_frequency(frequency); + link.flush_output(); link.start_remote(); } } - if (callsign != null) + if (telemetry_rate >= 0) { + link.printf("c T %d\n", telemetry_rate); + if (remote) { + link.flush_output(); + link.stop_remote(); + link.set_telemetry_rate(telemetry_rate); + link.flush_output(); + link.start_remote(); + } + } + + if (callsign != null) { link.printf("c c %s\n", callsign); + if (remote) { + link.flush_output(); + link.stop_remote(); + link.set_callsign(callsign); + link.flush_output(); + link.start_remote(); + } + } + if (radio_enable >= 0) link.printf("c e %d\n", radio_enable); - if (telemetry_rate >= 0) - link.printf("c T %d\n", telemetry_rate); - /* HAS_ACCEL */ /* UI doesn't support accel cal */ if (pad_orientation >= 0)