projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add --with-fat-dir configure option to publish finished stand-alone bits
[fw/altos]
/
ao-tools
/
altosui
/
AltosEepromReader.java
diff --git
a/ao-tools/altosui/AltosEepromReader.java
b/ao-tools/altosui/AltosEepromReader.java
index e2a780accc3216dcd8abfbfc460b8ffe70dbe996..cb82f9a9d6ced0f7f37596a178c88e52199d791e 100644
(file)
--- a/
ao-tools/altosui/AltosEepromReader.java
+++ b/
ao-tools/altosui/AltosEepromReader.java
@@
-101,8
+101,6
@@
public class AltosEepromReader extends AltosReader {
int gps_tick;
int gps_tick;
- boolean saw_boost;
-
int boost_tick;
boolean saw_gps_date;
int boost_tick;
boolean saw_gps_date;
@@
-116,7
+114,7
@@
public class AltosEepromReader extends AltosReader {
if (last_reported)
return null;
last_reported = true;
if (last_reported)
return null;
last_reported = true;
- return
state
;
+ return
new AltosRecord(state)
;
}
record = record_iterator.next();
}
record = record_iterator.next();
@@
-130,9
+128,7
@@
public class AltosEepromReader extends AltosReader {
state.tick = record.tick;
switch (record.cmd) {
case Altos.AO_LOG_FLIGHT:
state.tick = record.tick;
switch (record.cmd) {
case Altos.AO_LOG_FLIGHT:
- state.ground_accel = record.a;
- state.flight = record.b;
- seen |= seen_flight;
+ /* recorded when first read from the file */
break;
case Altos.AO_LOG_SENSOR:
state.accel = record.a;
break;
case Altos.AO_LOG_SENSOR:
state.accel = record.a;
@@
-167,7
+163,15
@@
public class AltosEepromReader extends AltosReader {
break;
case Altos.AO_LOG_GPS_TIME:
gps_tick = state.tick;
break;
case Altos.AO_LOG_GPS_TIME:
gps_tick = state.tick;
+ AltosGPS old = state.gps;
state.gps = new AltosGPS();
state.gps = new AltosGPS();
+
+ /* GPS date doesn't get repeated through the file */
+ if (old != null) {
+ state.gps.year = old.year;
+ state.gps.month = old.month;
+ state.gps.day = old.day;
+ }
state.gps.hour = (record.a & 0xff);
state.gps.minute = (record.a >> 8);
state.gps.second = (record.b & 0xff);
state.gps.hour = (record.a & 0xff);
state.gps.minute = (record.a >> 8);
state.gps.second = (record.b & 0xff);
@@
-197,7
+201,7
@@
public class AltosEepromReader extends AltosReader {
}
break;
case Altos.AO_LOG_GPS_DATE:
}
break;
case Altos.AO_LOG_GPS_DATE:
- state.gps.year =
record.a & 0xff
;
+ state.gps.year =
(record.a & 0xff) + 2000
;
state.gps.month = record.a >> 8;
state.gps.day = record.b & 0xff;
break;
state.gps.month = record.a >> 8;
state.gps.day = record.b & 0xff;
break;
@@
-334,12
+338,14
@@
public class AltosEepromReader extends AltosReader {
AltosOrderedRecord record = new AltosOrderedRecord(line, index++, tick);
if (record == null)
break;
AltosOrderedRecord record = new AltosOrderedRecord(line, index++, tick);
if (record == null)
break;
+ if (record.cmd == Altos.AO_LOG_INVALID)
+ continue;
tick = record.tick;
tick = record.tick;
- if (!saw_boost && record.cmd == Altos.AO_LOG_STATE &&
- record.a >= Altos.ao_flight_boost)
- {
- saw_boost = true;
+ if (record.cmd == Altos.AO_LOG_FLIGHT) {
+ state.ground_accel = record.a;
+ state.flight = record.b;
boost_tick = tick;
boost_tick = tick;
+ seen |= seen_flight;
}
/* Two firmware bugs caused the loss of some GPS data.
}
/* Two firmware bugs caused the loss of some GPS data.