def __init__(self, name, dataPacketType, docString=None, customFileDialogName=None): """ """ self.name = name self.value = dict() self.seqRange = None self.docString = docString self.customFileDialogName = customFileDialogName # Constants, not written to disk self.dataPacketType = dataPacketType # Note: We add the largest possible set of attributes this node can have from # its datapacket and all the datapacket's children types allPossibleFileDescriptorNames = set() for tipe in self.allPossibleOutputTypes(): for fdName in depends_data_packet.filenameDictForDataPacketType( tipe): allPossibleFileDescriptorNames.add(fdName) for fdName in allPossibleFileDescriptorNames: self.value[fdName] = "" self.seqRange = None
def __init__(self, output=None, dagNode=None, dag=None, parent=None, tighter=True): """ """ QtGui.QWidget.__init__(self, parent) self.dag = dag self.dagNode = dagNode self.output = output self.subGroups = dict() self.currentSubGroup = None # Make all possible widget collections for outputType in self.output.allPossibleOutputTypes(): subGroup = QtGui.QGroupBox( "%s (Type: %s)" % (output.name, outputType.__name__[len("DataPacket"):])) subLayout = QtGui.QVBoxLayout() subOutputs = depends_data_packet.filenameDictForDataPacketType( outputType) i = 0 for subOutputName in subOutputs: newThing = GeneralEdit( label=subOutputName, tighter=True, isFileType=True if i == len(subOutputs) - 1 else False, toolTip=self.output.docString, customFileDialogName=self.output.customFileDialogName, parent=subGroup) i += 1 newThing.setValue( dagNode.outputValue(output.name, subOutputName, variableSubstitution=False)) newThing.setRange( dagNode.outputRange(output.name, variableSubstitution=False)) newThing.valueChanged.connect(self.valueChangedStub) newThing.rangeChanged.connect(self.rangeChangedStub) subLayout.addWidget(newThing) subGroup.setLayout(subLayout) self.subGroups[outputType] = subGroup # Ask the DAG what's really going through this node and set the group accordingly outputType = self.dag.nodeOutputType(self.dagNode, self.output) self.currentSubGroup = self.subGroups[outputType] self.outputLayout = QtGui.QVBoxLayout() self.outputLayout.addWidget(self.currentSubGroup) parent.setLayout(self.outputLayout)
def __init__(self, name, dataPacketType, docString=None, customFileDialogName=None): """ """ self.name = name self.value = dict() self.seqRange = None self.docString = docString self.customFileDialogName = customFileDialogName # Constants, not written to disk self.dataPacketType = dataPacketType # Note: We add the largest possible set of attributes this node can have from # its datapacket and all the datapacket's children types allPossibleFileDescriptorNames = set() for tipe in self.allPossibleOutputTypes(): for fdName in depends_data_packet.filenameDictForDataPacketType(tipe): allPossibleFileDescriptorNames.add(fdName) for fdName in allPossibleFileDescriptorNames: self.value[fdName] = "" self.seqRange = None
def __init__(self, output=None, dagNode=None, dag=None, parent=None, tighter=True): """ """ QtGui.QWidget.__init__(self, parent) self.dag = dag self.dagNode = dagNode self.output = output self.subGroups = dict() self.currentSubGroup = None # Make all possible widget collections for outputType in self.output.allPossibleOutputTypes(): subGroup = QtGui.QGroupBox("%s (Type: %s)" % (output.name, outputType.__name__[len("DataPacket") :])) subLayout = QtGui.QVBoxLayout() subOutputs = depends_data_packet.filenameDictForDataPacketType(outputType) i = 0 for subOutputName in subOutputs: newThing = GeneralEdit( label=subOutputName, tighter=True, isFileType=True if i == len(subOutputs) - 1 else False, toolTip=self.output.docString, customFileDialogName=self.output.customFileDialogName, parent=subGroup, ) i += 1 newThing.setValue(dagNode.outputValue(output.name, subOutputName, variableSubstitution=False)) newThing.setRange(dagNode.outputRange(output.name, variableSubstitution=False)) newThing.valueChanged.connect(self.valueChangedStub) newThing.rangeChanged.connect(self.rangeChangedStub) subLayout.addWidget(newThing) subGroup.setLayout(subLayout) self.subGroups[outputType] = subGroup # Ask the DAG what's really going through this node and set the group accordingly outputType = self.dag.nodeOutputType(self.dagNode, self.output) self.currentSubGroup = self.subGroups[outputType] self.outputLayout = QtGui.QVBoxLayout() self.outputLayout.addWidget(self.currentSubGroup) parent.setLayout(self.outputLayout)