flowchart.Flowchart¶
-
class
pyqtgraph.flowchart.Flowchart(terminals=None, name=None, filePath=None, library=None)[source]¶ -
__init__(terminals=None, name=None, filePath=None, library=None)[source]¶ Arguments:
name
The name of this specific node instance. It can be any string, but must be unique within a flowchart. Usually, we simply let the flowchart decide on a name when calling Flowchart.addNode(…)
terminals
Dict-of-dicts specifying the terminals present on this Node. Terminal specifications look like:
'inputTerminalName': {'io': 'in'} 'outputTerminalName': {'io': 'out'}
There are a number of optional parameters for terminals: multi, pos, renamable, removable, multiable, bypass. See the Terminal class for more information.
allowAddInput
bool; whether the user is allowed to add inputs by the context menu.
allowAddOutput
bool; whether the user is allowed to add outputs by the context menu.
allowRemove
bool; whether the user is allowed to remove this node by the context menu.
-
addNode(node, name, pos=None)[source]¶ Add an existing Node to this flowchart.
See also: createNode()
-
addTerminal(name, **opts)[source]¶ Add a new terminal to this Node with the given name. Extra keyword arguments are passed to Terminal.__init__.
Causes sigTerminalAdded to be emitted.
-
chartGraphicsItem()[source]¶ Return the graphicsItem that displays the internal nodes and connections of this flowchart.
Note that the similar method graphicsItem() is inherited from Node and returns the external graphical representation of this flowchart.
-
internalTerminal(term)[source]¶ If the terminal belongs to the external Node, return the corresponding internal terminal
-
nodeOutputChanged(startNode)[source]¶ Triggered when a node’s output values have changed. (NOT called during process()) Propagates new data forward through network.
-
process(**args)[source]¶ Process data through the flowchart, returning the output.
Keyword arguments must be the names of input terminals. The return value is a dict with one key per output terminal.
-
processOrder()[source]¶ Return the order of operations required to process this chart. The order returned should look like [(‘p’, node1), (‘p’, node2), (‘d’, terminal1), …] where each tuple specifies either (p)rocess this node or (d)elete the result from this terminal
-
removeTerminal(name)[source]¶ Remove the specified terminal from this Node. May specify either the terminal’s name or the terminal itself.
Causes sigTerminalRemoved to be emitted.
-
restoreState(state, clear=False)[source]¶ Restore the state of this flowchart from a previous call to saveState().
-
saveFile(fileName=None, startDir=None, suggestedFileName='flowchart.fc')[source]¶ Save this flowchart to a .fc file
-
saveState()[source]¶ Return a serializable data structure representing the current state of this flowchart.
-
setInput(**args)[source]¶ Set the input values of the flowchart. This will automatically propagate the new values throughout the flowchart, (possibly) causing the output to change.
-