irrad_control/gui/widgets/daq_info_widget.py
def update_raw_data(self, data):
        """Function handling incoming data and updating table widgets"""

        # Extract meta data and actual data
        meta_data, channel_data = data['meta'], data['data']

        # Name of ADC; first raw data will not have data rate
        server, drate = meta_data['name'], 0 if 'data_rate' not in meta_data else meta_data['data_rate']

        # First incoming data sets is displayed and sets timestamp
        if server not in self.refresh_timestamp:
            self.refresh_timestamp[server] = self.refresh_interval[server]

        # Timestamp, data rate and update
        timestamp = meta_data['timestamp']
        refresh_time = timestamp - self.refresh_timestamp[server]

        # Only update widgets if it's time to refresh; if interval is 0, update all the time
        if refresh_time >= self.refresh_interval[server] or self.refresh_interval[server] == 0:
            self.update_drate(server=server, drate=drate)
            self.update_table(server=server, ch_data=channel_data)

            # Update latest value of beam current
            if server in self._beam_current_vals:
                self.beam_current_labels[server].setText('Beam current: {:.2f} nA'.format(self._beam_current_vals[server]))

            # Update refresh timestamp
            self.refresh_timestamp[server] = timestamp
Function handling incoming data and updating table widgets
Function handling incoming data and updating table widgets
Function handling incoming data and updating table widgets
def update_raw_data(self, data):
        meta_data, channel_data = data['meta'], data['data']
        server, drate = meta_data['name'], 0 if 'data_rate' not in meta_data else meta_data['data_rate']
        if server not in self.refresh_timestamp:
            self.refresh_timestamp[server] = self.refresh_interval[server]
        timestamp = meta_data['timestamp']
        refresh_time = timestamp - self.refresh_timestamp[server]
        if refresh_time >= self.refresh_interval[server] or self.refresh_interval[server] == 0:
            self.update_drate(server=server, drate=drate)
            self.update_table(server=server, ch_data=channel_data)
            if server in self._beam_current_vals:
                self.beam_current_labels[server].setText('Beam current: {:.2f} nA'.format(self._beam_current_vals[server]))
            self.refresh_timestamp[server] = timestamp
def update_raw_data ( self , data ) : meta_data , channel_data = data [ 'meta' ] , data [ 'data' ] server , drate = meta_data [ 'name' ] , 0 if 'data_rate' not in meta_data else meta_data [ 'data_rate' ] if server not in self . refresh_timestamp : self . refresh_timestamp [ server ] = self . refresh_interval [ server ] timestamp = meta_data [ 'timestamp' ] refresh_time = timestamp - self . refresh_timestamp [ server ] if refresh_time >= self . refresh_interval [ server ] or self . refresh_interval [ server ] == 0 : self . update_drate ( server = server , drate = drate ) self . update_table ( server = server , ch_data = channel_data ) if server in self . _beam_current_vals : self . beam_current_labels [ server ] . setText ( 'Beam current: {:.2f} nA' . format ( self . _beam_current_vals [ server ] ) ) self . refresh_timestamp [ server ] = timestamp
Function handling incoming data and updating table widgets
Function handling incoming data and updating table widgets
"""Function handling incoming data and updating table widgets""" # Extract meta data and actual data # Name of ADC; first raw data will not have data rate # First incoming data sets is displayed and sets timestamp # Timestamp, data rate and update # Only update widgets if it's time to refresh; if interval is 0, update all the time # Update latest value of beam current # Update refresh timestamp
self
data