From: Paul Brossier Date: Mon, 15 Apr 2013 22:34:01 +0000 (-0500) Subject: timeside/analyzer/dc.py: use AnalyzerResult X-Git-Tag: 0.5.0~115^2~9 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9d32f8cbd8da4983dbfa4acb9ec1e0c0346537d9;p=timeside.git timeside/analyzer/dc.py: use AnalyzerResult --- 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])