projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: Eliminate unncessary import altosui lines
[fw/altos]
/
ao-tools
/
altosui
/
AltosEepromIterable.java
diff --git
a/ao-tools/altosui/AltosEepromIterable.java
b/ao-tools/altosui/AltosEepromIterable.java
index d4ac3f3e14bedb8b5043af8bb26ae4f6bbc86333..fc6833216c8a0ea36d441b1d62d084092e040023 100644
(file)
--- a/
ao-tools/altosui/AltosEepromIterable.java
+++ b/
ao-tools/altosui/AltosEepromIterable.java
@@
-28,14
+28,6
@@
import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.prefs.*;
import java.util.concurrent.LinkedBlockingQueue;
-import altosui.AltosRecord;
-import altosui.AltosState;
-import altosui.AltosDeviceDialog;
-import altosui.AltosPreferences;
-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
/*
* AltosRecords with an index field so they can be sorted by tick while preserving
* the original ordering for elements with matching ticks
@@
-44,15
+36,19
@@
class AltosOrderedRecord extends AltosEepromRecord implements Comparable<AltosOr
public int index;
public int index;
- public AltosOrderedRecord(String line, int in_index, int prev_tick)
+ public AltosOrderedRecord(String line, int in_index, int prev_tick
, boolean prev_tick_valid
)
throws ParseException {
super(line);
throws ParseException {
super(line);
- int new_tick = tick | (prev_tick & ~0xffff);
- if (new_tick < prev_tick) {
- if (prev_tick - new_tick > 0x8000)
- new_tick += 0x10000;
+ if (prev_tick_valid) {
+ tick |= (prev_tick & ~0xffff);
+ if (tick < prev_tick) {
+ if (prev_tick - tick > 0x8000)
+ tick += 0x10000;
+ } else {
+ if (tick - prev_tick > 0x8000)
+ tick -= 0x10000;
+ }
}
}
- tick = new_tick;
index = in_index;
}
index = in_index;
}
@@
-340,7
+336,7
@@
public class AltosEepromIterable extends AltosRecordIterable {
int index = 0;
int prev_tick = 0;
int index = 0;
int prev_tick = 0;
-
+ boolean prev_tick_valid = false;
boolean missing_time = false;
try {
boolean missing_time = false;
try {
@@
-348,12
+344,14
@@
public class AltosEepromIterable extends AltosRecordIterable {
String line = AltosRecord.gets(input);
if (line == null)
break;
String line = AltosRecord.gets(input);
if (line == null)
break;
- AltosOrderedRecord record = new AltosOrderedRecord(line, index++, prev_tick);
+ AltosOrderedRecord record = new AltosOrderedRecord(line, index++, prev_tick
, prev_tick_valid
);
if (record == null)
break;
if (record.cmd == Altos.AO_LOG_INVALID)
continue;
prev_tick = record.tick;
if (record == null)
break;
if (record.cmd == Altos.AO_LOG_INVALID)
continue;
prev_tick = record.tick;
+ if (record.cmd < Altos.AO_LOG_CONFIG_VERSION)
+ prev_tick_valid = true;
if (record.cmd == Altos.AO_LOG_FLIGHT) {
flight_record = record;
continue;
if (record.cmd == Altos.AO_LOG_FLIGHT) {
flight_record = record;
continue;