Exemplo n.º 1
0
 def get(self):
     result = []
     for ch in self.psuChannels:
         result.append(
             DataPassthru(time_now_formatted(), self.displayName+str(ch),
                          uniform(1, 2)))
     return result
Exemplo n.º 2
0
 def get(self):
     result = []
     for ch in self.psuChannels:
         curr = self.psu.ChCurrent(ch)
         result.append(
             DataPassthru(time_now_formatted(), self.displayName+str(ch),
                          curr[2]))
     return result
Exemplo n.º 3
0
    def run(self):
        self.initial_sampling()

        while not self.stop_event.wait(self.interval):
            therm = self.get()
            logger.debug('{} readout: {}'.format(self.displayName, therm))

            recent_mean = mean(self.sample)
            logger.debug('{} recent mean: {}'.format(self.displayName,
                                                     recent_mean))
            if abs(therm - recent_mean) > self.rejectThresh:
                logger.debug(
                    '{} readout {} rejected, with recent mean {}'.format(
                        self.displayName, therm, recent_mean))
            else:
                self.sample.append(therm)
                msg = DataPassthru(time_now_formatted(), self.displayName,
                                   therm)
                self.queue.put(msg)
Exemplo n.º 4
0
 def get(self):
     return DataPassthru(time_now_formatted(), self.chName, uniform(1, 10))
Exemplo n.º 5
0
 def alarm(self):
     self.queue.put(
         DataPassthru(time_now_formatted(), self.displayName, 'WATER'))
Exemplo n.º 6
0
 def get(self):
     therm = super().get()
     return DataPassthru(time_now_formatted(), self.displayName, therm)
Exemplo n.º 7
0
 def run(self):
     while not self.stop_event.wait(self.interval):
         therm = self.get()
         logger.debug('{} readout: {}'.format(self.displayName, therm))
         msg = DataPassthru(time_now_formatted(), self.displayName, therm)
         self.queue.put(msg)