From: Keith Packard Date: Fri, 10 Sep 2010 06:04:59 +0000 (-0700) Subject: altosui: Stop parsing eeprom file after hitting 'landed' state X-Git-Tag: 0.7.1 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=refs%2Ftags%2F0.7.1;hp=67b6952f7126704478ede5575e5e938d18fcc329 altosui: Stop parsing eeprom file after hitting 'landed' state Sometimes there are additional records found in the eeprom file; the reader is mostly worried about not losing anything, so it reads as much as it can. However, the last record written for any flight is the 'landed' record, so we can stop looking at the file after hitting that. Signed-off-by: Keith Packard --- diff --git a/ao-tools/altosui/AltosEepromReader.java b/ao-tools/altosui/AltosEepromReader.java index f1d6a6a7..4cc8536a 100644 --- a/ao-tools/altosui/AltosEepromReader.java +++ b/ao-tools/altosui/AltosEepromReader.java @@ -391,6 +391,11 @@ public class AltosEepromReader extends AltosReader { } } records.add(record); + + /* Bail after reading the 'landed' record; we're all done */ + if (record.cmd == Altos.AO_LOG_STATE && + record.a == Altos.ao_flight_landed) + break; } } catch (IOException io) { } catch (ParseException pe) {