mbdlyb_ui.functional.operating_modes
Copyright (c) 2023 - 2026 TNO-ESI All rights reserved.
Classes
Represent an editable operating mode. |
|
Display the operating mode details properties and relations. |
|
Display the operating mode update editing page. |
Functions
|
Append an operating mode and refresh the list. |
|
Remove an operating mode and refresh the list. |
|
Change the position of an operating mode in the list. |
|
Render the operating mode list and its editing actions. |
|
Render the operating mode editing controls. |
Module Contents
- class mbdlyb_ui.functional.operating_modes.FormOperatingMode(name: str, new=False)
Represent an editable operating mode.
- drop()
Remove this operating mode from its parent list.
- static from_list(l: list[str]) list[FormOperatingMode]
Create editable operating modes from stored names.
- Parameters:
l – Stored state or operating mode names to turn into entries.
- Returns:
Editable collection initialized from the stored values.
- static to_list(l: list[FormOperatingMode]) list[str]
List the names of operating modes not marked for removal.
- Parameters:
l – Editable operating modes, including entries marked for removal.
- Returns:
Stored values represented by the editable entries.
- static updates_list(l: list[FormOperatingMode]) dict[str, str | None]
Collect renames and removals of existing operating modes.
- Parameters:
l – Editable operating modes to inspect for renames and removals.
- Returns:
Mapping of old operating mode names to new names or removal markers.
- added: bool
- dropped: bool
- name: str
- old_name: str
- class mbdlyb_ui.functional.operating_modes.OpmDetailsPage(opm_id: str)
Bases:
mbdlyb_ui.functional.base.FunctionalPageDisplay the operating mode details properties and relations.
- operating_mode: mbdlyb.functional.gdb.GOperatingMode
- class mbdlyb_ui.functional.operating_modes.OpmUpdatePage(opm_id: str = None, cluster_id: str = None)
Bases:
mbdlyb_ui.functional.base.FunctionalPageDisplay the operating mode update editing page.
- cluster: mbdlyb.functional.gdb.GCluster
- operating_mode: mbdlyb.functional.gdb.GOperatingMode
- operating_modes: list[FormOperatingMode]
- update: bool
- mbdlyb_ui.functional.operating_modes.add_opm(form_operating_modes: list[FormOperatingMode])
Append an operating mode and refresh the list.
- Parameters:
form_operating_modes – Editable operating mode entries.
- mbdlyb_ui.functional.operating_modes.drop_opm(opm: FormOperatingMode)
Remove an operating mode and refresh the list.
- Parameters:
opm – Operating mode selected for editing.
- mbdlyb_ui.functional.operating_modes.move_opm(operating_modes: list[FormOperatingMode], opm: FormOperatingMode, direction: int)
Change the position of an operating mode in the list.
- Parameters:
operating_modes – Editable list of operating mode entries.
opm – Operating mode selected for editing.
direction – Direction in which to move the item.
- mbdlyb_ui.functional.operating_modes.operating_mode_list(operating_modes: list[FormOperatingMode])
Render the operating mode list and its editing actions.
- Parameters:
operating_modes – Editable list of operating mode entries.
- mbdlyb_ui.functional.operating_modes.opm_form(opm: mbdlyb.functional.gdb.GOperatingMode, operating_modes: list[FormOperatingMode], cluster: mbdlyb.functional.gdb.GCluster, update: bool = True)
Render the operating mode editing controls.
- Parameters:
opm – Operating mode node whose name is edited.
operating_modes – Editable list of operating mode entries.
cluster – Parent cluster used to validate the operating mode name.
update – Whether the operating mode already exists for name validation.