# Initial code by Andrew Chapman (chapman@skymount.com), 16th Jan 2014
#
# TODO: log reading needs to be much more robust, only compatible with AC3.0.1-AC3.1 logs at this point, try to be compatible at least back to AC2.9.1, and APM:Plane too (skipping copter-only tests)
# TODO: rethink data storage, dictionaries are good for specific line lookups, but we don't end up doing a lot of that
importpprint# temp
importcollections
importos
@ -32,9 +29,12 @@ class Format:
@@ -32,9 +29,12 @@ class Format:
classChannel:
'''storage for a single stream of data, i.e. all GPS.RelAlt values'''
# TODO: store data as a curve so we can more easily interpolate and sample the slope
# TODO: rethink data storage, but do regression test suite first before refactoring it
# TODO: store data as a curve so we can more easily interpolate and sample the slope?
dictData=None# dict of linenum->value # store dupe data in dict and list for now, until we decide which is the better way to go
listData=None# list of (linenum,value)
def__init__(self):
self.dictData={}
self.listData=[]
@ -73,6 +73,28 @@ class Channel:
@@ -73,6 +73,28 @@ class Channel:
errorMsg="Error on line %d of log file: %s, %s line's value count (%d) not matching FMT specification (%d)"%(lineNumber,self.filename,groupName,len(tokens2)-1,len(self.formats[groupName].labels))
@ -292,7 +306,7 @@ class DataflashLog:
@@ -292,7 +306,7 @@ class DataflashLog:
channel.listData.append((lineNumber,value))
except:
print"Error parsing line %d of log file %s"%(lineNumber,self.filename)
raise
returnFalse
# gather some general stats about the log
self.lineCount=lineNumber
@ -306,3 +320,7 @@ class DataflashLog:
@@ -306,3 +320,7 @@ class DataflashLog:
@ -17,12 +17,9 @@ class TestPerformance(Test):
@@ -17,12 +17,9 @@ class TestPerformance(Test):
return
# NOTE: we'll ignore MaxT altogether for now, it seems there are quite regularly one or two high values in there, even ignoring the ones expected after arm/disarm events
# gather info on arm/disarm lines, we will ignore the MaxT data from the first line found after each of these