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:
Aaron Curtis 2014-07-08 10:06:15 -10:00 committed by Craig Elder
parent 0f5360fefa
commit 406fedf727
1 changed files with 3 additions and 2 deletions

View File

@ -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'''