altosui: Add comments to Eeprom reader
authorKeith Packard <keithp@keithp.com>
Fri, 6 Aug 2010 17:09:21 +0000 (13:09 -0400)
committerKeith Packard <keithp@keithp.com>
Fri, 6 Aug 2010 17:09:21 +0000 (13:09 -0400)
ao-tools/altosui/AltosEepromReader.java

index 7a8ff5b036a2f3dc4811bcf607fa2adb81739794..9b928abbfd9795a223f6dd6b5dd539245c5b5b76 100644 (file)
@@ -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<AltosOrderedRecord> {
 
        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;