LogAnalyser: adapt to new APM:* vehicle names

This commit is contained in:
Holger Steinhaus 2015-05-05 20:16:07 +02:00 committed by Randy Mackay
parent 46c3c26065
commit 1cdc5f7c7f

View File

@ -501,7 +501,7 @@ class DataflashLog(object):
else: else:
self.messages[lineNumber] = e.Message self.messages[lineNumber] = e.Message
elif e.NAME == "MODE": elif e.NAME == "MODE":
if self.vehicleType == "ArduCopter": if self.vehicleType in ["ArduCopter"]:
try: try:
modes = {0:'STABILIZE', modes = {0:'STABILIZE',
1:'ACRO', 1:'ACRO',
@ -521,7 +521,7 @@ class DataflashLog(object):
self.modeChanges[lineNumber] = (modes[int(e.Mode)], e.ThrCrs) self.modeChanges[lineNumber] = (modes[int(e.Mode)], e.ThrCrs)
except: except:
self.modeChanges[lineNumber] = (e.Mode, e.ThrCrs) self.modeChanges[lineNumber] = (e.Mode, e.ThrCrs)
elif self.vehicleType == "ArduPlane" or self.vehicleType == "ArduRover": elif self.vehicleType in ["ArduPlane", "APM:Plane", "ArduRover", "APM:Rover", "APM:Copter"]:
self.modeChanges[lineNumber] = (e.Mode, e.ModeNum) self.modeChanges[lineNumber] = (e.Mode, e.ModeNum)
else: else:
raise Exception("Unknown log type for MODE line {} {}".format(self.vehicleType, repr(e))) raise Exception("Unknown log type for MODE line {} {}".format(self.vehicleType, repr(e)))