class ROS2MutationMixin(MonitoringMixin, ROS2EventsMixin):
Constructor: ROS2MutationMixin(*args, **kwargs)
The one door through which a machinery item's Monitoring may grow.
Mixed in ahead of opensmi's class. It brings opensmi's Monitoring container, where the variables go, and extends the events mixin because a refused mutation is a BindingEvent.
| Method | __init__ |
Start out having mutated nothing, and pass every argument to opensmi. |
| Async Method | machinery |
Return the Machinery Monitoring sub-structure of that name in a container, creating it the first time. |
| Async Method | mint |
Return the NodeId of a Structure DataType, creating it and what it names the first time. |
| Async Method | mutate |
Create nodes, keep their names unique, and announce the change once for all. |
| Async Method | mutate |
Create nodes a caller builds itself, under the same caps and announcement. |
| Method | note |
Add to this Machine's mutation tally. Called by every item on it, including itself. |
| Async Method | render |
Create the nodes of one plan in a container, and return how to write them. |
| Async Method | resolve |
Return the NodeId a plan's DataType means on this server. |
| Class Variable | machine |
How many nodes one Machine may gain by mutation, across every machinery item on it. |
| Class Variable | mutation |
How many nodes one Binding may gain by mutation. A Component with a larger Binding overrides it. |
| Property | machine |
Return how many nodes this Machine has gained by mutation, across every item. |
| Property | mutation |
Return how many nodes each Binding on this item has gained by mutation. |
| Property | ros2 |
Return the enumeration DataTypes minted on this Machine, by browse name. |
| Property | ros2 |
Return what distinguishes this item's minted DataTypes from another item's. |
| Method | _count |
Add one addition's nodes to this Binding's tally and to the Machine's. |
| Async Method | _create |
Create one addition: its Machinery group and member group if it has them, and the plan's nodes in it. |
| Async Method | _drop |
Remove a Machinery group a failed addition made, keeping the AddIns a Status group references. |
| Async Method | _machinery |
Return the item's MachineryItemState and MachineryOperationMode, those it has. |
| Async Method | _minted |
Return the NodeId of an enumeration DataType, minting it the first time it is asked for. |
| Async Method | _render |
Render a subtree no DataType can describe: groups for its levels, plain Variables for its leaves. |
| Async Method | _render |
Create the complex Variable of the structure at one path, holding its initial value. |
| Async Method | _within |
Return whether one addition fits, reporting it as a BindingEvent when it does not. |
| Instance Variable | _machine |
Undocumented |
| Instance Variable | _mutation |
Undocumented |
| Instance Variable | _ros2 |
Undocumented |
| Property | _byte |
Return how many bytes a bulk payload on this item may carry. |
UaVariableContainer, name: str, changes: list[ ua.ModelChangeStructureDataType] | None = None) -> UaVariableContainer:
¶
Return the Machinery Monitoring sub-structure of that name in a container, creating it the first time.
It is a FolderType Object shared by every Binding that names it. A Status group references this item's MachineryItemState and MachineryOperationMode with HasComponent when the item provides them, as OPC 40001-1 section 16.1 asks. A group is never removed once a Binding is in it: nothing leaves the address space while the server runs.
| Parameters | |
container:UaVariableContainer | Undocumented |
name:str | Undocumented |
changes:list[ | Where to record the group when it is made, for the model-change event. |
| Returns | |
UaVariableContainer | Undocumented |
Return the NodeId of a Structure DataType, creating it and what it names the first time.
Dependencies first, into the ROS2 nodeset's namespace, through Server.ensure_structure of opensmi-server.
| Raises | |
DuplicateStructureError | When another description of the type is already on the server. Nothing is created in that case. |
Iterable[ NodeAddition], *, at_init: bool = False) -> list[ RenderedPlan | None]:
¶
Create nodes, keep their names unique, and announce the change once for all.
| Parameters | |
additions:Iterable[ | What to create. |
atbool | Whether the address space is being built rather than changed. At init nothing is announced and nothing counts against a cap. |
| Returns | |
list[ | What each addition became, in order; None for one a cap refused, which created nothing. |
| Raises | |
DuplicateVariableNameError | When a name is already taken in its container. |
UnprojectableFieldError | When a plan carries an Object. |
str, path: str, nodes: int, build: Callable[ [], Awaitable[ Sequence[ tuple[ Node, ua.NodeId | int]]]]) -> bool:
¶
Create nodes a caller builds itself, under the same caps and announcement.
Unlike mutate_address_space, the caller makes the nodes. This exists for OPC
10000-210 Locations (opensmi's CartesianFrame), which are not variables of a plan.
| Parameters | |
binding:str | The Binding these nodes belong to, which the cap counts against. |
path:str | The ROS2 path of that Binding, for a refusal's BindingEvent. |
nodes:int | How many nodes the build will create. The caller states it, since only the caller knows. |
build:Callable[ | What to create, answering each node made and the type it instantiated (what a client filtering model changes by type reads). |
| Returns | |
bool | Whether it happened. False means a cap refused it and nothing was created. |
UaVariableContainer, plan: Sequence[ PlanEntry], *, message_type: type[ Message], qualifier: str, where: str, root: str | None = None, writable: bool = False, changes: list[ ua.ModelChangeStructureDataType] | None = None) -> RenderedPlan:
¶
Create the nodes of one plan in a container, and return how to write them.
With root the whole message is one complex Variable of that name. Without it, each top-level field is a child of the container, and a nested message a complex Variable. A complex Variable carries the structure of its level, minted here. A plan with a leaf that no structure field can carry (a DateTime) is rendered with variable groups for its levels and plain Variables for its leaves, so it keeps its names and loses only the atomic read. Every name is checked before any node is made.
| Parameters | |
container:UaVariableContainer | The opensmi container the nodes are added to. |
plan:Sequence[ | What to create. |
messagetype[ | The ROS2 type the plan was shaped from. |
qualifier:str | What names the structures of curated levels, such as Platform.Odom. |
where:str | How a refusal names the container, from a reader's side. |
root:str | None | The name of the complex Variable the whole plan is rendered as. |
writable:bool | Whether a client may write the Variables. |
changes:list[ | Where to record each node made, for the model-change event. |
| Returns | |
RenderedPlan | Undocumented |
| Raises | |
UnprojectableFieldError | When an entry is an Object or has no name. |
DuplicateVariableNameError | When a name is already taken in the container. |
Return the NodeId a plan's DataType means on this server.
A plan is a pure value. The NodeId of this package's types depends on the namespace index the server imported it at, and an enumeration has none until minted. Public because Skills create their nodes outside the chokepoint but need their DataTypes minted here.
Return how many nodes this Machine has gained by mutation, across every item.
Only meaningful on a Machine, which is the item every other one reports to.
Return the enumeration DataTypes minted on this Machine, by browse name.
Only the Machine's is read, by every item on it. Beside each NodeId is the definition it was minted from, so one name asked for with two value sets is refused.
Return what distinguishes this item's minted DataTypes from another item's.
The Machine's name and the item's own, unique together in a server: two Machines in one process may each have a Component called camera, and DataTypes are server-wide.
NodeAddition, changes: list[ ua.ModelChangeStructureDataType]) -> RenderedPlan:
¶
Create one addition: its Machinery group and member group if it has them, and the plan's nodes in it.
A Machinery group this addition created is removed again when the plan fails, so an unused one never stays behind.
Remove a Machinery group a failed addition made, keeping the AddIns a Status group references.
The removal is recursive and follows HasComponent, so the references go first.
Return the item's MachineryItemState and MachineryOperationMode, those it has.
opensmi files both AddIns under MachineryBuildingBlocks. An item without them has none.
Return the NodeId of an enumeration DataType, minting it the first time it is asked for.
Minted once per server and remembered on the Machine; the generated name is qualified by its Component for that reason. It uses asyncua directly and not opensmi's ensure_enum, which needs an IntEnum numbered from zero, while ROS2 constants may start at 1 or skip numbers.
UaVariableContainer, name: str, leaves: list[ PlanVariable], *, root: str | None, writable: bool) -> list[ _Plain]:
¶
Render a subtree no DataType can describe: groups for its levels, plain Variables for its leaves.
UaVariableContainer, name: str, leaves: list[ PlanVariable], classes: Mapping[ NodePath, type], path: NodePath, *, display: str, description: str, writable: bool, changes: list[ ua.ModelChangeStructureDataType] | None) -> _Complex:
¶
Create the complex Variable of the structure at one path, holding its initial value.