return true;
}
- public AltosEeprom eeprom(int offset, int log_format, AltosState state) {
+ public AltosEeprom eeprom(int offset, int log_format, AltosState state) throws ParseException {
AltosEeprom eeprom = null;
- try {
- switch (log_format) {
- case AltosLib.AO_LOG_FORMAT_FULL:
- eeprom = new AltosEepromTM(this, offset);
- break;
- case AltosLib.AO_LOG_FORMAT_TINY:
- eeprom = new AltosEepromTm(this, offset, state);
- break;
- case AltosLib.AO_LOG_FORMAT_TELEMETRY:
- case AltosLib.AO_LOG_FORMAT_TELESCIENCE:
- break;
- case AltosLib.AO_LOG_FORMAT_TELEMEGA:
- eeprom = new AltosEepromMega(this, offset);
- break;
- case AltosLib.AO_LOG_FORMAT_TELEMETRUM:
- eeprom = new AltosEepromMetrum2(this, offset);
- break;
- case AltosLib.AO_LOG_FORMAT_TELEMINI:
- case AltosLib.AO_LOG_FORMAT_EASYMINI:
- eeprom = new AltosEepromMini(this, offset);
- break;
- }
- } catch (ParseException e) {
+ switch (log_format) {
+ case AltosLib.AO_LOG_FORMAT_FULL:
+ eeprom = new AltosEepromTM(this, offset);
+ break;
+ case AltosLib.AO_LOG_FORMAT_TINY:
+ eeprom = new AltosEepromTm(this, offset, state);
+ break;
+ case AltosLib.AO_LOG_FORMAT_TELEMETRY:
+ case AltosLib.AO_LOG_FORMAT_TELESCIENCE:
+ break;
+ case AltosLib.AO_LOG_FORMAT_TELEMEGA:
+ eeprom = new AltosEepromMega(this, offset);
+ break;
+ case AltosLib.AO_LOG_FORMAT_TELEMETRUM:
+ eeprom = new AltosEepromMetrum2(this, offset);
+ break;
+ case AltosLib.AO_LOG_FORMAT_TELEMINI:
+ case AltosLib.AO_LOG_FORMAT_EASYMINI:
+ eeprom = new AltosEepromMini(this, offset);
+ break;
+ default:
+ throw new ParseException("unknown eeprom format " + log_format, 0);
}
return eeprom;
}
}
}
- void CaptureEeprom(AltosEepromChunk eechunk, int log_format) throws IOException {
+ void CaptureEeprom(AltosEepromChunk eechunk, int log_format) throws IOException, ParseException {
boolean any_valid = false;
boolean got_flight = false;
CheckFile(false);
}
- void CaptureLog(AltosEepromLog log) throws IOException, InterruptedException, TimeoutException {
+ void CaptureLog(AltosEepromLog log) throws IOException, InterruptedException, TimeoutException, ParseException {
int block, state_block = 0;
int log_format = flights.config_data.log_format;
parse_exception = null;
if (log.selected) {
monitor.reset();
- CaptureLog(log);
+ try {
+ CaptureLog(log);
+ } catch (ParseException e) {
+ parse_exception = e;
+ }
}
if (parse_exception != null) {
failed = true;