X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosFlightSeries.java;fp=altoslib%2FAltosFlightSeries.java;h=38256f0e4ca515d73eadc88c0866b7c7c73e96a0;hp=ef4ef4dfc6dcebb8432a5192b793e06b0b650006;hb=6ac469fb46e9fabfd473b9a3d8bcd92db00b98b2;hpb=41538b1b600eef242d1ede9fe9039d1079f6891a diff --git a/altoslib/AltosFlightSeries.java b/altoslib/AltosFlightSeries.java index ef4ef4df..38256f0e 100644 --- a/altoslib/AltosFlightSeries.java +++ b/altoslib/AltosFlightSeries.java @@ -286,11 +286,16 @@ public class AltosFlightSeries extends AltosDataListener { } private void compute_height() { - double ground_altitude = cal_data().ground_altitude; - if (height_series == null && ground_altitude != AltosLib.MISSING && altitude_series != null) { - height_series = add_series(height_name, AltosConvert.height); - for (AltosTimeValue alt : altitude_series) - height_series.add(alt.time, alt.value - ground_altitude); + if (height_series == null) { + double ground_altitude = cal_data().ground_altitude; + if (ground_altitude != AltosLib.MISSING && altitude_series != null) { + height_series = add_series(height_name, AltosConvert.height); + for (AltosTimeValue alt : altitude_series) + height_series.add(alt.time, alt.value - ground_altitude); + } else if (speed_series != null) { + height_series = add_series(height_name, AltosConvert.height); + speed_series.integrate(height_series); + } } if (gps_height == null && cal_data().gps_pad != null && cal_data().gps_pad.alt != AltosLib.MISSING && gps_altitude != null) { @@ -401,6 +406,9 @@ public class AltosFlightSeries extends AltosDataListener { if (cal_data.accel_zero_across == AltosLib.MISSING) return; + if (cal_data.gyro_zero_roll == AltosLib.MISSING) + return; + AltosRotation rotation = new AltosRotation(accel_ground_across, accel_ground_through, accel_ground_along, @@ -758,6 +766,16 @@ public class AltosFlightSeries extends AltosDataListener { public void set_companion(AltosCompanion companion) { } + public static final String motor_pressure_name = "Motor Pressure"; + + public AltosTimeSeries motor_pressure_series; + + public void set_motor_pressure(double motor_pressure) { + if (motor_pressure_series == null) + motor_pressure_series = add_series(motor_pressure_name, AltosConvert.pressure); + motor_pressure_series.add(time(), motor_pressure); + } + public void finish() { compute_orient(); if (speed_series == null) {