From 67b6952f7126704478ede5575e5e938d18fcc329 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 9 Sep 2010 23:04:14 -0700 Subject: altosui: Fill in time value of last Eeprom record read from file The last record is handled separately, and was missing the code to compute the time. Sigh. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosEepromReader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ao-tools/altosui/AltosEepromReader.java') diff --git a/ao-tools/altosui/AltosEepromReader.java b/ao-tools/altosui/AltosEepromReader.java index cb82f9a9..f1d6a6a7 100644 --- a/ao-tools/altosui/AltosEepromReader.java +++ b/ao-tools/altosui/AltosEepromReader.java @@ -114,7 +114,9 @@ public class AltosEepromReader extends AltosReader { if (last_reported) return null; last_reported = true; - return new AltosRecord(state); + AltosRecord r = new AltosRecord(state); + r.time = (r.tick - boost_tick) / 100.0; + return r; } record = record_iterator.next(); -- cgit v1.2.3 From 9d0e89e8ad8926dc8371fa809835a580ae49711d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 9 Sep 2010 23:04:59 -0700 Subject: 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 --- ao-tools/altosui/AltosEepromReader.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ao-tools/altosui/AltosEepromReader.java') 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) { -- cgit v1.2.3