mirror of https://github.com/ArduPilot/ardupilot
tools: my change to use stdin, broke reading logs that have no header
This fixes it (I'm careful to avoid seeking)
This commit is contained in:
parent
ddd24e8135
commit
0bccbf2409
|
@ -288,13 +288,14 @@ class DataflashLog:
|
||||||
f = sys.stdin
|
f = sys.stdin
|
||||||
else:
|
else:
|
||||||
f = open(self.filename, 'r')
|
f = open(self.filename, 'r')
|
||||||
if f.read(4) == '\xa3\x95\x80\x80':
|
|
||||||
raise Exception("Unable to parse binary log files at this time, will be added soon")
|
|
||||||
|
|
||||||
lineNumber = 0
|
lineNumber = 0
|
||||||
knownHardwareTypes = ["APM", "PX4", "MPNG"]
|
knownHardwareTypes = ["APM", "PX4", "MPNG"]
|
||||||
numBytes = 0
|
numBytes = 0
|
||||||
for line in f:
|
for line in f:
|
||||||
|
if len(line) >= 4 and line[0:4] == '\xa3\x95\x80\x80':
|
||||||
|
raise Exception("Unable to parse binary log files at this time, will be added soon")
|
||||||
|
|
||||||
lineNumber = lineNumber + 1
|
lineNumber = lineNumber + 1
|
||||||
numBytes += len(line) + 1
|
numBytes += len(line) + 1
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue