- public AltosFlightStats(AltosStateIterable states) throws InterruptedException, IOException {
- double boost_time = boost_time(states);
- double end_time = 0;
- double landed_time = landed_time(states);
+ public AltosFlightStats(AltosFlightSeries series) {
+ AltosCalData cal_data = series.cal_data;
+
+ series.finish();
+
+ boost_time = boost_time(series);
+ landed_time = landed_time(series);
+
+ if (series.state_series != null){
+ boolean fixed_boost = false;
+ boolean fixed_landed = false;
+ for (AltosTimeValue state : series.state_series) {
+ if ((int) state.value == AltosLib.ao_flight_boost)
+ if (boost_time != AltosLib.MISSING) {
+ state.time = boost_time;
+ fixed_boost = true;
+ }
+ if ((int) state.value == AltosLib.ao_flight_landed)
+ if (landed_time != AltosLib.MISSING) {
+ state.time = landed_time;
+ fixed_landed = true;
+ }
+ }
+ if (!fixed_boost && boost_time != AltosLib.MISSING)
+ series.state_series.add(boost_time, AltosLib.ao_flight_boost);
+ if (!fixed_landed && landed_time != AltosLib.MISSING)
+ series.state_series.add(landed_time, AltosLib.ao_flight_landed);
+ }
+
+ System.out.printf("boost time %g landed %g\n", boost_time, landed_time);