maxon.frameworks.graph.Wires

Description

A port connection consists of up to eight independent wires:

  1. The /value/ wire is used to pass data values along the connection.

  2. The /event/ wire is used when events shall flow along the connection.

  3. The /dependency/ wire is only needed for internal connections within evaluation nodes such as core node wrappers.

  4. computed output port needs to have a dependency wire from each input port which is required for its computation.

  5. The /context/ wire connects a port which shall define a context to an input port which introduces that context.

  6. The /hidden/ wire is used mark a connection as hidden.
    What this means exactly is model-specific, for example maxon.frameworks.nodes.NodesGraphModelInterface doesn’t show those connections.
  7. The /inhibit/ wire is used to temporarily disable the other wires.
    When this wire is present, the other wires should be considered as non-existing.
  8. The /slink/ wire is a marker which is used for node-specific purposes, where the source port of the connection
    determines the meaning.
    For example it connects the output port of a context parameter node to the input port which introduces the context.
  9. The /tlink/ wire is a marker which is used for node-specific purposes, where the target port of the connection determines the meaning.

In most cases you only need a combination of a value, event and dependency wire.

The Wires class has the members #value, #event, #dependency, #context, #hidden, #inhibit, #slink, #tlink to store information about these wires for a connection.
Each of them has the enumeration type maxon.frameworks.graph.WIRE_MODE with the following possible values:
  • WIRE_MODE.NONE means that there is no such wire in the connection.
    This does not necessarily mean that there is no such wire at all because a wire might be “inherited” from a base node system, or there may be an “implicit wire” due to an enclosing connection.
  • WIRE_MODE.MIN, WIRE_MODE.NORMAL and WIRE_MODE.MAX indicate that a wire exists.
    The values are priorities, so whenever an ambiguity between multiple wires has to be resolved, the wires with highest priority are taken.
The wires of a connection can also be accessed by index, see VALUE, EVENT, DEPENDENCY, CONTEXT, HIDDEN, INHIBIT, SLINK, TLINK and #operator[].
For a loop over the wires you have to use COUNT as upper bound:
>>> w = Wires()
>>> for i in range(Wires.COUNT):
...    print(w[i])

>>> w.value = WIRE_MODE.NONE
# Same as line above
>>> w[Wires.VALUE] = WIRE_MODE::NONE
A Wires object can also be used as a mask to test another Wires object.
Wires masks use the mask values of WIRE_MODE(WIRE_MODE.NONE, WIRE_MODE.ALL, WIRE_MODE.IMPLICIT, WIRE_MODE.ALL_INCLUDING_IMPLICIT, WIRE_MODE.INHERIT, WIRE_MODE.FULL_MASK).
Testing against a mask is done by the bitwise operators && and ||.

Inheritance diagram

Inheritance

Parent Class:

Attributes

maxon.frameworks.graph.Wires.CONTEXT

The index to address the context part, used in #operator[] and Wires(Int,WIRE_MODE).

maxon.frameworks.graph.Wires.COUNT

The number of wires (currently 8).

maxon.frameworks.graph.Wires.DEPENDENCY

The index to address the dependency part, used in #operator[] and Wires(Int,WIRE_MODE).

maxon.frameworks.graph.Wires.EVENT

The index to address the event part, used in #operator[] and Wires(Int,WIRE_MODE).

maxon.frameworks.graph.Wires.HIDDEN

The index to address the hidden part, used in #operator[] and Wires(Int,WIRE_MODE).

maxon.frameworks.graph.Wires.INHIBIT

The index to address the inhibit part, used in #operator[] and Wires(Int,WIRE_MODE).

maxon.frameworks.graph.Wires.NONE

Constant indicating no wires at all.

maxon.frameworks.graph.Wires.SLINK

The index to address the slink part, used in #operator[] and Wires(Int,WIRE_MODE).

maxon.frameworks.graph.Wires.TLINK

The index to address the tlink part, used in #operator[] and Wires(Int,WIRE_MODE).

maxon.frameworks.graph.Wires.VALUE

The index to address the value part, used in #operator[] and Wires(Int,WIRE_MODE).

maxon.frameworks.graph.Wires.context

The mode for the context part of the connection.

maxon.frameworks.graph.Wires.dependency

The mode for the dependency part of the connection.

maxon.frameworks.graph.Wires.event

The mode for the event part of the connection.

maxon.frameworks.graph.Wires.hidden

The mode for the hidden part of the connection.

maxon.frameworks.graph.Wires.inhibit

