altoslib: Add tilt and pyro data to CSV export
[fw/altos] / altoslib / AltosConfigData.java
index 63c34310f6d12458338d08b2e3a46b8b4cffed06..dc036867047cf278432aa99b7b35be0ccb244d6f 100644 (file)
@@ -405,7 +405,7 @@ public class AltosConfigData {
 
                /* HAS_GYRO */
                try {
-                       if (line.startsWith("IMU call along")) {
+                       if (line.startsWith("IMU cal along")) {
                                String[] bits = line.split("\\s+");
                                if (bits.length >= 8) {
                                        accel_zero_along = Integer.parseInt(bits[3]);
@@ -525,6 +525,12 @@ public class AltosConfigData {
                if (pad_orientation != AltosLib.MISSING)
                        pad_orientation = source.pad_orientation();
 
+               if (accel_cal_plus != AltosLib.MISSING)
+                       accel_cal_plus = source.accel_cal_plus();
+
+               if (accel_cal_minus != AltosLib.MISSING)
+                       accel_cal_minus = source.accel_cal_minus();
+
                /* HAS_LOG */
                if (flight_log_max != AltosLib.MISSING)
                        flight_log_max = source.flight_log_max();
@@ -592,6 +598,7 @@ public class AltosConfigData {
                dest.set_flight_log_max(flight_log_max);
                dest.set_ignite_mode(ignite_mode);
                dest.set_pad_orientation(pad_orientation);
+               dest.set_accel_cal(accel_cal_plus, accel_cal_minus);
                dest.set_callsign(callsign);
                if (npyro != AltosLib.MISSING)
                        dest.set_pyros(pyros);
@@ -669,9 +676,10 @@ public class AltosConfigData {
                        link.printf("c e %d\n", radio_enable);
 
                /* HAS_ACCEL */
-               /* UI doesn't support accel cal */
                if (pad_orientation != AltosLib.MISSING)
                        link.printf("c o %d\n", pad_orientation);
+               if (accel_cal_plus != AltosLib.MISSING && accel_cal_minus != AltosLib.MISSING)
+                       link.printf("c a %d %d\n", accel_cal_plus, accel_cal_minus);
 
                /* HAS_LOG */
                if (flight_log_max != 0)