From 9d32f8cbd8da4983dbfa4acb9ec1e0c0346537d9 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 15 Apr 2013 17:34:01 -0500 Subject: [PATCH] timeside/analyzer/dc.py: use AnalyzerResult --- timeside/analyzer/dc.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/timeside/analyzer/dc.py b/timeside/analyzer/dc.py index 9d47787..9c25c8b 100644 --- a/timeside/analyzer/dc.py +++ b/timeside/analyzer/dc.py @@ -35,25 +35,19 @@ class MeanDCShift(Processor): @staticmethod @interfacedoc def id(): - return "dc" + return "dc_analyzer" @staticmethod @interfacedoc def name(): - return "Mean DC shift" - - @staticmethod - @interfacedoc - def unit(): - return "%" - - def __str__(self): - return "%s %s" % (str(self.value), unit()) + return "Mean DC shift analyzer" def process(self, frames, eod=False): if frames.size: self.values = numpy.append(self.values, numpy.mean(frames)) return frames, eod - def result(self): - return numpy.round(100*numpy.mean(self.values),3) + def results(self): + result = AnalyzerResult(id = "mean_dc_shift", name = "Mean DC shift", unit = "%") + result.value = numpy.round(100*numpy.mean(self.values),3) + return AnalyzerResultContainer([result]) -- 2.39.5