- if (imu == null)
- imu = new AltosIMU();
- if (mag == null)
- mag = new AltosMag();
- 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);
+ void write_motor_pressure() {
+ out.printf("%10.1f", motor_pressure());
+ }
+
+ void write_3d_accel_header() {
+ out.printf("accel_x,accel_y,accel_z");
+ }
+
+ double accel_along() { return series.value(AltosFlightSeries.accel_along_name, indices); }
+ double accel_across() { return series.value(AltosFlightSeries.accel_across_name, indices); }
+ double accel_through() { return series.value(AltosFlightSeries.accel_through_name, indices); }
+
+ void write_3d_accel() {
+ out.printf("%7.2f,%7.2f,%7.2f",
+ accel_along(), accel_across(), accel_through());
+ }
+
+ void write_imu_header() {
+ out.printf("gyro_roll,gyro_pitch,gyro_yaw,mag_x,mag_y,mag_z,tilt");
+ }
+
+ double gyro_roll() { return series.value(AltosFlightSeries.gyro_roll_name, indices); }
+ double gyro_pitch() { return series.value(AltosFlightSeries.gyro_pitch_name, indices); }
+ double gyro_yaw() { return series.value(AltosFlightSeries.gyro_yaw_name, indices); }
+
+ double mag_along() { return series.value(AltosFlightSeries.mag_along_name, indices); }
+ double mag_across() { return series.value(AltosFlightSeries.mag_across_name, indices); }
+ double mag_through() { return series.value(AltosFlightSeries.mag_through_name, indices); }
+
+ double tilt() { return series.value(AltosFlightSeries.orient_name, indices); }
+
+ void write_imu() {
+ out.printf("%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f",
+ gyro_roll(), gyro_pitch(), gyro_yaw(),
+ mag_along(), mag_across(), mag_through(),
+ tilt());
+ }
+
+ void write_igniter_header() {
+ out.printf("pyro");
+ for (int i = 0; i < series.igniter_voltage.length; i++)
+ out.printf(",%s", AltosLib.igniter_short_name(i));
+ }
+
+ double pyro() { return series.value(AltosFlightSeries.pyro_voltage_name, indices); }
+
+ double igniter_value(int channel) { return series.value(series.igniter_voltage_name(channel), indices); }
+
+ void write_igniter() {
+ out.printf("%5.2f", pyro());
+ for (int i = 0; i < series.igniter_voltage.length; i++)
+ out.printf(",%5.2f", igniter_value(i));