projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: set default .csv file name in file save dialog
[fw/altos]
/
ao-tools
/
altosui
/
AltosTelemetryReader.java
diff --git
a/ao-tools/altosui/AltosTelemetryReader.java
b/ao-tools/altosui/AltosTelemetryReader.java
index a3402f9c8b85a1756809ed2f879009fcb37b4294..3564a0a5a7aa14acf5f98925dbef47f203f515d8 100644
(file)
--- a/
ao-tools/altosui/AltosTelemetryReader.java
+++ b/
ao-tools/altosui/AltosTelemetryReader.java
@@
-41,6
+41,7
@@
public class AltosTelemetryReader extends AltosReader {
public AltosTelemetryReader (FileInputStream input) {
boolean saw_boost = false;
public AltosTelemetryReader (FileInputStream input) {
boolean saw_boost = false;
+ int current_tick = 0;
records = new LinkedList<AltosRecord> ();
records = new LinkedList<AltosRecord> ();
@@
-54,6
+55,15
@@
public class AltosTelemetryReader extends AltosReader {
AltosTelemetry record = new AltosTelemetry(line);
if (record == null)
break;
AltosTelemetry record = new AltosTelemetry(line);
if (record == null)
break;
+ if (records.isEmpty()) {
+ current_tick = record.tick;
+ } else {
+ int tick = record.tick | (current_tick & ~ 0xffff);
+ if (tick < current_tick - 0x1000)
+ tick += 0x10000;
+ current_tick = tick;
+ record.tick = current_tick;
+ }
if (!saw_boost && record.state >= Altos.ao_flight_boost)
{
saw_boost = true;
if (!saw_boost && record.state >= Altos.ao_flight_boost)
{
saw_boost = true;
@@
-62,6
+72,8
@@
public class AltosTelemetryReader extends AltosReader {
records.add(record);
} catch (ParseException pe) {
System.out.printf("parse exception %s\n", pe.getMessage());
records.add(record);
} catch (ParseException pe) {
System.out.printf("parse exception %s\n", pe.getMessage());
+ } catch (AltosCRCException ce) {
+ System.out.printf("crc error\n");
}
}
} catch (IOException io) {
}
}
} catch (IOException io) {