irrad_control/irrad_server.py
def send_temp(self):
        """Sends temp data from dedicated thread"""

        # Needs to be specified within this func since its run on dedicated thread
        temp_pub = self.context.socket(zmq.PUB)
        temp_pub.set_hwm(10)  # drop data if too slow
        temp_pub.bind(self._tcp_addr(self.setup['port']['temp']))

        # Send data als long as specified
        while not self.stop_send_temp.is_set():
            # Read raw temp data
            raw_temp = self.temp_sens.get_temp(sorted(self.temp_setup.keys()))

            _data = dict([(self.temp_setup[sens], raw_temp[sens]) for sens in raw_temp])

            # Add meta data
            _meta = {'timestamp': time.time(), 'name': self.server, 'type': 'temp'}

            # Send
            temp_pub.send_json({'meta': _meta, 'data': _data})
Sends temp data from dedicated thread
Sends temp data from dedicated thread
Sends temp data from dedicated thread
def send_temp(self):
        temp_pub = self.context.socket(zmq.PUB)
        temp_pub.set_hwm(10)  
        temp_pub.bind(self._tcp_addr(self.setup['port']['temp']))
        while not self.stop_send_temp.is_set():
            raw_temp = self.temp_sens.get_temp(sorted(self.temp_setup.keys()))
            _data = dict([(self.temp_setup[sens], raw_temp[sens]) for sens in raw_temp])
            _meta = {'timestamp': time.time(), 'name': self.server, 'type': 'temp'}
            temp_pub.send_json({'meta': _meta, 'data': _data})
def send_temp ( self ) : temp_pub = self . context . socket ( zmq . PUB ) temp_pub . set_hwm ( 10 ) temp_pub . bind ( self . _tcp_addr ( self . setup [ 'port' ] [ 'temp' ] ) ) while not self . stop_send_temp . is_set ( ) : raw_temp = self . temp_sens . get_temp ( sorted ( self . temp_setup . keys ( ) ) ) _data = dict ( [ ( self . temp_setup [ sens ] , raw_temp [ sens ] ) for sens in raw_temp ] ) _meta = { 'timestamp' : time . time ( ) , 'name' : self . server , 'type' : 'temp' } temp_pub . send_json ( { 'meta' : _meta , 'data' : _data } )
Sends temp data from dedicated thread
Sends temp data from dedicated thread
"""Sends temp data from dedicated thread""" # Needs to be specified within this func since its run on dedicated thread # drop data if too slow # Send data als long as specified # Read raw temp data # Add meta data # Send
self