- public AltosEepromFile(FileInputStream input) {
- headers = new AltosEepromIterable(AltosEepromHeader.read(input));
-
- AltosState state = headers.state();
-
- switch (state.log_format) {
- case AltosLib.AO_LOG_FORMAT_FULL:
- body = new AltosEepromIterable(AltosEepromTM.read(input));
- break;
- case AltosLib.AO_LOG_FORMAT_TINY:
- case AltosLib.AO_LOG_FORMAT_TELEMETRY:
- case AltosLib.AO_LOG_FORMAT_TELESCIENCE:
- case AltosLib.AO_LOG_FORMAT_TELEMEGA:
- break;
- case AltosLib.AO_LOG_FORMAT_TELEMINI:
- case AltosLib.AO_LOG_FORMAT_EASYMINI:
- body = new AltosEepromIterable(AltosEepromMini.read(input));
- break;
- }
- }
-
- int boost_tick (AltosState start) {
- AltosState state = start.clone();
- for (AltosEeprom eeprom : body) {
- eeprom.update_state(state);
- if (state.state >= AltosLib.ao_flight_boost)
- return state.tick;
- }
- return 0;