def get_child_from_connection_table(self, parent_device_name, port):
     # This is a direct output, let's search for it on the internal intermediate device called 
     # PulseBlasterDirectOutputs
     if parent_device_name == self.device_name:
         device = self.connection_table.find_by_name(self.device_name)
         pseudoclock = device.child_list[device.child_list.keys()[0]] # there should always be one (and only one) child, the Pseudoclock
         clockline = None
         for child_name, child in pseudoclock.child_list.items():
             # store a reference to the internal clockline
             if child.parent_port == 'internal':
                 clockline = child
             # if the port is in use by a clockline, return the clockline
             elif child.parent_port == port:
                 return child
             
         if clockline is not None:
             # There should only be one child of this clock line, the direct outputs
             direct_outputs = clockline.child_list[clockline.child_list.keys()[0]] 
             # look to see if the port is used by a child of the direct outputs
             return DeviceTab.get_child_from_connection_table(self, direct_outputs.name, port)
         else:
             return ''
     else:
         # else it's a child of a DDS, so we can use the default behaviour to find the device
         return DeviceTab.get_child_from_connection_table(self, parent_device_name, port)
    def get_child_from_connection_table(self, parent_device_name, port):
        # This is a direct output, let's search for it on the internal intermediate device called
        # PulseBlasterDirectOutputs
        if parent_device_name == self.device_name:
            device = self.connection_table.find_by_name(self.device_name)
            pseudoclock = device.child_list[device.child_list.keys(
            )[0]]  # there should always be one (and only one) child, the Pseudoclock
            clockline = None
            for child_name, child in pseudoclock.child_list.items():
                # store a reference to the internal clockline
                if child.parent_port == 'internal':
                    clockline = child
                # if the port is in use by a clockline, return the clockline
                elif child.parent_port == port:
                    return child

            if clockline is not None:
                # There should only be one child of this clock line, the direct outputs
                direct_outputs = clockline.child_list[
                    clockline.child_list.keys()[0]]
                # look to see if the port is used by a child of the direct outputs
                return DeviceTab.get_child_from_connection_table(
                    self, direct_outputs.name, port)
            else:
                return ''
        else:
            # else it's a child of a DDS, so we can use the default behaviour to find the device
            return DeviceTab.get_child_from_connection_table(
                self, parent_device_name, port)
Beispiel #3
0
 def __init__(self, *args, **kwargs):
     """You MUST override this method in order to define the device worker.
     You then call this parent method to finish initialization.
     """
     if not hasattr(self, 'device_worker_class'):
         raise LabscriptError(
             'BLACS worker not set for device: {0:s}'.format(self))
     DeviceTab.__init__(self, *args, **kwargs)
Beispiel #4
0
 def get_child_from_connection_table(self, parent_device_name, port):
     # This is a direct output, let's search for it on the internal intermediate device called 
     # RFBlasterDirectOutputs
     if parent_device_name == self.device_name:
         device = self.connection_table.find_by_name(self.device_name)
         pseudoclock = device.child_list[list(device.child_list.keys())[0]] # there should always be one (and only one) child, the Pseudoclock
         clockline = pseudoclock.child_list[list(pseudoclock.child_list.keys())[0]] # there should always be one (and only one) child, the clockline
         direct_outputs = clockline.child_list[list(clockline.child_list.keys())[0]] # There should only be one child of this clock line, the direct outputs
         # look to see if the port is used by a child of the direct outputs
         return DeviceTab.get_child_from_connection_table(self, direct_outputs.name, port)
     else:
         # else it's a child of a DDS, so we can use the default behaviour to find the device
         return DeviceTab.get_child_from_connection_table(self, parent_device_name, port)
Beispiel #5
0
 def get_child_from_connection_table(self, parent_device_name, port):
     # This is a direct output, let's search for it on the internal Pseudoclock
     if parent_device_name == self.device_name:
         device = self.connection_table.find_by_name(self.device_name)
         pseudoclock = device.child_list[list(device.child_list.keys())[0]] # there should always be one (and only one) child, the Pseudoclock
         clockline = None
         for child_name, child in pseudoclock.child_list.items():
             # store a reference to the internal clockline
             if child.parent_port == port:                
                 return DeviceTab.get_child_from_connection_table(self, pseudoclock.name, port)
         
     # If nothing found, Use default implementation
     return DeviceTab.get_child_from_connection_table(self, parent_device_name, port)
 def get_child_from_connection_table(self, parent_device_name, port):
     # This is a direct output, let's search for it on the internal intermediate device called 
     # RFBlasterDirectOutputs
     if parent_device_name == self.device_name:
         device = self.connection_table.find_by_name(self.device_name)
         pseudoclock = device.child_list[device.child_list.keys()[0]] # there should always be one (and only one) child, the Pseudoclock
         clockline = pseudoclock.child_list[pseudoclock.child_list.keys()[0]] # there should always be one (and only one) child, the clockline
         direct_outputs = clockline.child_list[clockline.child_list.keys()[0]] # There should only be one child of this clock line, the direct outputs
         # look to see if the port is used by a child of the direct outputs
         return DeviceTab.get_child_from_connection_table(self, direct_outputs.name, port)
     else:
         # else it's a child of a DDS, so we can use the default behaviour to find the device
         return DeviceTab.get_child_from_connection_table(self, parent_device_name, port)
    def get_child_from_connection_table(self, parent_device_name, port):
        """Finds the attached ClockLines.

        Args:
            parent_device_name (str): name of parent_device
            port (str): port of parent_device

        Returns:
            :class:`~labscript.ClockLine`: PrawnBlaster interal Clocklines
        """

        # Pass down channel name search to the pseudoclocks (so we can find the
        # clocklines)
        if parent_device_name == self.device_name:
            device = self.connection_table.find_by_name(self.device_name)

            for pseudoclock_name, pseudoclock in device.child_list.items():
                for child_name, child in pseudoclock.child_list.items():
                    # store a reference to the internal clockline
                    if child.parent_port == port:
                        return DeviceTab.get_child_from_connection_table(
                            self, pseudoclock.name, port)

        return None
 def __init__(self, *args, **kwargs):
     if not hasattr(self, 'device_worker_class'):
         self.device_worker_class = PulseblasterNoDDSWorker
     DeviceTab.__init__(self, *args, **kwargs)
 def restart(self, *args, **kwargs):
     # Must manually stop the receiving server upon tab restart, otherwise it does
     # not get cleaned up:
     self.image_receiver.shutdown()
     return DeviceTab.restart(self, *args, **kwargs)
 def __init__(self,*args,**kwargs):
     if not hasattr(self,'device_worker_class'):
         self.device_worker_class = PulseblasterNoDDSWorker
     DeviceTab.__init__(self,*args,**kwargs)
 def restore_builtin_save_data(self, data):
     DeviceTab.restore_builtin_save_data(self, data)
     # Override restored settings and show and maximise the outputbox for this tab:
     self.set_terminal_visible(True)
     self._ui.splitter.setSizes([0, 0, 1])
Beispiel #12
0
 def __init__(self,*args,**kwargs):
     if not hasattr(self,'device_worker_class'):
         self.device_worker_class = "naqslab_devices.NovaTechDDS.blacs_worker.NovaTech440AWorker"
     DeviceTab.__init__(self,*args,**kwargs)