From: Keith Packard Date: Fri, 6 Aug 2010 17:09:21 +0000 (-0400) Subject: altosui: Add comments to Eeprom reader X-Git-Tag: debian/0.6+373+gcf65c6b~47 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=b7699a5907e64bc7547fcc27e73f4a35bbaabfff altosui: Add comments to Eeprom reader --- diff --git a/ao-tools/altosui/AltosEepromReader.java b/ao-tools/altosui/AltosEepromReader.java index 7a8ff5b0..9b928abb 100644 --- a/ao-tools/altosui/AltosEepromReader.java +++ b/ao-tools/altosui/AltosEepromReader.java @@ -36,6 +36,10 @@ import altosui.AltosLog; import altosui.AltosVoice; import altosui.AltosEepromMonitor; +/* + * AltosRecords with an index field so they can be sorted by tick while preserving + * the original ordering for elements with matching ticks + */ class AltosOrderedRecord extends AltosEepromRecord implements Comparable { int index; @@ -217,6 +221,13 @@ public class AltosEepromReader { } } + /* + * Read the whole file, dumping records into a RB tree so + * we can enumerate them in time order -- the eeprom data + * are sometimes out of order with GPS data getting timestamps + * matching the first packet out of the GPS unit but not + * written until the final GPS packet has been received. + */ public AltosEepromReader (FileInputStream in_input) { state = new AltosRecord(); state.state = Altos.ao_flight_pad;