The mode for the inhibit part of the connection.

maxon.frameworks.graph.Wires.slink

The mode for the slink part of the connection.

maxon.frameworks.graph.Wires.tlink

The mode for the tlink part of the connection.

maxon.frameworks.graph.Wires.value

The mode for the value part of the connection.

Methods Signature

All([mode])

Returns a Wires value where all wire modes are set to the given mode.

Combine(other)

Returns the parallel combination of this Wires object and other.

Concat(other)

Returns the concatenation of this maxon.frameworks.graph.Wires object and other.

EqualWires(other)

Returns the wire-wise comparison of this and other.

GetHashCode()

Returns the hash code of this maxon.frameworks.graph.Wires.

MaskByPriority(priorityMask)

Returns a maxon.frameworks.graph.Wires object which contains only those wires of this Wires object

ToInt()

ToMask()

Converts this maxon.frameworks.graph.Wires object into a mask which uses WIRE_MODE.FULL_MASK for wires which are set in this Wires object, otherwise WIRE_MODE.NONE.

ToString()

Returns a String representation of this maxon.frameworks.graph.Wires

__init__([value, event, dependency, …])

Create a new Wire Only few call are allowed:

Methods Definition

static Wires.All(mode=63)
Returns a Wires value where all wire modes are set to the given mode.
With the default WIRE_MODE.ALL this can be used as a mask which represents all wires, this is useful as argument to PortTemplate::GetConnections to get all connections.
Parameters

mode (maxon.frameworks.graph.WIRE_MODE) – The mode to use for all wires, WIRE_MODE.ALL by default.

Returns

Wires value having all wire modes set to mode.

Return type

maxon.frameworks.graph.Wires

Wires.Combine(other)
Returns the parallel combination of this Wires object and other.
This takes the maximum of each wire value.
Parameters

other (maxon.frameworks.graph.Wires) – Another Wires object.

Returns

The parallel combination (maximum) of the wires.

Return type

maxon.frameworks.graph.Wires

Wires.Concat(other)
Returns the concatenation of this maxon.frameworks.graph.Wires object and other.
This takes the minimum of each wire value.
Parameters

other (maxon.frameworks.graph.Wires) – Another Wires object.

Returns

The concatenation (minimum) of the wires.

Return type

maxon.frameworks.graph.Wires

Wires.EqualWires(other)
Returns the wire-wise comparison of this and other.
This uses WIRE_MODE::FULL_MASK for a wire with the same value in this and other, of WIRE_MODE::NONE if the values differ.
Parameters

other (maxon.frameworks.graph.Wires) – Another Wires object.

Returns

Wire-wise comparison of this and other.

Return type

maxon.frameworks.graph.Wires

Wires.GetHashCode()

Returns the hash code of this maxon.frameworks.graph.Wires.

Returns

Hash code of this maxon.frameworks.graph.CLASS.

Return type

int

Wires.MaskByPriority(priorityMask)
Returns a maxon.frameworks.graph.Wires object which contains only those wires of this Wires object which aren’t below the priority values given in priorityMask.
Parameters

priorityMask (maxon.frameworks.graph.Wires) – Another Wires object.

Returns

Those wires which aren’t below the values of priorityMask.

Return type

maxon.frameworks.graph.Wires

Wires.ToInt()
Wires.ToMask()

Converts this maxon.frameworks.graph.Wires object into a mask which uses WIRE_MODE.FULL_MASK for wires which are set in this Wires object, otherwise WIRE_MODE.NONE.

Returns

Mask object to mask those wires which are present in this Wires object.

Return type

maxon.frameworks.graph.Wires

Wires.ToString()

Returns a String representation of this maxon.frameworks.graph.Wires

Returns

String representation of this maxon.frameworks.graph.Wires.

Return type

str

Wires.__init__(value=0, event=0, dependency=0, context=0, hidden=0, inhibit=0, slink=0, tlink=0)

Create a new Wire Only few call are allowed:

  • Wires(Int index, WIRE_MODE mode = WIRE_MODE::NORMAL)

  • Wires(WIRE_MODE mode) : value(mode), event(mode), dependency(mode)

  • Wires(value=WIRE_MODE.NONE vent=WIRE_MODE.NONE, dependency=WIRE_MODE.NONE,

    context=WIRE_MODE.NONE, hidden=WIRE_MODE.NONE, inhibit=WIRE_MODE.NONE, slink=WIRE_MODE.NONE, tlink=WIRE_MODE.NONE)

Parameters