- for (int s = AltosLib.ao_flight_startup; s <= AltosLib.ao_flight_landed; s++) {
- if (state_count[s] > 0) {
- state_speed[s] /= state_count[s];
- state_accel[s] /= state_count[s];
- } else {
- state_speed[s] = AltosLib.MISSING;
- state_accel[s] = AltosLib.MISSING;
- }
- if (state_start[s] == 0)
- state_start[s] = end_time;
- if (state_end[s] == 0)
- state_end[s] = end_time;
+
+ max_height = AltosLib.MISSING;
+ if (series.height_series != null)
+ max_height = series.height_series.max().value;
+ max_speed = AltosLib.MISSING;
+ if (series.speed_series != null) {
+ AltosTimeValue tv = series.speed_series.max(state_start[AltosLib.ao_flight_boost], state_start[AltosLib.ao_flight_drogue]);
+ if (tv == null)
+ tv = series.speed_series.max();
+ if (tv != null)
+ max_speed = tv.value;
+ }
+ max_acceleration = AltosLib.MISSING;
+ 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;
+ }
+ max_gps_height = AltosLib.MISSING;
+ if (series.gps_height != null) {
+ AltosTimeValue tv = series.gps_height.max();
+ if (tv != null)
+ max_gps_height = tv.value;