mirror of https://github.com/ArduPilot/ardupilot
LogAnalyzer: Allow instantiation of DataFlashlog with no input filename, for backward compatibility. My changes make m_dflog=DataFlashlog('/path/to/file.log') work, which seems like the preferable way, but we don't want to break backwards compatibility.
This commit is contained in:
parent
0f5360fefa
commit
406fedf727
|
@ -393,7 +393,7 @@ class DataflashLog(object):
|
|||
floatTypes = "fcCeEL"
|
||||
charTypes = "nNZ"
|
||||
|
||||
def __init__(self, logfile, ignoreBadlines=False):
|
||||
def __init__(self, logfile=None, ignoreBadlines=False):
|
||||
self.filename = None
|
||||
|
||||
self.vehicleType = "" # ArduCopter, ArduPlane, ArduRover, etc, verbatim as given by header
|
||||
|
@ -413,7 +413,8 @@ class DataflashLog(object):
|
|||
self.lineCount = 0
|
||||
self.skippedLines = 0
|
||||
|
||||
self.read(logfile, ignoreBadlines)
|
||||
if logfile:
|
||||
self.read(logfile, ignoreBadlines)
|
||||
|
||||
def getCopterType(self):
|
||||
'''returns quad/hex/octo/tradheli if this is a copter log'''
|
||||
|
|
Loading…
Reference in New Issue