X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosConfigData.java;h=0820bf56212b5af067022f2c968cdb793c682d5f;hb=08f07d0af123e1c307bc4c0c973da07fae8246b1;hp=4ada1d3bbb309442a893171712a75340cb89e692;hpb=46f08f8709c538f3fee8e166598f0bb930df6e3c;p=fw%2Faltos diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index 4ada1d3b..0820bf56 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -90,6 +90,19 @@ public class AltosConfigData implements Iterable { public int tracker_motion; public int tracker_interval; + /* HAS_GYRO */ + public int accel_zero_along, accel_zero_across, accel_zero_through; + + /* ms5607 data */ + public int ms5607_reserved; + public int ms5607_sens; + public int ms5607_off; + public int ms5607_tcs; + public int ms5607_tco; + public int ms5607_tref; + public int ms5607_tempsens; + public int ms5607_crc; + public static String get_string(String line, String label) throws ParseException { if (line.startsWith(label)) { String quoted = line.substring(label.length()).trim(); @@ -266,6 +279,10 @@ public class AltosConfigData implements Iterable { storage_size = -1; storage_erase_unit = -1; stored_flight = 0; + + accel_zero_along = -1; + accel_zero_across = -1; + accel_zero_through = -1; } public void parse_line(String line) { @@ -282,6 +299,15 @@ public class AltosConfigData implements Iterable { /* Version also contains MS5607 info, which we ignore here */ + try { ms5607_reserved = get_int(line, "ms5607 reserved:"); } catch (Exception e) {} + try { ms5607_sens = get_int(line, "ms5607 sens:"); } catch (Exception e) {} + try { ms5607_off = get_int(line, "ms5607 off:"); } catch (Exception e) {} + try { ms5607_tcs = get_int(line, "ms5607 tcs:"); } catch (Exception e) {} + try { ms5607_tco = get_int(line, "ms5607 tco:"); } catch (Exception e) {} + try { ms5607_tref = get_int(line, "ms5607 tref:"); } catch (Exception e) {} + try { ms5607_tempsens = get_int(line, "ms5607 tempsens:"); } catch (Exception e) {} + try { ms5607_crc = get_int(line, "ms5607 crc:"); } catch (Exception e) {} + /* Config show replies */ /* HAS_FLIGHT */ @@ -361,6 +387,18 @@ public class AltosConfigData implements Iterable { /* Log listing replies */ try { get_int(line, "flight"); stored_flight++; } catch (Exception e) {} + + /* HAS_GYRO */ + try { + if (line.startsWith("IMU call along")) { + String[] bits = line.split("\\s+"); + if (bits.length >= 8) { + accel_zero_along = Integer.parseInt(bits[3]); + accel_zero_across = Integer.parseInt(bits[5]); + accel_zero_through = Integer.parseInt(bits[7]); + } + } + } catch (Exception e) {} } public AltosConfigData() { @@ -429,6 +467,8 @@ public class AltosConfigData implements Iterable { return false; if (product.startsWith("TeleMetrum-v2")) return false; + if (product.startsWith("EasyMega")) + return false; return true; } @@ -537,6 +577,14 @@ public class AltosConfigData implements Iterable { dest.set_tracker_interval(tracker_interval); } + public boolean log_has_state() { + switch (log_format) { + case AltosLib.AO_LOG_FORMAT_TELEGPS: + return false; + } + return true; + } + public void save(AltosLink link, boolean remote) throws InterruptedException, TimeoutException { /* HAS_FLIGHT */ @@ -635,6 +683,9 @@ public class AltosConfigData implements Iterable { if (tracker_motion >= 0 && tracker_interval >= 0) link.printf("c t %d %d\n", tracker_motion, tracker_interval); + /* HAS_GYRO */ + /* UI doesn't support accel cal */ + link.printf("c w\n"); link.flush_output(); }