Drop outdated report: this should be handled by a frontend.
authorBert Vermeulen <bert@biot.com>
Thu, 14 Nov 2013 20:55:09 +0000 (21:55 +0100)
committerBert Vermeulen <bert@biot.com>
Fri, 15 Nov 2013 21:05:54 +0000 (22:05 +0100)
decoders/lm75/pd.py
decoders/spi/pd.py

index 6bbc5d8765ddca69dc9166129478dbb8bfa9fa36..a41c27be320b38303f1757eeb8333aaa6adc6ce8 100644 (file)
@@ -73,21 +73,11 @@ class Decoder(srd.Decoder):
         self.state = 'IDLE'
         self.reg = 0x00 # Currently selected register
         self.databytes = []
-        self.mintemp = 0
-        self.maxtemp = 0
-        self.avgvalues = []
 
     def start(self):
         # self.out_proto = self.register(srd.OUTPUT_PYTHON)
         self.out_ann = self.register(srd.OUTPUT_ANN)
 
-    def report(self):
-        # TODO: print() or self.put() or return xyz, or... ?
-        avg = sum(self.avgvalues) / len(self.avgvalues)
-        temperatures = (self.mintemp, self.maxtemp, avg)
-        # TODO: Configurable report() output, e.g. for Kelvin.
-        return 'Min/max/avg temperature: %f/%f/%f °C' % temperatures
-
     def putx(self, data):
         # Helper for annotations which span exactly one I2C packet.
         self.put(self.ss, self.es, self.out_ann, data)
@@ -117,13 +107,6 @@ class Decoder(srd.Decoder):
             s = 'Warning: The temperature register is read-only!'
             self.putb([4, [s]])
 
-        # Keep some statistics. Can be output in report(), for example.
-        if celsius < self.mintemp:
-            self.mintemp = celsius
-        if celsius > self.maxtemp:
-            self.maxtemp = celsius
-        self.avgvalues.append(celsius)
-
     def handle_temperature_reg(self, b, s, rw):
         # Common helper for the temperature/T_HYST/T_OS registers.
         if len(self.databytes) == 0:
index 21012c19996031a2dcd001ac5e220f741653d8f7..e00235e2a8bff976654d13484c8a569665ec44db 100644 (file)
@@ -93,7 +93,6 @@ class Decoder(srd.Decoder):
         self.bitcount = 0
         self.mosidata = 0
         self.misodata = 0
-        self.bytesreceived = 0
         self.startsample = -1
         self.samplenum = -1
         self.cs_was_deasserted_during_data_word = 0
@@ -111,9 +110,6 @@ class Decoder(srd.Decoder):
         self.out_bitrate = self.register(srd.OUTPUT_META,
                 meta=(int, 'Bitrate', 'Bitrate during transfers'))
 
-    def report(self):
-        return 'SPI: %d bytes received' % self.bytesreceived
-
     def putpw(self, data):
         self.put(self.startsample, self.samplenum, self.out_proto, data)
 
@@ -169,9 +165,6 @@ class Decoder(srd.Decoder):
         # Reset decoder state.
         self.mosidata = self.misodata = self.bitcount = 0
 
-        # Keep stats for summary.
-        self.bytesreceived += 1
-
     def find_clk_edge(self, miso, mosi, sck, cs):
         if self.have_cs and self.oldcs != cs:
             # Send all CS# pin value changes.