+ private void add_times(AltosFlightSeries series, int state, double start_time, double end_time) {
+ double delta_time = end_time - start_time;
+ if (0 <= state && state <= AltosLib.ao_flight_invalid && delta_time > 0) {
+ if (state_enter_speed[state] == AltosLib.MISSING)
+ state_enter_speed[state] = series.speed_series.value(start_time);
+ if (state_enter_height[state] == AltosLib.MISSING)
+ state_enter_height[state] = series.height_series.value(start_time);
+ if (state_enter_gps_height[state] == AltosLib.MISSING)
+ if (series.gps_height != null)
+ state_enter_gps_height[state] = series.gps_height.value(start_time);
+ speeds[state].value += series.speed_series.average(start_time, end_time) * delta_time;
+ speeds[state].time += delta_time;
+ accels[state].value += series.accel_series.average(start_time, end_time) * delta_time;
+ accels[state].time += delta_time;
+ state_time[state] += delta_time;
+
+ if (state == AltosLib.ao_flight_boost) {
+ AltosTimeValue tv_speed = series.speed_series.max(start_time, end_time);
+ if (tv_speed != null && (max_speed == AltosLib.MISSING || tv_speed.value > max_speed))
+ max_speed = tv_speed.value;
+ AltosTimeValue tv_accel = series.accel_series.max(start_time, end_time);
+ if (tv_accel != null && (max_acceleration == AltosLib.MISSING || tv_accel.value > max_acceleration))
+ max_acceleration = tv_accel.value;
+ }
+ }
+ }