X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosCSV.java;h=0676f99d38fb63478f4da9c32f5a9535e02743d1;hb=90b0db1ae53182c94bf12d661446fc369d916366;hp=b88bedba2f512e60532acafaa7cc7d0248135e43;hpb=1824761f5b98e92485e2dd347b1c4d043ec207e2;p=fw%2Faltos diff --git a/altosui/AltosCSV.java b/altosui/AltosCSV.java index b88bedba..0676f99d 100644 --- a/altosui/AltosCSV.java +++ b/altosui/AltosCSV.java @@ -17,10 +17,9 @@ package altosui; -import java.lang.*; import java.io.*; -import java.text.*; import java.util.*; +import org.altusmetrum.altoslib_1.*; public class AltosCSV implements AltosWriter { File name; @@ -129,10 +128,10 @@ public class AltosCSV implements AltosWriter { void write_basic(AltosRecord record) { out.printf("%8.2f,%10.2f,%8.2f,%8.2f,%8.2f,%8.2f,%5.1f,%5.2f,%5.2f,%5.2f", record.acceleration(), - record.raw_pressure(), - record.raw_altitude(), - record.raw_height(), - record.accel_speed(), + record.pressure(), + record.altitude(), + record.height(), + state.accel_speed, state.baro_speed, record.temperature(), record.battery_voltage(), @@ -145,14 +144,14 @@ public class AltosCSV implements AltosWriter { } void write_advanced(AltosRecord record) { - AltosIMU imu = record.imu; - AltosMag mag = record.mag; + AltosIMU imu = record.imu(); + AltosMag mag = record.mag(); if (imu == null) imu = new AltosIMU(); if (mag == null) mag = new AltosMag(); - out.printf("%d,%d,%d,%d,%d,%d,%d,%d,%d", + out.printf("%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d", imu.accel_x, imu.accel_y, imu.accel_z, imu.gyro_x, imu.gyro_y, imu.gyro_z, mag.x, mag.y, mag.z); @@ -262,7 +261,7 @@ public class AltosCSV implements AltosWriter { write_general(record); out.printf(","); write_flight(record); out.printf(","); write_basic(record); out.printf(","); - if (record.imu != null || record.mag != null) + if (record.imu() != null || record.mag() != null) write_advanced(record); if (record.gps != null) { out.printf(","); @@ -286,7 +285,7 @@ public class AltosCSV implements AltosWriter { if (record.state == Altos.ao_flight_startup) return; if (!header_written) { - write_header(record.imu != null || record.mag != null, + write_header(record.imu() != null || record.mag() != null, record.gps != null, record.companion != null); header_written = true; }