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)
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)
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