diff options
| author | Keith Packard <keithp@keithp.com> | 2011-10-09 10:55:04 -0600 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-10-09 11:09:11 -0600 |
| commit | 5c82b07471f017171c58a6968adf79901f46a987 (patch) | |
| tree | e41009d4a56561a495d979dfbf6fd8c3f0a72e0c /altosui/AltosRecord.java | |
| parent | 636b7b368e67346b0796cd84fbfd71e10966d61f (diff) | |
altosui: Deal with telem data that goes backwards in time
The new telemetry stuff can send packets with older timestamps, so
sort telem packets read from disk to create an in-order record of the flight.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosRecord.java')
| -rw-r--r-- | altosui/AltosRecord.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/altosui/AltosRecord.java b/altosui/AltosRecord.java index ce6d86ab..486c96b2 100644 --- a/altosui/AltosRecord.java +++ b/altosui/AltosRecord.java @@ -22,7 +22,7 @@ import java.text.*; import java.util.HashMap; import java.io.*; -public class AltosRecord { +public class AltosRecord implements Comparable <AltosRecord> { final static int MISSING = 0x7fffffff; static final int seen_flight = 1; @@ -243,6 +243,10 @@ public class AltosRecord { return null; } + public int compareTo(AltosRecord o) { + return tick - o.tick; + } + public AltosRecord(AltosRecord old) { version = old.version; seen = old.seen; |
