def create_new_input(self, type_, label, widget_type='', widget_name='', widget_pos='under', pos=-1): """Creates and adds a new input. Handy for subclasses.""" Debugger.debug('create_new_input called with widget pos:', widget_pos) pi = PortInstance(self, 'input', type_, label, widget_type=widget_type, widget_name=widget_name, widget_pos=widget_pos) if pos == -1: self.inputs.append(pi) else: if pos == -1: self.inputs.insert(0, pi) else: self.inputs.insert(pos, pi) if self.scene(): self.add_input_to_scene(pi) if not self.initializing: self.update_shape()
def create_new_input(self, type_, label, widget_type='', widget_name='', widget_pos='under', pos=-1): # GlobalStorage.debug('creating new input ---- type:', widget_type, 'label:', label, 'widget pos:', widget_pos) GlobalStorage.debug('create_new_input called with widget pos:', widget_pos) pi = PortInstance(self, 'input', type_, label, widget_type=widget_type, widget_name=widget_name, widget_pos=widget_pos) if pos == -1: self.inputs.append(pi) else: if pos == -1: self.inputs.insert(0, pi) else: self.inputs.insert(pos, pi) if self.scene(): self.add_input_to_scene(pi) if not self.initializing: self.update_shape()
def create_new_output(self, type_, label, pos=-1): """Creates and adds a new output. Handy for subclasses.""" pi = PortInstance(self, 'output', type_, label) if pos == -1: self.outputs.append(pi) else: if pos == -1: self.outputs.insert(0, pi) else: self.outputs.insert(pos, pi) if self.scene(): self.add_output_to_scene(pi) if not self.initializing: self.update_shape()
def create_new_output(self, type_, label, pos=-1): # GlobalStorage.debug('creating new output in', self.parent_node.title) pi = PortInstance(self, 'output', type_, label) if pos == -1: self.outputs.append(pi) else: if pos == -1: self.outputs.insert(0, pi) else: self.outputs.insert(pos, pi) if self.scene(): self.add_output_to_scene(pi) if not self.initializing: self.update_shape()
def connect_ports(self, output_port: PortInstance, input_port: PortInstance): output_port.connected_port_instances.append(input_port) input_port.connected_port_instances.append(output_port) if input_port.type_ == 'data': input_port.update()
def create_new_output_from_config(self, output_config=None): """Called only at NI creation.""" pi = PortInstance(self, 'output', configuration=output_config) self.outputs.append(pi)
def create_new_input_from_config(self, input_config): """Called only at NI creation.""" pi = PortInstance(self, 'input', configuration=input_config) self.inputs.append(pi)
def create_new_output_from_config(self, output_config=None): pi = PortInstance(self, 'output', configuration=output_config) self.outputs.append(pi)
def create_new_input_from_config(self, input_config): pi = PortInstance(self, 'input', configuration=input_config) self.inputs.append(pi)