class documentation

class BaseMachineryItem(UaObject, AbstractUaLogger):

Known subclasses: server.base_machinery_item.BaseComponent

Constructor: BaseMachineryItem(name, minimum_access_level, **kwargs)

View In Hierarchy

Base class for both machines (BaseMachine) and components (BaseComponent).

Method __init__ Cooperative constructor.
Async Method add_component Add given (sub-)component instance, initializes it and keep track of it.
Async Method add_method Add the given method instance to the asset.
Async Method add_methods Add given sequence of method instances to the asset.
Async Method add_skill Add the given skill instance to the asset.
Async Method add_skills Add given sequence of skill instances to the asset.
Async Method condition_as_dependency_ready Undocumented
Async Method condition_startup_completed Check if startup was completed.
Async Method halt Halt the machinery item.
Async Method halt_components Halt all components (None, default) of this machinery item or only specific ones.
Async Method halt_skills Halt all skills (None, default) of this machinery item or only specific ones.
Async Method lifecycle_machinery_item Lifecycle method which calls _init for initialization and _shutdown for shutdown.
Async Method reset Attempt to reset the machinery item.
Async Method reset_components Reset given components. If None given, resets all own components.
Async Method reset_skills Reset all given skills. If None given, resets all own skills.
Async Method set_current_operation_mode Set the current operation mode of this machinery item without any transition logic checks.
Async Method set_current_state Set the current state of this machinery item without any transition logic checks.
Property components (Untyped) subcomponents of this machinery item.
Property current_operation_mode Return the current machinery operation mode. Read-only property.
Property current_state Return the current machinery item state. Read-only property.
Property method_set Return untyped method set UaObjectContainer. Read-only property.
Property skill_set (Untyped) skill set of this machinery item.
Property startup_skill Return the startup skill of the machinery item.
Async Method __init_components Undocumented
Async Method __init_method_set Initialize the method set UaObjectContainer.
Async Method __init_skill_set Initialize the skill set UaObjectContainer.
Async Method _condition_component_ready Undocumented
Async Method _init Undocumented
Async Method _init_status Undocumented
Async Method _shutdown Undocumented
Instance Variable _components Undocumented
Instance Variable _current_operation_mode Undocumented
Instance Variable _current_state Undocumented
Instance Variable _method_set Undocumented
Instance Variable _skill_set Undocumented
Instance Variable _ua_machinery_building_blocks Undocumented
Instance Variable _ua_operation_mode Optional 'MachineryOperationMode' (finite state machine) OPC UA node.
Instance Variable _ua_operation_mode_current_state Optional current_state OPC UA node of 'MachineryOperationMode'.
Instance Variable _ua_state_machine Optional 'MachineryItemState' (finite state machine) OPC UA node.
Instance Variable _ua_state_machine_current_state Optional current_state OPC UA node of 'MachineryItemState'.
def __init__(self, *, name: str | None = None, minimum_access_level: int | None = None, **kwargs):

Cooperative constructor.

async def add_component(self, component: _ComponentType) -> _ComponentType:

Add given (sub-)component instance, initializes it and keep track of it.

async def add_method(self, method: _MethodType) -> _MethodType:

Add the given method instance to the asset.

async def add_methods(self, methods: Sequence[AbstractMethod]):

Add given sequence of method instances to the asset.

async def add_skill(self, skill: _SkillType) -> _SkillType:

Add the given skill instance to the asset.

async def add_skills(self, skills: Sequence[AbstractSkill]):

Add given sequence of skill instances to the asset.

@override
async def condition_as_dependency_ready(self, _user: UserAuthorization) -> bool:

Undocumented

async def condition_startup_completed(self, _user: UserAuthorization) -> bool:

Check if startup was completed.

Startup is considered completed if either the corresponding startup skill (BaseStartupSkill)
is in SkillState.RUNNING or the machinery item has no such skill.
async def halt(self, *, components_to_halt: Iterable[str] | Iterable[BaseComponent] | None = None, skills_to_halt: Iterable[str] | Iterable[AbstractSkill] | None = None):

Halt the machinery item.

