Node

Spinnaker uses GenICam to declare and make available the system and camera properties as well-defined nodes with a clear API.

Each node represents a camera or system property, and they can be e.g. a SpinIntNode, SpinFloatNode, SpinBoolNode, SpinStrNode, SpinCommandNode etc. E.g. a SpinIntNode supports getting and setting a value, getting the optionally allowed increments, and getting the unit etc.

All nodes inherit from SpinBaseNode, but some nodes have additional inheritance adding more functionality. E.g. SpinIntNode inherits from SpinSelectorNode, SpinNode, and SpinValueNode.

Node access

There are two approaches to getting access to the nodes: using the pre-listed nodes or getting it by name/index from a NodeMap.

You can get the pre-listed nodes for the system, interface, and camera from system_nodes, interface_nodes, camera_nodes, tl_dev_nodes, and tl_stream_nodes, respectively.

To use a NodeMap, you first have to get an instance and then look up a node by name. Like the pre-listed nodes, you can get the node map for the system, interface, and camera from get_tl_node_map(), get_tl_node_map(), get_node_map(), get_tl_dev_node_map(), and get_tl_stream_node_map(), respectively.

Pre-listed nodes operate identically as getting the node from a NodeMap, except it provides these nodes as named properties with the same name as the node.

E.g. to select whether the system enumerates USB devices, you have to get the node that controls this property and then set its value. Using the pre-listed approach on EnumerateUSBInterfaces you’d do:

>>> from rotpy.system import SpinSystem
>>> system = SpinSystem()
>>> system.system_nodes.EnumerateUSBInterfaces
<rotpy.node.SpinBoolNode at 0x26822c20d68>
>>> # first make sure this node is actually available for this system
>>> system.system_nodes.EnumerateUSBInterfaces.is_available()
True
>>> system.system_nodes.EnumerateUSBInterfaces.get_node_value()
True
>>> system.system_nodes.EnumerateUSBInterfaces.set_node_value(False)

Similarly, using a NodeMap from get_tl_node_map() you’d do:

>>> from rotpy.system import SpinSystem
>>> system = SpinSystem()
>>> node_map = system.get_tl_node_map()
>>> node = node_map.get_node_by_name('EnumerateUSBInterfaces')
>>> node is not None and node.is_available()
True
>>> node.get_node_value()
True
>>> node.set_node_value(False)

You can use these approaches interchangeably and on the same system.

Warning

Remember to always check whether the node is available and readable/writeable as needed. Even pre-listed nodes need to be checked, and being pre-listed does not mean they are implemented for the specific system/camera.

Classes:

NodeMap

Provides access to nodes of a camera or system.

SpinBaseNode

The base node class that provides functionality for checking the state of the node.

SpinSelectorNode

