def get(self): result = [] for ch in self.psuChannels: result.append( DataPassthru(time_now_formatted(), self.displayName+str(ch), uniform(1, 2))) return result
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
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)
def get(self): return DataPassthru(time_now_formatted(), self.chName, uniform(1, 10))
def alarm(self): self.queue.put( DataPassthru(time_now_formatted(), self.displayName, 'WATER'))
def get(self): therm = super().get() return DataPassthru(time_now_formatted(), self.displayName, therm)
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)