If a "Startup" skill for this machinery item exists, halt is expected to be performed by the startup skill. Otherwise, halt all/no skills and all/no subcomponents.

Note: The startup skill should not simply call this method, it will not halt anything!

Parameters
components_to_halt:Iterable[str] | Iterable[BaseComponent] | NoneWhether to halt all subcomponents (except Ports) (None, default) or specified ones.
skills_to_halt:Iterable[str] | Iterable[AbstractSkill] | NoneWhether to halt all skills (None, default) or specified ones.
async def halt_components(self, components_to_halt: Iterable[str] | Iterable[BaseComponent] | None = None):

Halt all components (None, default) of this machinery item or only specific ones.

Parameters
components_to_halt:Iterable[str] | Iterable[BaseComponent] | NoneAll components or only specific ones. Note: components by name will only be searched for in this machinery item!
async def halt_skills(self, skills_to_halt: Iterable[str] | Iterable[AbstractSkill] | None = None):

Halt all skills (None, default) of this machinery item or only specific ones.

Note: skills by name will only be searched for in this machinery item!

@lifecycle(after=(AttributesMixin.lifecycle_attributes, MonitoringMixin.lifecycle_monitoring, ParameterSetMixin.lifecycle_parameter_set, IdentificationMixin.lifecycle_identification))
async def lifecycle_machinery_item(self) -> AsyncGenerator[None]:

Lifecycle method which calls _init for initialization and _shutdown for shutdown.

async def reset(self):

Attempt to reset the machinery item.

If the state indicates resetting is required, it is safe to call when the machinery item is most states.

If a "Startup" skill for this machinery item exists, reset is expected to be performed by the startup skill. If there is no "Startup" skill, then reset all skills and subcomponents.

Raises
PyUaRuntimeErrorIf the machinery item is in state MachineryItemState.NOT_AVAILABLE
async def reset_components(self, components: Iterable[BaseComponent] | None = None):

Reset given components. If None given, resets all own components.

async def reset_skills(self, skills: dict[str, AbstractSkill] | Iterable[AbstractSkill] | None = None):

Reset all given skills. If None given, resets all own skills.

async def set_current_operation_mode(self, mode: MachineryOperationMode):

Set the current operation mode of this machinery item without any transition logic checks.

async def set_current_state(self, state: MachineryItemState):

Set the current state of this machinery item without any transition logic checks.

@property
components: Components =

(Untyped) subcomponents of this machinery item.

@property
current_operation_mode: MachineryOperationMode =

Return the current machinery operation mode. Read-only property.

@property
current_state: MachineryItemState =

Return the current machinery item state. Read-only property.

@property
method_set: MethodSet =

Return untyped method set UaObjectContainer. Read-only property.

@property
skill_set: SkillSet =

(Untyped) skill set of this machinery item.

@property
startup_skill: AbstractSkill =

Return the startup skill of the machinery item.

Raises
KeyErrorIf this machinery item has no startup skill.
async def __init_components(self):

Undocumented

async def __init_method_set(self):

Initialize the method set UaObjectContainer.

async def __init_skill_set(self):

Initialize the skill set UaObjectContainer.

async def _condition_component_ready(self, user: UserAuthorization) -> bool:

Undocumented

@abstractmethod
async def _init(self):

Undocumented

async def _init_status(self):

Undocumented

async def _shutdown(self):

Undocumented

_components: Components =

Undocumented

_current_operation_mode: MachineryOperationMode =

Undocumented

_current_state: MachineryItemState =

Undocumented

_method_set: MethodSet =

Undocumented

_skill_set: SkillSet =

Undocumented

_ua_machinery_building_blocks: Node | None =

Undocumented

_ua_operation_mode: Node | None =

Optional 'MachineryOperationMode' (finite state machine) OPC UA node.

_ua_operation_mode_current_state: Node | None =

Optional current_state OPC UA node of 'MachineryOperationMode'.

_ua_state_machine: Node | None =

Optional 'MachineryItemState' (finite state machine) OPC UA node.

_ua_state_machine_current_state: Node | None =

Optional current_state OPC UA node of 'MachineryItemState'.