Пример #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
Пример #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
Пример #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)
Пример #4
0
 def get(self):
     return DataPassthru(time_now_formatted(), self.chName, uniform(1, 10))
Пример #5
0
 def alarm(self):
     self.queue.put(
         DataPassthru(time_now_formatted(), self.displayName, 'WATER'))
Пример #6
0
 def get(self):
     therm = super().get()
     return DataPassthru(time_now_formatted(), self.displayName, therm)
Пример #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)