if (state_end[state.state] < state.time)
state_end[state.state] = state.time;
max_height = state.max_height;
- max_speed = state.max_speed;
+ if (state.max_speed != 0)
+ max_speed = state.max_speed;
+ else
+ max_speed = state.max_baro_speed;
max_acceleration = state.max_acceleration;
}
} catch (ParseException pp) {
String.format("%5.0f m/s", stats.max_speed),
String.format("%5.0f ft/s", stats.max_speed * 100 / 2.54 / 12),
String.format("Mach %5.3f", stats.max_speed / 343.0));
- new FlightStat(layout, y++, "Maximum acceleration",
- String.format("%5.0f m/s²", stats.max_acceleration),
- String.format("%5.0f ft/s²", stats.max_acceleration * 100 / 2.54 /12),
- String.format("%5.2f G", stats.max_acceleration / 9.80665));
- new FlightStat(layout, y++, "Average boost acceleration",
- String.format("%5.0f m/s²", stats.state_accel[Altos.ao_flight_boost]),
- String.format("%5.0f ft/s²", stats.state_accel[Altos.ao_flight_boost] * 100 / 2.54 /12),
- String.format("%5.2f G", stats.state_accel[Altos.ao_flight_boost] / 9.80665));
+ if (stats.max_acceleration != AltosRecord.MISSING) {
+ new FlightStat(layout, y++, "Maximum acceleration",
+ String.format("%5.0f m/s²", stats.max_acceleration),
+ String.format("%5.0f ft/s²", stats.max_acceleration * 100 / 2.54 /12),
+ String.format("%5.2f G", stats.max_acceleration / 9.80665));
+ new FlightStat(layout, y++, "Average boost acceleration",
+ String.format("%5.0f m/s²", stats.state_accel[Altos.ao_flight_boost]),
+ String.format("%5.0f ft/s²", stats.state_accel[Altos.ao_flight_boost] * 100 / 2.54 /12),
+ String.format("%5.2f G", stats.state_accel[Altos.ao_flight_boost] / 9.80665));
+ }
new FlightStat(layout, y++, "Drogue descent rate",
String.format("%5.0f m/s", stats.state_baro_speed[Altos.ao_flight_drogue]),
String.format("%5.0f ft/s", stats.state_baro_speed[Altos.ao_flight_drogue] * 100 / 2.54 / 12));
double max_height;
double max_acceleration;
double max_speed;
+ double max_baro_speed;
AltosGPS gps;
max_height = prev_state.max_height;
max_acceleration = prev_state.max_acceleration;
max_speed = prev_state.max_speed;
+ max_baro_speed = prev_state.max_baro_speed;
/* make sure the clock is monotonic */
while (tick < prev_state.tick)
max_acceleration = acceleration;
if (ascent && speed > max_speed)
max_speed = speed;
+ if (ascent && baro_speed > max_baro_speed)
+ max_baro_speed = baro_speed;
if (height > max_height)
max_height = height;