From 179d854a26f85548eea022c9105cd2f92a5711a6 Mon Sep 17 00:00:00 2001 From: Aaron Curtis Date: Tue, 8 Jul 2014 10:49:42 -1000 Subject: [PATCH] LogAnalyzer: Update to include the new "format" argument, and fix scoping on two new tests. --- Tools/LogAnalyzer/DataflashLog.py | 4 ++-- Tools/LogAnalyzer/LogAnalyzer.py | 2 +- Tools/LogAnalyzer/tests/TestAutotune.py | 2 +- Tools/LogAnalyzer/tests/TestBalanceTwist.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tools/LogAnalyzer/DataflashLog.py b/Tools/LogAnalyzer/DataflashLog.py index 07dcb20e71..851d4c04c5 100644 --- a/Tools/LogAnalyzer/DataflashLog.py +++ b/Tools/LogAnalyzer/DataflashLog.py @@ -393,7 +393,7 @@ class DataflashLog(object): floatTypes = "fcCeEL" charTypes = "nNZ" - def __init__(self, logfile=None, ignoreBadlines=False): + def __init__(self, logfile=None, format="auto", ignoreBadlines=False): self.filename = None self.vehicleType = "" # ArduCopter, ArduPlane, ArduRover, etc, verbatim as given by header @@ -414,7 +414,7 @@ class DataflashLog(object): self.skippedLines = 0 if logfile: - self.read(logfile, ignoreBadlines) + self.read(logfile, format, ignoreBadlines) def getCopterType(self): '''returns quad/hex/octo/tradheli if this is a copter log''' diff --git a/Tools/LogAnalyzer/LogAnalyzer.py b/Tools/LogAnalyzer/LogAnalyzer.py index 5616c6a73c..c99b49d5dd 100755 --- a/Tools/LogAnalyzer/LogAnalyzer.py +++ b/Tools/LogAnalyzer/LogAnalyzer.py @@ -222,7 +222,7 @@ def main(): # load the log startTime = time.time() - logdata = DataflashLog.DataflashLog(args.logfile.name, ignoreBadlines=args.skip_bad) # read log + logdata = DataflashLog.DataflashLog(args.logfile.name, format='auto', ignoreBadlines=args.skip_bad) # read log endTime = time.time() if args.profile: print "Log file read time: %.2f seconds" % (endTime-startTime) diff --git a/Tools/LogAnalyzer/tests/TestAutotune.py b/Tools/LogAnalyzer/tests/TestAutotune.py index 4a4d6cebee..a268fe2442 100644 --- a/Tools/LogAnalyzer/tests/TestAutotune.py +++ b/Tools/LogAnalyzer/tests/TestAutotune.py @@ -6,7 +6,7 @@ class TestAutotune(Test): '''test for autotune success (copter only)''' def __init__(self): -# Test.__init__(self) + Test.__init__(self) self.name = "Autotune" def run(self, logdata, verbose): diff --git a/Tools/LogAnalyzer/tests/TestBalanceTwist.py b/Tools/LogAnalyzer/tests/TestBalanceTwist.py index 376dd15dcf..b175ef21a1 100644 --- a/Tools/LogAnalyzer/tests/TestBalanceTwist.py +++ b/Tools/LogAnalyzer/tests/TestBalanceTwist.py @@ -6,8 +6,8 @@ class TestBalanceTwist(Test): '''test for badly unbalanced copter, including yaw twist''' def __init__(self): + Test.__init__(self) self.name = "Balance/Twist" - self.enable = False # TEMP def run(self, logdata, verbose): self.result = TestResult()