mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-19 05:20:06 +00:00
fix dumpLog.py
This commit is contained in:
parent
c82131d16e
commit
cfc07565ac
@ -31,15 +31,20 @@ def readLogFile(filename, verbose = True):
|
||||
print('Columns:'),
|
||||
print(ncols)
|
||||
|
||||
# Read data
|
||||
wholeFile = f.read()
|
||||
# split by alignment word
|
||||
chunks = wholeFile.split(b'\xaa\xbb')
|
||||
lenChunk = sz
|
||||
log = list()
|
||||
chunkIndex = 0
|
||||
while (lenChunk):
|
||||
check = f.read(2)
|
||||
lenChunk = 0
|
||||
if (check == b'\xaa\xbb'):
|
||||
mychunk = f.read(sz)
|
||||
lenChunk = len(mychunk)
|
||||
chunks = [mychunk]
|
||||
if verbose:
|
||||
print("num chunks:")
|
||||
print(len(chunks))
|
||||
chunkIndex = 0
|
||||
|
||||
for chunk in chunks:
|
||||
print("len(chunk)=",len(chunk)," sz = ", sz)
|
||||
if len(chunk) == sz:
|
||||
@ -53,7 +58,8 @@ def readLogFile(filename, verbose = True):
|
||||
print(" ",keys[i],"=",values[i])
|
||||
|
||||
log.append(record)
|
||||
|
||||
else:
|
||||
print("Error, expected aabb terminal")
|
||||
return log
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user