Scheme Node (node)

Scheme Node

class orangecanvas.scheme.node.SchemeNode(description, title=None, position=None, properties=None, parent=None)[source]

Bases: PyQt5.QtCore.QObject

A node in a Scheme.

Parameters:
  • description (WidgetDescription) – Node description instance.
  • title (str, optional) – Node title string (if None description.name is used).
  • position (tuple) – (x, y) tuple of floats for node position in a visual display.
  • properties (dict) – Additional extra instance properties (settings, widget geometry, …)
  • parent (QObject) – Parent object.
title_changed(title)

The title of the node has changed

position_changed((x, y))

Position of the node in the scheme has changed

progress_changed(progress)

Node’s progress value has changed.

processing_state_changed(state)

Node’s processing state has changed.

class State[source]

Bases: enum.IntEnum

A workflow node’s runtime state flags

NoState = 0

The node has no state.

Running = 1

The node is running (i.e. executing a task).

Pending = 2
  • An input link is added or removed
  • An input link is marked as pending

It is set/cleared by the execution manager when the inputs are propagated to the node.

Type:The node has invalidated inputs. This flag is set when
Invalidated = 4

The node has invalidated outputs. Execution manager should not propagate this node’s existing outputs to dependent nodes until this flag is cleared.

NotReady = 8

The node is in a state where it does not accept new signals. The execution manager should not propagate inputs to this node until this flag is cleared.

input_channels()[source]

Return a list of input channels (InputSignal) for the node.

output_channels()[source]

Return a list of output channels (OutputSignal) for the node.

input_channel(name)[source]

Return the input channel matching name. Raise a ValueError if not found.

output_channel(name)[source]

Return the output channel matching name. Raise an ValueError if not found.

set_title(title)[source]

Set the node title.

title

The node title.

set_position(pos)[source]

Set the position ((x, y) tuple) of the node.

position

(x, y) tuple containing the position of the node in the scheme.

set_progress(value)[source]

Set the progress value.

progress

The current progress value. -1 if progress is not set.

set_processing_state(state)[source]

Set the node processing state.

processing_state

The node processing state, 0 for not processing, 1 the node is busy.

status_message_changed

The node’s status tip has changes

set_status_message(text)[source]

Set a short status message.

status_message()[source]

A short status message summarizing the current node state.

state_message_changed

The node’s state message has changed

set_state_message(message)[source]

Set a message to be displayed by a scheme view for this node.

clear_state_message(message_id)[source]

Clear (remove) a message with message_id.

state_message_changed signal will be emitted with a empty message for the message_id.

state_message(message_id)[source]

Return a message with message_id or None if a message with that id does not exist.

state_messages()[source]

Return a list of all state messages.

set_state(state)[source]

Set the node runtime state flags

Parameters:state (SchemeNode.State) –
state()[source]

Return the node runtime state flags.

set_state_flags(flags, on)[source]

Set the specified state flags on/off.

Parameters:
test_state_flags(flag)[source]

Return True/False if the runtime state flag is set.

Parameters:flag (SchemeNode.State) –
Returns:val
Return type:bool
class SchemeNode.State[source]

A workflow node’s runtime state flags

Invalidated = 4

The node has invalidated outputs. Execution manager should not propagate this node’s existing outputs to dependent nodes until this flag is cleared.

NoState = 0

The node has no state.

NotReady = 8

The node is in a state where it does not accept new signals. The execution manager should not propagate inputs to this node until this flag is cleared.

Pending = 2
  • An input link is added or removed
  • An input link is marked as pending

It is set/cleared by the execution manager when the inputs are propagated to the node.

Type:The node has invalidated inputs. This flag is set when
Running = 1

The node is running (i.e. executing a task).