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