- if (series.accel_series != null)
- max_acceleration = series.accel_series.max();
- max_gps_height = AltosLib.MISSING;
- if (series.gps_height != null)
- max_gps_height = series.gps_height.max();
-
-/*
- for (AltosState state : states) {
- end_time = state.time;
-
- int state_id = state.state();
- if (boost_time != AltosLib.MISSING && state.time >= boost_time && state_id < AltosLib.ao_flight_boost) {
- state_id = AltosLib.ao_flight_boost;
- }
- if (landed_time != AltosLib.MISSING && state.time >= landed_time && state_id < AltosLib.ao_flight_landed) {
- state_id = AltosLib.ao_flight_landed;
- }
-
- if (0 <= state_id && state_id < AltosLib.ao_flight_invalid) {
- double acceleration = state.acceleration();
- double speed = state.speed();
- if (acceleration != AltosLib.MISSING && speed != AltosLib.MISSING) {
- state_accel[state_id] += acceleration;
- state_speed[state_id] += speed;
- state_count[state_id]++;
- }
- if (state_start[state_id] == 0.0)
- state_start[state_id] = state.time;
- if (state_end[state_id] < state.time)
- state_end[state_id] = state.time;
- }
- if (state.pad_lat != AltosLib.MISSING) {
- pad_lat = state.pad_lat;
- pad_lon = state.pad_lon;
- }
- if (state.gps != null && state.gps.locked && state.gps.nsat >= 4) {
- lat = state.gps.lat;
- lon = state.gps.lon;
- has_gps = true;
- if (state.gps.cc_gps_sat != null)
- has_gps_sats = true;
- if (state.gps.course != AltosLib.MISSING)
- has_gps_detail = true;
- }
- if (state.imu != null)
- has_imu = true;
- if (state.mag != null)
- has_mag = true;
- if (state.orient() != AltosLib.MISSING)
- has_orient = true;
- if (state.ignitor_voltage != null && state.ignitor_voltage.length > num_ignitor)
- num_ignitor = state.ignitor_voltage.length;
+ if (series.accel_series != null) {
+ AltosTimeValue tv = series.accel_series.max(state_start[AltosLib.ao_flight_boost], state_start[AltosLib.ao_flight_drogue]);
+ if (tv == null)
+ tv = series.accel_series.max();
+ if (tv != null)
+ max_acceleration = tv.value;