LogAnalyzer: turn times from strings to ints before doing maths

This commit is contained in:
Peter Barker 2015-10-13 21:01:14 +11:00 committed by Randy Mackay
parent 3479a0e209
commit f49aedb639

View File

@ -482,8 +482,8 @@ class DataflashLog(object):
if i in self.channels["GPS"]:
timeLabel = i
break
firstTimeGPS = self.channels["GPS"][timeLabel].listData[0][1]
lastTimeGPS = self.channels["GPS"][timeLabel].listData[-1][1]
firstTimeGPS = int(self.channels["GPS"][timeLabel].listData[0][1])
lastTimeGPS = int(self.channels["GPS"][timeLabel].listData[-1][1])
if timeLabel == 'TimeUS':
firstTimeGPS /= 1000
lastTimeGPS /= 1000
@ -536,7 +536,7 @@ class DataflashLog(object):
elif self.vehicleType in ["ArduPlane", "APM:Plane", "ArduRover", "APM:Rover", "APM:Copter"]:
self.modeChanges[lineNumber] = (e.Mode, e.ModeNum)
else:
raise Exception("Unknown log type for MODE line {} {}".format(self.vehicleType, repr(e)))
raise Exception("Unknown log type for MODE line vehicletype=({}) linw=({})".format(self.vehicleType, repr(e)))
# anything else must be the log data
else:
groupName = e.NAME