class documentation

class ROS2ModelChangeMixin(SpatialObjectListMixin, MonitoringMixin, ROS2EventsMixin):

Constructor: ROS2ModelChangeMixin(*args, **kwargs)

View In Hierarchy

Adds the standard model-change event, on the node the companion specification names.

For the Machine only: OPC 10000-210 marks the spatial-object list with GeneratesEvent GeneralModelChangeEventType, and there is one per Machine. It brings opensmi's spatial-object list and Monitoring container and builds the list as the Machine comes up.

Method __init__ Start out with no model-change generator, and pass everything to opensmi.
Async Method emit_model_change Announce that the address space moved, with every change of one mutation batched.
Async Method lifecycle_ros2_model_change Build the spatial-object list, and generate model-change events on it.
Property node_version Return how many times this Machine's spatial-object list has been re-versioned.
Async Method _bump_node_version Write the next node version, before the event that says why it moved.
Method _specified_model_change_node Return the node OPC 10000-210 names as the source of GeneralModelChangeEvent.
Async Method _specified_node_version Return the NodeVersion OPC 10000-210 makes mandatory on the spatial-object list.
Instance Variable _model_change_lock Undocumented
Instance Variable _model_changes Undocumented
Instance Variable _node_version Undocumented
Instance Variable _node_versions Undocumented

Inherited from ROS2EventsMixin:

Async Method emit_binding_event Fire one BindingEvent from this machinery item.
Async Method lifecycle_ros2_binding_events Import this project's namespace and build the BindingEvent generator on the Notification.
Method note_binding_event Add one fired BindingEvent to this Machine's ring. Called by every item on it.
Property ros2_namespace_index Return the index this server imported NAMESPACE_URI at.
Property ros2_recent_events Return the BindingEvents the Machine and its Components fired, oldest first, at most RECENT_EVENTS.
Property ros2_root_machine Return the Machine this item reports to, which for a Machine is itself.
Method _house_notification_node Return the node opensmi fires its own machinery-item messages on.
Method _keep Record one fired BindingEvent on this Machine's ring, after the trigger succeeded.
Instance Variable _binding_event_lock Undocumented
Instance Variable _binding_events Undocumented
Instance Variable _recent_binding_events Undocumented
Instance Variable _ros2_namespace_index Undocumented
def __init__(self, *args: Any, **kwargs: Any):

Start out with no model-change generator, and pass everything to opensmi.

async def emit_model_change(self, changes: Sequence[ua.ModelChangeStructureDataType]):

Announce that the address space moved, with every change of one mutation batched.

One event per call and none at init. An empty batch is not announced.

Parameters
changes:Sequence[ua.ModelChangeStructureDataType]What moved, one entry per node, as OPC UA models a model change.
Raises
DeclarationErrorWhen this Machine's model-change generator was never built, so there is nothing to fire from.
@lifecycle(after=MonitoringMixin.lifecycle_monitoring, before=BaseMachineryItem.lifecycle_machinery_item)
async def lifecycle_ros2_model_change(self) -> AsyncGenerator[None]:

Build the spatial-object list, and generate model-change events on it.

@property
node_version: int =

Return how many times this Machine's spatial-object list has been re-versioned.

async def _bump_node_version(self):

Write the next node version, before the event that says why it moved.

Written inside the same lock, so a client woken by the event reads a version that already counts it. The value is an opaque counter as text (OPC UA Part 3); only its changing means anything. It moves for every runtime mutation on the Machine, not only those under the list: a client re-browses once too often but never misses a change.

def _specified_model_change_node(self) -> ua.NodeId:

Return the node OPC 10000-210 names as the source of GeneralModelChangeEvent.

Raises
DeclarationErrorWhen the Machine has no spatial-object list.
async def _specified_node_version(self) -> Node | None:

Return the NodeVersion OPC 10000-210 makes mandatory on the spatial-object list.

An event says the address space moved; the node version is what a client that was not listening compares against. None (with a warning) when the nodeset has none, since the model change is the notification that matters.

_model_change_lock =

Undocumented

_model_changes: EventGenerator | None =

Undocumented

_node_version: Node | None =

Undocumented

_node_versions: int =

Undocumented