Eventually, we'll hit a block with no valid data and give up. Until
then, keep going in case the flight computer glitched and wrote bad data.
Signed-off-by: Keith Packard <keithp@keithp.com>
AltosEepromList flights;
boolean success;
AltosEepromList flights;
boolean success;
- ParseException parse_exception;
AltosState state;
private void FlushPending() throws IOException {
AltosState state;
private void FlushPending() throws IOException {
+ void LogError(String error) {
+ if (parse_errors != null)
+ parse_errors.concat(error.concat("\n"));
+ else
+ parse_errors = error;
+ }
+
void CaptureEeprom(AltosEepromChunk eechunk, int log_format) throws IOException, ParseException {
boolean any_valid = false;
boolean got_flight = false;
void CaptureEeprom(AltosEepromChunk eechunk, int log_format) throws IOException, ParseException {
boolean any_valid = false;
boolean got_flight = false;
monitor.set_serial(flights.config_data.serial);
for (int i = 0; i < AltosEepromChunk.chunk_size && !done; i += record_length) {
monitor.set_serial(flights.config_data.serial);
for (int i = 0; i < AltosEepromChunk.chunk_size && !done; i += record_length) {
- AltosEeprom r = eechunk.eeprom(i, log_format, state);
+ AltosEeprom r = null;
+
+ try {
+ r = eechunk.eeprom(i, log_format, state);
+ } catch (ParseException pe) {
+ LogError(pe.getMessage());
+ r = null;
+ }
link.start_remote();
for (AltosEepromLog log : flights) {
link.start_remote();
for (AltosEepromLog log : flights) {
- parse_exception = null;
if (log.selected) {
monitor.reset();
eeprom_file = null;
try {
CaptureLog(log);
} catch (ParseException e) {
if (log.selected) {
monitor.reset();
eeprom_file = null;
try {
CaptureLog(log);
} catch (ParseException e) {
+ LogError(e.getMessage());
}
if (eeprom_file != null) {
eeprom_file.flush();
eeprom_file.close();
}
}
}
if (eeprom_file != null) {
eeprom_file.flush();
eeprom_file.close();
}
}
- if (parse_exception != null) {
+ if (parse_errors != null) {
- monitor.show_message(String.format("Flight %d download error\n%s\nValid log data saved",
+ monitor.show_message(String.format("Flight %d download error. Valid log data saved\n%s",
- parse_exception.getMessage()),
link.name,
AltosEepromMonitor.WARNING_MESSAGE);
}
link.name,
AltosEepromMonitor.WARNING_MESSAGE);
}