Provides selection functionality to the node, if the node can be used to select other nodes (e.g.

SpinNode

Provides basic node functionality for nodes that have additional functionality such as values etc.

SpinValueNode

A node that represents a value e.g.

SpinIntNode

Node that represents an integer.

SpinFloatNode

Node that represents a floating point number.

SpinBoolNode

Node that represents boolean.

SpinStrNode

Node that represents a string.

SpinCommandNode

Node that represents a command to be executed.

SpinRegisterNode

Node that represents a register that can be set to some bytes representing a value.

SpinEnumNode

Node that represents an enum class.

SpinEnumDefNode

Same as SpinEnumNode, except that these enum instances have an associated name and integer additionally defined for its entries (items) in names by the Spinnaker API.

SpinEnumItemNode

Represents an entry (item) of a SpinEnumNode or SpinEnumDefNode to which that node can be set to.

SpinTreeNode

Node that is a parent and contains other nodes as children.

SpinPortNode

Node that represents a pure data port.

class NodeMap

Bases: object

Provides access to nodes of a camera or system.

See node for details.

Methods:

connect_port

Connects a port to another port.

get_dev_name

Returns the device name.

get_node_by_index

Gets a node from the node map using a zero-based index that is less than get_num_nodes().

get_node_by_name

Gets a node from the node map by name.

get_nodes

Returns a list of all the nodes in the map.

get_num_nodes

Gets the number of nodes in the map.

invalidate_nodes

Invalidates all nodes.

poll

Fires nodes which have a polling time.

connect_port(self, SpinPortNode node, unicode name=u'')

Connects a port to another port.

Parameters
  • node – The SpinPortNode node to connect.

  • name – The name of the node to connect to. If not specified (the default), it connects to the standard port “Device”.

Returns

bool, whether it connected.

get_dev_name(self)

Returns the device name.

The device name identifies a device instance, e.g. for debugging purposes.

get_node_by_index(self, size_t index)

Gets a node from the node map using a zero-based index that is less than get_num_nodes().

Parameters

index – The index of the node.

Returns

A SpinBaseNode derived instance.

get_node_by_name(self, unicode name)

Gets a node from the node map by name.

Parameters

name – The string name of the node.

Returns

A SpinBaseNode derived instance or None if there isn’t one with that name.

get_nodes(self)

Returns a list of all the nodes in the map.

It only returns direct nodes of the map. If the nodes have children (e.g. enum class or tree) it is not recursed.

get_num_nodes(self)

Gets the number of nodes in the map.

invalidate_nodes(self)

Invalidates all nodes.

poll(self, int64_t elapsed)

Fires nodes which have a polling time.

Parameters

elapsed – The elapsed time.

class SpinBaseNode

Bases: object

The base node class that provides functionality for checking the state of the node.

Methods:

get_access_mode

Gets the access mode of the node as a string from AccessMode_names.

is_available

Returns whether the node is available (i.e.

is_implemented

Returns whether the node is implemented (i.e.

is_readable

Returns whether the node is readable (i.e.

is_visible

Returns whether the visibility level is less than or equal than the maximum visibility according to the visibility levels of Visibility_names.

is_writable

Returns whether the node is writable (i.e.

get_access_mode(self)

Gets the access mode of the node as a string from AccessMode_names.

is_available(self)

Returns whether the node is available (i.e. it’s implemented and available - not NI and not NA).

is_implemented(self)

Returns whether the node is implemented (i.e. not NI).

is_readable(self)

Returns whether the node is readable (i.e. RW or RO).

is_visible(self, unicode visibility, unicode max_visibility)

Returns whether the visibility level is less than or equal than the maximum visibility according to the visibility levels of Visibility_names.

is_writable(self)

Returns whether the node is writable (i.e. RW or WO).

class SpinSelectorNode

Bases: SpinBaseNode

Provides selection functionality to the node, if the node can be used to select other nodes (e.g. as a category) or if it’s selectable by another node.

Methods:

get_selected_nodes

Returns a list of newly created node instances selected by this node.

get_selecting_nodes

Returns a list of newly created node instances that select this node.

is_selector

Returns whether this feature selects a group of features.

get_selected_nodes(self)

Returns a list of newly created node instances selected by this node.

get_selecting_nodes(self)

Returns a list of newly created node instances that select this node.

is_selector(self)

Returns whether this feature selects a group of features.

class SpinNode

Bases: SpinSelectorNode

Provides basic node functionality for nodes that have additional functionality such as values etc.

Methods:

get_alias_node

Gets a alias node which describes the same feature in a different way.

get_caching_mode

Gets the caching mode of the node as a string from CachingMode_names.

get_cast_alias_node

Gets a alias node which describes the same feature so that it can be casted.

get_description

Gets a longer description of the node.

get_dev_name

Gets the name of the device.

get_display_name

Gets the display name of the node (whitespace possible).

get_doc_url

Gets a URL pointing to the documentation of that feature.

get_event_id

Gets the event ID of the node.

get_metadata

Returns a dict of metadata of the node.

get_name

Gets the name of the node (no whitespace).

get_namespace

Gets the namespace of the node as a string from NameSpace_names.

get_node_type

Gets the node type of the node as a string from InterfaceType_values.

get_polling_time

Gets recommended polling time (for non-cacheable nodes).

get_property

Gets the property value by name plus any additional attributes.

get_property_names

Returns a list of the names of all properties set during initialization.

get_short_description

Gets a short description of the node.

get_visibility

Gets the recommended visibility of the node as a string from Visibility_names.

invalidate

Indicates that the node's value may have changed.

is_access_cachable

Gets whether the AccessMode can be cached, as a string from YesNo_names.

is_cachable

Checks whether the node value is cacheable.

is_deprecated

Checks whether the node should not be used any more.

is_feature

Checks whether the node can be reached via category nodes from a category node named "Root".

is_streamable

Checks whether the node value is streamable.

set_access_mode

Imposes an access mode to the natural access mode of the node.

set_ref

Sets the implementation to a reference node.

set_visibility

Imposes a visibility to the natural visibility of the node.

get_alias_node(self)

Gets a alias node which describes the same feature in a different way.

Returns

A SpinBaseNode derived instance or None if there isn’t one.

get_caching_mode(self)

Gets the caching mode of the node as a string from CachingMode_names.

get_cast_alias_node(self)

Gets a alias node which describes the same feature so that it can be casted.

Returns

A SpinBaseNode derived instance or None if there isn’t one.

get_description(self)

Gets a longer description of the node.

get_dev_name(self)

Gets the name of the device.

get_display_name(self)

Gets the display name of the node (whitespace possible).

get_doc_url(self)

Gets a URL pointing to the documentation of that feature.

get_event_id(self)

Gets the event ID of the node.

get_metadata(self) dict

Returns a dict of metadata of the node.

The items are the various info on the node as accessible from the node’s methods (e.g. whether it’s readable etc.).

get_name(self, bool fully_qualified=False)

Gets the name of the node (no whitespace).

Optionally fully qualified

get_namespace(self)

Gets the namespace of the node as a string from NameSpace_names.

get_node_type(self)

Gets the node type of the node as a string from InterfaceType_values.

get_polling_time(self)

Gets recommended polling time (for non-cacheable nodes).

get_property(self, unicode name)

Gets the property value by name plus any additional attributes.

If the property has multiple values/attribute they come with Tabs as delimiters.

It returns a 3-tuple of (result, value, attributes), where result is a bool indicating the result of the call and the others are strings.

get_property_names(self)

Returns a list of the names of all properties set during initialization.

get_short_description(self)

Gets a short description of the node.

get_visibility(self)

Gets the recommended visibility of the node as a string from Visibility_names.

invalidate(self)

Indicates that the node’s value may have changed.

Fires the callback on this and all dependent nodes

is_access_cachable(self)

Gets whether the AccessMode can be cached, as a string from YesNo_names.

is_cachable(self)

Checks whether the node value is cacheable.

is_deprecated(self)

Checks whether the node should not be used any more.

is_feature(self)

Checks whether the node can be reached via category nodes from a category node named “Root”.

is_streamable(self)

Checks whether the node value is streamable.

set_access_mode(self, unicode mode)

Imposes an access mode to the natural access mode of the node.

mode is s string from AccessMode_names.

set_ref(self, SpinNode node)

Sets the implementation to a reference node.

set_visibility(self, unicode visibility)

Imposes a visibility to the natural visibility of the node.

mode is s string from Visibility_names.

class SpinValueNode

Bases: SpinNode

A node that represents a value e.g. a string, an integer etc.

Methods:

get_node_value_as_str

Gets the value of the node, independent of the type, as a string.

is_value_cached

Checks if the value comes from cache or is requested from another node.

set_node_value_from_str

Sets the value of the node, independent of the type, from a string.

get_node_value_as_str(self, bool verify=False, bool ignore_cache=False)

Gets the value of the node, independent of the type, as a string.

Parameters
  • verify – Whether to verify the Range verification. The access mode is always checked.

  • ignore_cache – If true the value is read ignoring any caches.

Returns

A string representing the node’s value.

is_value_cached(self)

Checks if the value comes from cache or is requested from another node.

set_node_value_from_str(self, unicode value, bool verify=True)

Sets the value of the node, independent of the type, from a string.

Parameters
  • value – The value to which to set the node. It is important to ensure that the value of the string is appropriate to the node type.

  • verify – Whether to verify the node access mode and range.

class SpinIntNode

Bases: SpinValueNode

Node that represents an integer.

Methods:

get_increment

Gets the increment value of the node.

get_increment_mode

Gets the increment mode string of the node as listed in :attr:`~rotpy.names.geni.IncMode_names.

get_max_value

Gets the maximum allowed value of the node.

get_min_value

Gets the minimum allowed value of the node.

get_node_value

Gets the value of the node.

get_representation

Gets the name of the representation that this node represents.

get_unit

Gets the physical unit name as a string.

get_valid_values

Gets list of valid values.

set_max_value

Sets the maximum allowed value of the node.

set_min_value

Sets the minimum allowed value of the node.

set_node_value

Sets the value of the node.

get_increment(self)

Gets the increment value of the node. All possible values must be divisible by this.

get_increment_mode(self)

Gets the increment mode string of the node as listed in :attr:`~rotpy.names.geni.IncMode_names.

get_max_value(self)

Gets the maximum allowed value of the node.

get_min_value(self)

Gets the minimum allowed value of the node.

get_node_value(self, bool verify=False, bool ignore_cache=False)

Gets the value of the node.

Parameters
  • verify – Enables Range verification. The access mode is always checked.

  • ignore_cache – If true the value is read ignoring any caches.

Returns

The node’s integer value.

get_representation(self)

Gets the name of the representation that this node represents. E.g. linear, logarithmic, hexidecimal, MAC etc.

It returns a name from Representation_names

get_unit(self)

Gets the physical unit name as a string.

get_valid_values(self, bool bounded=True)

Gets list of valid values.

Parameters

bounded – Whether to bound the values.

set_max_value(self, int64_t value)

Sets the maximum allowed value of the node.

set_min_value(self, int64_t value)

Sets the minimum allowed value of the node.

set_node_value(self, int64_t value, bool verify=True)

Sets the value of the node.

Parameters
  • value – The value to which to set the node.

  • verify – Enables access mode and range verification.

class SpinFloatNode

Bases: SpinValueNode

Node that represents a floating point number.

Methods:

get_display_notation

Gets the way the float should be converted to a string.

get_display_precision

Gets the precision to be used when converting the float to a string.

get_increment

Gets the increment value of the node.

get_increment_mode

Gets the increment mode string of the node as listed in :attr:`~rotpy.names.geni.IncMode_names.

get_max_value

Gets the maximum allowed value of the node.

get_min_value

Gets the minimum allowed value of the node.

get_node_value

Gets the value of the node as a float.

get_representation

Gets the name of the representation that this node represents.

get_unit

Gets the physical unit name as a string.

get_valid_values

Gets list of valid values.

has_increment

Gets whether the float has a constant increment.

set_max_value

Sets the maximum allowed value of the node.

set_min_value

Sets the minimum allowed value of the node.

set_node_value

Sets the value of the node.

get_display_notation(self)

Gets the way the float should be converted to a string.

It returns a name from DisplayNotation_names

get_display_precision(self)

Gets the precision to be used when converting the float to a string.

get_increment(self)

Gets the increment value of the node. All possible values must be divisible by this.

get_increment_mode(self)

Gets the increment mode string of the node as listed in :attr:`~rotpy.names.geni.IncMode_names.

get_max_value(self)

Gets the maximum allowed value of the node.

get_min_value(self)

Gets the minimum allowed value of the node.

get_node_value(self, bool verify=False, bool ignore_cache=False)

Gets the value of the node as a float.

Parameters
  • verify – Enables Range verification. The access mode is always checked.

  • ignore_cache – If true the value is read ignoring any caches.

Returns

The node’s floating point value.

get_representation(self)

Gets the name of the representation that this node represents. E.g. linear, logarithmic, hexidecimal, MAC etc.

It returns a name from Representation_names

get_unit(self)

Gets the physical unit name as a string.

get_valid_values(self, bool bounded=True)

Gets list of valid values.

Parameters

bounded – Whether to bound the values.

has_increment(self)

Gets whether the float has a constant increment.

set_max_value(self, double value)

Sets the maximum allowed value of the node.

set_min_value(self, double value)

Sets the minimum allowed value of the node.

set_node_value(self, double value, bool verify=True)

Sets the value of the node.

Parameters
  • value – The value to which to set the node.

  • verify – Enables access mode and range verification.

class SpinBoolNode

Bases: SpinValueNode

Node that represents boolean.

Methods:

get_node_value

Gets the value of the node as a bool.

set_node_value

Sets the value of the node.

get_node_value(self, bool verify=False, bool ignore_cache=False)

Gets the value of the node as a bool.

Parameters
  • verify – Enables Range verification. The access mode is always checked.

  • ignore_cache – If true the value is read ignoring any caches.

Returns

The node’s boolean value.

set_node_value(self, bool value, bool verify=True)

Sets the value of the node.

Parameters
  • value – The value to which to set the node.

  • verify – Enables access mode and range verification.

class SpinStrNode

Bases: SpinValueNode

Node that represents a string.

Methods:

get_max_len

Gets the maximum length of the node's string in bytes.

get_node_value

Gets the value of the node as a string.

set_node_value

Sets the value of the node.

get_max_len(self)

Gets the maximum length of the node’s string in bytes.

get_node_value(self, bool verify=False, bool ignore_cache=False)

Gets the value of the node as a string.

Parameters
  • verify – Enables Range verification. The access mode is always checked.

  • ignore_cache – If true the value is read ignoring any caches.

Returns

The node’s string value.

set_node_value(self, unicode value, bool verify=True)

Sets the value of the node.

Parameters
  • value – The value to which to set the node.

  • verify – Enables access mode and range verification.

class SpinCommandNode

Bases: SpinValueNode

Node that represents a command to be executed.

Methods:

execute_node

Execute the command.

is_done

Gets whether the command is executed.

execute_node(self, bool verify=True)

Execute the command.

Parameters

verify – Enables access mode and range verification.

is_done(self, bool verify=True)

Gets whether the command is executed.

Parameters

verify – Enables Range verification. The access mode is always checked.

class SpinRegisterNode

Bases: SpinValueNode

Node that represents a register that can be set to some bytes representing a value.

Methods:

get_address

Gets the address of the register node.

get_node_value

Gets the register value of the node as a bytes object.

set_node_value

Sets the register's contents.

get_address(self)

Gets the address of the register node.

get_node_value(self, bool verify=False, bool allow_cache=False)

Gets the register value of the node as a bytes object.

Parameters
  • verify – Whether to range verify the node. Access is always checked.

  • allow_cache – Whether to allow getting the register value from cache.

Returns

The bytes object representing the node value.

set_node_value(self, buffer, bool verify=True)

Sets the register’s contents.

Parameters
  • buffer – A array/bytes type buffer to which to set the node.

  • verify – Whether to range and access verify the node.

class SpinEnumNode

Bases: SpinValueNode

Node that represents an enum class.

This node can be set to a specific value from the children of this node, each represented by a SpinEnumItemNode. Each item also is associated with a symbolic string name and an integer value. In addition, some enums (e.g. SpinEnumDefNode) will also have a secondary name and integer associated with it that is defined by the Spinnaker API in names.

Methods:

get_entries

Returns a list of SpinEnumItemNode instances that are the entries (items) of this enum class.

get_entries_names

Returns a list of the enum entries (items) symbolic string names.

get_entry_by_int_value

Gets a enum entry (item) node from this enum class by its int value.

get_entry_by_name

Gets a enum entry (item) node from the enum class by its symbolic string name.

get_node_int_value

Gets the int value of the enum entry (item) that this enum is currently set to.

get_node_value

Gets the SpinEnumItemNode entry that the enum is currently set to.

get_num_entries

Gets the number of entries (items) of this enum class.

set_node_int_value

Sets the enum's current value to a enum entry (item) using the entry's int value.

set_node_value

Sets the enum's current value to a SpinEnumItemNode entry.

get_entries(self)

Returns a list of SpinEnumItemNode instances that are the entries (items) of this enum class.

Note

Every call to this function creates a list of new SpinEnumItemNode representing the items.

get_entries_names(self)

Returns a list of the enum entries (items) symbolic string names.

get_entry_by_int_value(self, int64_t value)

Gets a enum entry (item) node from this enum class by its int value.

Parameters

value – The int value of the entry to get. This int value is the node int value, not the int associated with the enum by the Spinnaker API in names for some enums.

Returns

A SpinEnumItemNode instance or None if not found.

Note

Every call to this function creates a new SpinEnumItemNode.

get_entry_by_name(self, unicode name)

Gets a enum entry (item) node from the enum class by its symbolic string name.

Parameters

name – The symbolic string name of the enum entry to get.

Returns

A SpinEnumItemNode instance or None if not found.

Note

Every call to this function creates a new SpinEnumItemNode.

get_node_int_value(self, bool verify=False, bool ignore_cache=False)

Gets the int value of the enum entry (item) that this enum is currently set to.

Parameters
  • verify – Enables Range verification. The access mode is always checked.

  • ignore_cache – If true the value is read ignoring any caches.

Returns

An integer. This int value is the node int value, not the int associated with the enum by the Spinnaker API in names for some enums.

get_node_value(self, bool verify=False, bool ignore_cache=False)

Gets the SpinEnumItemNode entry that the enum is currently set to.

Parameters
  • verify – Enables Range verification. The access mode is always checked.

  • ignore_cache – If true the value is read ignoring any caches.

Returns

A SpinEnumItemNode.

Note

Every call to this function creates a new SpinEnumItemNode.

get_num_entries(self)

Gets the number of entries (items) of this enum class.

set_node_int_value(self, int64_t value, bool verify=True)

Sets the enum’s current value to a enum entry (item) using the entry’s int value.

Parameters
  • value – The int value to which to set the node. This int value is the node int value, not the int associated with the enum by the Spinnaker API in names for some enums.

  • verify – Enables access mode and range verification.

set_node_value(self, SpinEnumItemNode item, bool verify=True)

Sets the enum’s current value to a SpinEnumItemNode entry.

Parameters
  • item – The SpinEnumItemNode item to which to set the node.

  • verify – Enables access mode and range verification.

class SpinEnumDefNode

Bases: SpinEnumNode

Same as SpinEnumNode, except that these enum instances have an associated name and integer additionally defined for its entries (items) in names by the Spinnaker API.

This class is also used for enum instances that are pre-listed e.g. in system_nodes or camera_nodes. These pre-listed enum nodes have associated names in names hence the additional functionality.

Attributes:

enum_names

enum_names: dict The xxx_names dictionary in names that maps the Spinnaker API given name to Spinnaker API given value for all the entries (items) of this enum.

enum_values

enum_values: dict The xxx_names dictionary in names that maps the Spinnaker API given value to Spinnaker API given name for all the entries (items) of this enum.

Methods:

get_entry_by_api_str

Gets a enum entry (item) node from this enum class by its Spinnaker API string value as listed in enum_names.

get_node_api_str_value

Gets the Spinnaker API string value of the enum entry that this enum is currently set to as listed in enum_names.

set_enum_ref

Sets the int value corresponding to a enum item.

set_node_api_str_value

Sets the value of this enum to a enum entry (item) using its Spinnaker API string as listed in enum_names.

set_num_enums

Sets the number of enum entries (items) of this node.

enum_names

enum_names: dict The xxx_names dictionary in names that maps the

Spinnaker API given name to Spinnaker API given value for all the entries (items) of this enum.

enum_values

enum_values: dict The xxx_names dictionary in names that maps the

Spinnaker API given value to Spinnaker API given name for all the entries (items) of this enum.

get_entry_by_api_str(self, unicode value)

Gets a enum entry (item) node from this enum class by its Spinnaker API string value as listed in enum_names.

Parameters

value – The string value of the entry to get as listed in enum_names.

Returns

A SpinEnumItemNode instance or None if not found.

Note

Every call to this function creates a new SpinEnumItemNode.

get_node_api_str_value(self, bool verify=False, bool ignore_cache=False)

Gets the Spinnaker API string value of the enum entry that this enum is currently set to as listed in enum_names.

Parameters
  • verify – Enables Range verification. The access mode is always checked.

  • ignore_cache – If true the value is read ignoring any caches.

set_enum_ref(self, int index, unicode name)

Sets the int value corresponding to a enum item.

set_node_api_str_value(self, unicode value, bool verify=True)

Sets the value of this enum to a enum entry (item) using its Spinnaker API string as listed in enum_names.

Parameters
  • value – The Spinnaker API string value to which to set the node.

  • verify – Enables access mode and range verification.

set_num_enums(self, int num)

Sets the number of enum entries (items) of this node.

class SpinEnumItemNode

Bases: SpinValueNode

Represents an entry (item) of a SpinEnumNode or SpinEnumDefNode to which that node can be set to.

Attributes:

enum_name

enum_name: unicode For SpinEnumItemNode created as entries of SpinEnumDefNode using SpinEnumDefNode.get_entry_by_api_str(), it's the Spinnaker API given name of this entry as listed in SpinEnumDefNode.enum_names.

enum_value

enum_value: 'int' For SpinEnumItemNode created as entries of SpinEnumDefNode using SpinEnumDefNode.get_entry_by_api_str(), it's the Spinnaker API given value of this entry as listed in SpinEnumDefNode.enum_values.

Methods:

get_enum_int_value

Gets the enum entry (item) int value.

get_enum_name

Gets the string symbolic representation of the item.

get_enum_num

Gets the double (floating point) number value associated with the entry.

is_self_clearing

Returns whether the corresponding entry is self clearing.

enum_name

enum_name: unicode For SpinEnumItemNode created as entries of

SpinEnumDefNode using SpinEnumDefNode.get_entry_by_api_str(), it’s the Spinnaker API given name of this entry as listed in SpinEnumDefNode.enum_names.

enum_value

enum_value: ‘int’ For SpinEnumItemNode created as entries of

SpinEnumDefNode using SpinEnumDefNode.get_entry_by_api_str(), it’s the Spinnaker API given value of this entry as listed in SpinEnumDefNode.enum_values.

get_enum_int_value(self)

Gets the enum entry (item) int value.

Note

This int value is the node int value, not the enum_value int associated with the enum by the Spinnaker API in names for some enums.

get_enum_name(self)

Gets the string symbolic representation of the item.

Note

This string is the node symbolic name, not the enum_name associated with the enum by the Spinnaker API in names for some enums.

get_enum_num(self)

Gets the double (floating point) number value associated with the entry.

is_self_clearing(self)

Returns whether the corresponding entry is self clearing.

class SpinTreeNode

Bases: SpinValueNode

Node that is a parent and contains other nodes as children.

Methods:

get_children

Returns a list of children nodes of the tree, including sub-trees.

get_node_by_index

Gets a node from the tree by index using a zero-based index that is less than get_num_nodes()..

get_num_nodes

Gets the number of children nodes in the tree.

get_children(self)

Returns a list of children nodes of the tree, including sub-trees.

Note

Every call to this method creates a list of new SpinBaseNode representing the children.

get_node_by_index(self, size_t index)

Gets a node from the tree by index using a zero-based index that is less than get_num_nodes()..

Parameters

index – The index of the child node.

Returns

A new SpinBaseNode derived instance representing the child.

get_num_nodes(self)

Gets the number of children nodes in the tree.

class SpinPortNode

Bases: SpinBaseNode

Node that represents a pure data port.

Methods:

read_port

Reads a chunk of bytes from the port.

write_port

Writes a chunk of bytes to the port.

read_port(self, int64_t address, int64_t n)

Reads a chunk of bytes from the port.

Parameters
  • address – The port address.

  • n – The number of bytes to read

Returns

Bytes object.

write_port(self, buffer, int64_t address)

Writes a chunk of bytes to the port.

Parameters
  • buffer – A array/bytes type buffer to write.

  • address – The port address.