def setParameters(self, operation: OperationPlugin): if operation: # Create a new Parameter from the emitted operation, # Then wire up its connections for use in a parameter tree. parameter = operation.as_parameter() group = GroupParameter(name='Selected Operation', children=parameter) operation.wireup_parameter(group) # Add the Parameter to the parameter tree group.blockSignals(True) for child in group.children(): child.blockSignals(True) self.operationeditor.setParameters(group, showTop=False) threads.invoke_as_event(self._unblock_group, group) else: self.operationeditor.clear()
def setParameters(self, operation: OperationPlugin): if operation: # Create a new Parameter from the emitted operation, # Then wire up its connections for use in a parameter tree. parameter = operation.as_parameter() group = GroupParameter(name='Selected Operation', children=parameter) operation.wireup_parameter(group) # Add the Parameter to the parameter tree group.blockSignals(True) for child in group.children(): child.blockSignals(True) self.operationeditor.setParameters(group, showTop=False) QApplication.processEvents() group.blockSignals(False) for child in group.children(): child.blockSignals(False)
def setParameters(self, operation: OperationPlugin): parameter = operation.as_parameter() group = GroupParameter(name='Selected Operation', children=parameter) operation.wireup_parameter(group) for child, parameter in zip(group.children(), parameter): # wireup signals to update the workflow if parameter.get('fixable'): child.sigFixToggled.connect( partial(self.setFixed, operation, child.name)) child.sigValueChanged.connect( partial(self.setValue, operation, child.name)) group.blockSignals(True) for child in group.children(): child.blockSignals(True) self.operationeditor.setParameters(group, showTop=False) QApplication.processEvents() group.blockSignals(False) for child in group.children(): child.blockSignals(False)
def insert(self, doctype: str, document, uid: str, groups: dict): if doctype == "start": for group in groups.values(): group.clearChildren() try: new_children = MetadataView._from_dict(document, self.excludedkeys) except Exception as ex: msg.logError(ex) print(f"failed to make children for {doctype}") else: # TODO: add responsive design to uid display group = groups[doctype] group.addChildren( [ GroupParameter( name=uid[:6], value=None, type=None, children=new_children, expanded=False, readonly=True ) ] )