From f49aedb6394e4deabe1a6b45e938de4d713e59d4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 13 Oct 2015 21:01:14 +1100 Subject: [PATCH] LogAnalyzer: turn times from strings to ints before doing maths --- Tools/LogAnalyzer/DataflashLog.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/LogAnalyzer/DataflashLog.py b/Tools/LogAnalyzer/DataflashLog.py index 3ef3ebfaea..1ebf8d93a6 100644 --- a/Tools/LogAnalyzer/DataflashLog.py +++ b/Tools/LogAnalyzer/DataflashLog.py @@ -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