X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosCSV.java;h=2ad50097622e01de54be751b47e6f59cff9a6d73;hb=02b07a202839d6e68b3f0db7f8965478661db140;hp=4a9278d901fefd1348120d4a5d72d4f75991cf8f;hpb=4828be0ca5252ac9cd6061209385dcd6c4c57965;p=fw%2Faltos diff --git a/altoslib/AltosCSV.java b/altoslib/AltosCSV.java index 4a9278d9..2ad50097 100644 --- a/altoslib/AltosCSV.java +++ b/altoslib/AltosCSV.java @@ -158,21 +158,14 @@ public class AltosCSV implements AltosWriter { } void write_advanced_header() { - out.printf("accel_x,accel_y,accel_z,gyro_x,gyro_y,gyro_z"); + out.printf("accel_x,accel_y,accel_z,gyro_x,gyro_y,gyro_z,mag_x,mag_y,mag_z"); } void write_advanced(AltosState state) { - AltosIMU imu = state.imu; - AltosMag mag = state.mag; - - if (imu == null) - imu = new AltosIMU(); - if (mag == null) - mag = new AltosMag(); out.printf("%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f", - imu.accel_x, imu.accel_y, imu.accel_z, - imu.gyro_x, imu.gyro_y, imu.gyro_z, - mag.x, mag.y, mag.z); + state.accel_along(), state.accel_across(), state.accel_through(), + state.gyro_roll(), state.gyro_pitch(), state.gyro_yaw(), + state.mag_along(), state.mag_across(), state.mag_through()); } void write_gps_header() { @@ -381,7 +374,7 @@ public class AltosCSV implements AltosWriter { has_basic = true; if (state.battery_voltage != AltosLib.MISSING) has_battery = true; - if (state.imu != null || state.mag != null) + if (state.accel_across() != AltosLib.MISSING) has_advanced = true; if (state.gps != null) { has_gps = true;