class documentation

Base class for all UA objects, both client- and server-side.

Method __init__ Cooperative constructor.
Method find Return all objects below this one whose path matches the relative glob pattern, e.g. "**/SkillSet/*".
Method parent.setter Set the parent of the UA object. Given parent must be an instance of BaseUaObject.
Method resolve Return the object at relative below this one, e.g. "Components/Gripper".
Method resolve_optional Return the object at relative below this one, or None.
Method server.setter Undocumented
Method ua_node.setter Set main OPC UA node to an existing node (due to XML import, etc.). Only possible once.
Property aliases Further paths of this object, e.g. of a variable also listed in other containers; path is canonical.
Property full_name Undocumented
Property logger Logger associated with the UaObject instance.
Property name Name of the object.
Property parent Return the untyped parent of the UA object.
Property path Return the full path of the object: the parent's path, the OpenSMI folder (if any) and the segment.
Property server Return the associated server.
Property ua_node Return the internal OPC UA node.
Static Method _check_relative Undocumented
Method _absolute Undocumented
Method _add_alias Add path as a further path of this object; server.resolve() finds it once the object has a node.
Method _set_parent Set the parent; subclasses overriding the parent setter call this instead of setting _parent.
Class Variable _folder OpenSMI folder between the parent and this object in the path, e.g. "SkillSet"; None for none.
Instance Variable _aliases Undocumented
Instance Variable _logger Undocumented
Instance Variable _name Undocumented
Instance Variable _parent Undocumented
Instance Variable _segment Undocumented
Instance Variable _server Undocumented
Instance Variable _ua_node Undocumented
def __init__(self, *, name: str | None = None, segment: str | None = None, server: _ServerType | None = None, parent: BaseUaObject[_ServerType] | None = None, **kwargs):

Cooperative constructor.

Parameters
name:str | NoneThe name of the UA object, as on the server (may be empty on servers we don't control; the segment never is). Defaults to the class name.
segment:str | NoneThe last segment of the object's path. Defaults to the sanitized name; clients pass the unique segment from opensmi.core.paths.unique_segments().
server:_ServerType | NoneThe associated server of the UA object. Note that there must be at least one non None in the hierarchy.
parent:BaseUaObject[_ServerType] | NoneThe parent of the UA object. Only Machines are allowed to have no parent. Can be set later before asynchronous initialization.
**kwargsUndocumented
def find(self, pattern: str) -> list[BaseUaObject[_ServerType]]:

Return all objects below this one whose path matches the relative glob pattern, e.g. "**/SkillSet/*".

Raises
ValueErrorIf pattern starts with / or is no valid pattern.
def parent(self, parent: BaseUaObject[_ServerType]):

Set the parent of the UA object. Given parent must be an instance of BaseUaObject.

def resolve(self, relative: str) -> BaseUaObject[_ServerType]:

Return the object at relative below this one, e.g. "Components/Gripper".

Raises
KeyErrorIf no object has this path.
ValueErrorIf relative starts with / or is no valid relative path.
def resolve_optional(self, relative: str) -> BaseUaObject[_ServerType] | None:

Return the object at relative below this one, or None.

Raises
ValueErrorIf relative starts with / or is no valid relative path.
def server(self, server: _ServerType):

Undocumented

def ua_node(self, ua_node: Node):

Set main OPC UA node to an existing node (due to XML import, etc.). Only possible once.

@property
aliases: frozenset[ObjectPath] =

Further paths of this object, e.g. of a variable also listed in other containers; path is canonical.

@property
@deprecated('Use path instead')
full_name: str =

Undocumented

@property
logger: BoundLogger =

Logger associated with the UaObject instance.

@property
name: str =

Name of the object.

@property
parent: BaseUaObject[_ServerType] | None =

Return the untyped parent of the UA object.

@property
path: ObjectPath =

Return the full path of the object: the parent's path, the OpenSMI folder (if any) and the segment.

@property
server: _ServerType =

Return the associated server.

@property
ua_node: Node =

Return the internal OPC UA node.

@staticmethod
def _check_relative(relative: str):

Undocumented

def _absolute(self, relative: str) -> ObjectPath:

Undocumented

def _add_alias(self, path: ObjectPath):

Add path as a further path of this object; server.resolve() finds it once the object has a node.

def _set_parent(self, parent: BaseUaObject[_ServerType]):

Set the parent; subclasses overriding the parent setter call this instead of setting _parent.

Raises
RuntimeErrorIf the object already has a node: its path is registered and must not change.
_folder: ClassVar[str | None] =

OpenSMI folder between the parent and this object in the path, e.g. "SkillSet"; None for none.

_aliases: set[ObjectPath] =

Undocumented

_logger: structlog.BoundLogger =

Undocumented

_name: str =

Undocumented

_parent: BaseUaObject[_ServerType] | None =

Undocumented

_segment: str =

Undocumented

_server: _ServerType | None =

Undocumented

_ua_node: Node | None =

Undocumented