diff options
author | Keith Packard <keithp@keithp.com> | 2010-09-09 23:04:59 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-09-09 23:07:16 -0700 |
commit | 9d0e89e8ad8926dc8371fa809835a580ae49711d (patch) | |
tree | 729cb9bfe3ac9b298703cbf08ceb8e03c90eb0d9 /ao-tools | |
parent | 67b6952f7126704478ede5575e5e938d18fcc329 (diff) |
altosui: Stop parsing eeprom file after hitting 'landed' state0.7.1
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 <keithp@keithp.com>
Diffstat (limited to 'ao-tools')
-rw-r--r-- | ao-tools/altosui/AltosEepromReader.java | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |