bec_widgets.cli.client ====================== .. py:module:: bec_widgets.cli.client Classes ------- .. autoapisummary:: bec_widgets.cli.client.AdminView bec_widgets.cli.client.AutoUpdates bec_widgets.cli.client.AvailableDeviceResources bec_widgets.cli.client.BECDockArea bec_widgets.cli.client.BECMainWindow bec_widgets.cli.client.BECProgressBar bec_widgets.cli.client.BECQueue bec_widgets.cli.client.BECShell bec_widgets.cli.client.BECStatusBox bec_widgets.cli.client.BaseROI bec_widgets.cli.client.CircularROI bec_widgets.cli.client.Curve bec_widgets.cli.client.DapComboBox bec_widgets.cli.client.DeveloperView bec_widgets.cli.client.DeviceBrowser bec_widgets.cli.client.DeviceInitializationProgressBar bec_widgets.cli.client.DeviceInputBase bec_widgets.cli.client.DeviceManagerView bec_widgets.cli.client.DockAreaView bec_widgets.cli.client.DockAreaWidget bec_widgets.cli.client.EllipticalROI bec_widgets.cli.client.Heatmap bec_widgets.cli.client.Image bec_widgets.cli.client.ImageItem bec_widgets.cli.client.LaunchWindow bec_widgets.cli.client.LogPanel bec_widgets.cli.client.Minesweeper bec_widgets.cli.client.MonacoDock bec_widgets.cli.client.MonacoWidget bec_widgets.cli.client.MotorMap bec_widgets.cli.client.MultiWaveform bec_widgets.cli.client.PdfViewerWidget bec_widgets.cli.client.PositionIndicator bec_widgets.cli.client.PositionerBox bec_widgets.cli.client.PositionerBox2D bec_widgets.cli.client.PositionerControlLine bec_widgets.cli.client.PositionerGroup bec_widgets.cli.client.RectangularROI bec_widgets.cli.client.ResumeButton bec_widgets.cli.client.Ring bec_widgets.cli.client.RingProgressBar bec_widgets.cli.client.SBBMonitor bec_widgets.cli.client.ScanControl bec_widgets.cli.client.ScanProgressBar bec_widgets.cli.client.ScatterCurve bec_widgets.cli.client.ScatterWaveform bec_widgets.cli.client.SignalLabel bec_widgets.cli.client.TextBox bec_widgets.cli.client.ViewBase bec_widgets.cli.client.Waveform bec_widgets.cli.client.WaveformViewInline bec_widgets.cli.client.WaveformViewPopup bec_widgets.cli.client.WebConsole bec_widgets.cli.client.WebsiteWidget bec_widgets.cli.client._WidgetsEnumType Module Contents --------------- .. py:class:: AdminView(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A view for administrators to change the current active experiment, manage messaging .. py:method:: activate() -> None Switch the parent application to this view. .. py:class:: AutoUpdates(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:property:: enabled :type: bool Get the enabled status of the auto updates. .. py:property:: selected_device :type: str | None Get the selected device from the auto update config. :returns: The selected device. If no device is selected, None is returned. :rtype: str .. py:class:: AvailableDeviceResources(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: BECDockArea(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: attach_all() Re-attach floating docks back into the dock manager. .. py:method:: delete(object_name: str) -> bool Remove a widget from the dock area by its object name. :param object_name: The object name of the widget to remove. :returns: True if the widget was found and removed, False otherwise. :rtype: bool :raises ValueError: If no widget with the given object name is found. .. rubric:: Example >>> dock_area.delete("my_widget") True .. py:method:: delete_all() Delete all docks and their associated widgets. .. py:method:: delete_profile(name: str | None = None, show_dialog: bool = False) -> bool Delete a workspace profile. :param name: The name of the profile to delete. If None, uses the currently selected profile from the toolbar combo box (for UI usage). :param show_dialog: If True, show confirmation dialog before deletion. Defaults to False for CLI/programmatic usage. :returns: True if the profile was deleted, False otherwise. :rtype: bool :raises ValueError: If the profile is read-only or doesn't exist (when show_dialog=False). .. py:method:: describe_layout() -> list[dict[str, Any]] Return metadata describing splitter paths, orientations, and contained docks. Useful for determining the keys to use in `set_layout_ratios(splitter_overrides=...)`. .. py:method:: list_profiles() -> list[str] List available workspace profiles in the current namespace. :returns: List of profile names. :rtype: list[str] .. py:method:: load_profile(name: str | None = None) Load a workspace profile. Before switching, persist the current profile to the user copy. Prefer loading the user copy; fall back to the default copy. :param name: The name of the profile to load. If None, prompts the user. :type name: str | None .. py:method:: new(widget: QWidget | str, *, closable: bool = True, floatable: bool = True, movable: bool = True, start_floating: bool = False, where: Literal['left', 'right', 'top', 'bottom'] | None = None, tab_with: CDockWidget | QWidget | str | None = None, relative_to: CDockWidget | QWidget | str | None = None, show_title_bar: bool | None = None, title_buttons: Mapping[str, bool] | Sequence[str] | str | None = None, show_settings_action: bool | None = None, promote_central: bool = False, object_name: str | None = None, **widget_kwargs) -> QWidget | BECWidget Create a new widget (or reuse an instance) and add it as a dock. :param widget: Instance or registered widget type string. :type widget: QWidget | str :param closable: Whether the dock is closable. :type closable: bool :param floatable: Whether the dock is floatable. :type floatable: bool :param movable: Whether the dock is movable. :type movable: bool :param start_floating: Whether to start the dock floating. :type start_floating: bool :param where: Dock placement hint relative to the dock area (ignored when ``relative_to`` is provided without an explicit value). :type where: Literal["left", "right", "top", "bottom"] | None :param tab_with: Existing dock (or widget/name) to tab the new dock alongside. :type tab_with: CDockWidget | QWidget | str | None :param relative_to: Existing dock (or widget/name) used as the positional anchor. When supplied and ``where`` is ``None``, the new dock inherits the anchor's current dock area. :type relative_to: CDockWidget | QWidget | str | None :param show_title_bar: Explicitly show or hide the dock area's title bar. :type show_title_bar: bool | None :param title_buttons: Mapping or iterable describing which title bar buttons should remain visible. Provide a mapping of button names (``"float"``, ``"close"``, ``"menu"``, ``"auto_hide"``, ``"minimize"``) to booleans, or a sequence of button names to hide. :type title_buttons: Mapping[str, bool] | Sequence[str] | str | None :param show_settings_action: Control whether a dock settings/property action should be installed. Defaults to ``False`` for the basic dock area; subclasses such as `BECDockArea` override the default to ``True``. :type show_settings_action: bool | None :param promote_central: When True, promote the created dock to be the dock manager's central widget (useful for editor stacks or other root content). :type promote_central: bool :param object_name: Optional object name to assign to the created widget. :type object_name: str | None :param \*\*widget_kwargs: Additional keyword arguments passed to the widget constructor when creating by type name. :returns: The created or reused widget instance. :rtype: BECWidget .. py:method:: save_profile(name: str | None = None, *, show_dialog: bool = False, quick_select: bool | None = None) Save the current workspace profile. On first save of a given name: - writes a default copy to states/default/.ini with tag=default and created_at - writes a user copy to states/user/.ini with tag=user and created_at On subsequent saves of user-owned profiles: - updates both the default and user copies so restore uses the latest snapshot. Read-only bundled profiles cannot be overwritten. :param name: The name of the profile to save. If None and show_dialog is True, prompts the user. :type name: str | None :param show_dialog: If True, shows the SaveProfileDialog for user interaction. If False (default), saves directly without user interaction (useful for CLI usage). :type show_dialog: bool :param quick_select: Whether to include the profile in quick selection. If None (default), uses the existing value or True for new profiles. Only used when show_dialog is False; otherwise the dialog provides the value. :type quick_select: bool | None .. py:method:: set_layout_ratios(*, horizontal: Sequence[float] | Mapping[int | str, float] | None = None, vertical: Sequence[float] | Mapping[int | str, float] | None = None, splitter_overrides: Mapping[int | str | Sequence[int], Sequence[float] | Mapping[int | str, float]] | None = None) -> None Adjust splitter ratios in the dock layout. :param horizontal: Weights applied to every horizontal splitter encountered. :param vertical: Weights applied to every vertical splitter encountered. :param splitter_overrides: Optional overrides targeting specific splitters identified by their index path (e.g. ``{0: [1, 2], (1, 0): [3, 5]}``). Paths are zero-based indices following the splitter hierarchy, starting from the root splitter. .. rubric:: Example To build three columns with custom per-column ratios:: area.set_layout_ratios( horizontal=[1, 2, 1], # column widths splitter_overrides={ 0: [1, 2], # column 0 (two rows) 1: [3, 2, 1], # column 1 (three rows) 2: [1], # column 2 (single row) }, ) .. py:method:: widget_list(bec_widgets_only: bool = True) -> list[QWidget] Return a list of widgets contained in the dock area. :param bec_widgets_only: If True, only include widgets that are BECConnector instances. :type bec_widgets_only: bool .. py:method:: widget_map(bec_widgets_only: bool = True) -> dict[str, QWidget] Return a dictionary mapping widget names to their corresponding widgets. :param bec_widgets_only: If True, only include widgets that are BECConnector instances. :type bec_widgets_only: bool .. py:property:: mode :type: str None .. py:property:: workspace_is_locked :type: bool Get or set the lock state of the workspace. :returns: True if the workspace is locked, False otherwise. :rtype: bool .. py:class:: BECMainWindow(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: BECProgressBar(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A custom progress bar with smooth transitions. The displayed text can be customized using a template. .. py:method:: _get_label() -> str Return the label text. mostly used for testing rpc. .. py:method:: set_maximum(maximum: float) Set the maximum value of the progress bar. :param maximum: The maximum value. :type maximum: float .. py:method:: set_minimum(minimum: float) Set the minimum value of the progress bar. :param minimum: The minimum value. :type minimum: float .. py:method:: set_value(value) Set the value of the progress bar. :param value: The value to set. :type value: float .. py:property:: label_template The template for the center label. Use $value, $maximum, and $percentage to insert the values. Examples: >>> progressbar.label_template = "$value / $maximum - $percentage %" >>> progressbar.label_template = "$value / $percentage %" .. py:property:: state None .. py:class:: BECQueue(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Widget to display the BEC queue. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: BECShell(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A WebConsole pre-configured to run the BEC shell. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: BECStatusBox(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` An autonomous widget to display the status of BEC services. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: get_server_state() -> str Get the state ("RUNNING", "BUSY", "IDLE", "ERROR") of the BEC server .. py:method:: remove() Cleanup the BECConnector .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:class:: BaseROI(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Base class for all Region of Interest (ROI) implementations. .. py:method:: get_coordinates() Gets the coordinates that define this ROI's position and shape. This is an abstract method that must be implemented by subclasses. Implementations should return either a dictionary with descriptive keys or a tuple of coordinates, depending on the value of self.description. :returns: The coordinates defining the ROI's position and shape. :rtype: dict or tuple :raises NotImplementedError: This method must be implemented by subclasses. .. py:method:: get_data_from_image(image_item: pg.ImageItem | None = None, returnMappedCoords: bool = False, **kwargs) Wrapper around `pyqtgraph.ROI.getArrayRegion`. :param image_item: The ImageItem to sample. If None, auto-detects the first `ImageItem` in the same GraphicsScene as this ROI. :type image_item: pg.ImageItem or None :param returnMappedCoords: If True, also returns the coordinate array generated by *getArrayRegion*. :type returnMappedCoords: bool :param \*\*kwargs: Additional keyword arguments passed to *getArrayRegion* or *affineSlice*, such as `axes`, `order`, `shape`, etc. :returns: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True. :rtype: ndarray .. py:method:: set_position(x: float, y: float) Sets the position of the ROI. :param x: The x-coordinate of the new position. :type x: float :param y: The y-coordinate of the new position. :type y: float .. py:property:: label :type: str Gets the display name of this ROI. :returns: The current name of the ROI. :rtype: str .. py:property:: line_color :type: str Gets the current line color of the ROI. :returns: The current line color as a string (e.g., hex color code). :rtype: str .. py:property:: line_width :type: int Gets the current line width of the ROI. :returns: The current line width in pixels. :rtype: int .. py:property:: movable :type: bool Gets whether this ROI is movable. :returns: True if the ROI can be moved, False otherwise. :rtype: bool .. py:class:: CircularROI(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Circular Region of Interest with center/diameter tracking and auto-labeling. .. py:method:: get_coordinates(typed: bool | None = None) -> dict | tuple Calculates and returns the coordinates and size of an object, either as a typed dictionary or as a tuple. :param typed: If True, returns coordinates as a dictionary. Defaults to None, which utilizes the object's description value. :type typed: bool | None :returns: A dictionary with keys 'center_x', 'center_y', 'diameter', and 'radius' if `typed` is True. tuple: A tuple containing (center_x, center_y, diameter, radius) if `typed` is False. :rtype: dict .. py:method:: get_data_from_image(image_item: pg.ImageItem | None = None, returnMappedCoords: bool = False, **kwargs) Wrapper around `pyqtgraph.ROI.getArrayRegion`. :param image_item: The ImageItem to sample. If None, auto-detects the first `ImageItem` in the same GraphicsScene as this ROI. :type image_item: pg.ImageItem or None :param returnMappedCoords: If True, also returns the coordinate array generated by *getArrayRegion*. :type returnMappedCoords: bool :param \*\*kwargs: Additional keyword arguments passed to *getArrayRegion* or *affineSlice*, such as `axes`, `order`, `shape`, etc. :returns: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True. :rtype: ndarray .. py:method:: set_position(x: float, y: float) Sets the position of the ROI. :param x: The x-coordinate of the new position. :type x: float :param y: The y-coordinate of the new position. :type y: float .. py:property:: label :type: str Gets the display name of this ROI. :returns: The current name of the ROI. :rtype: str .. py:property:: line_color :type: str Gets the current line color of the ROI. :returns: The current line color as a string (e.g., hex color code). :rtype: str .. py:property:: line_width :type: int Gets the current line width of the ROI. :returns: The current line width in pixels. :rtype: int .. py:property:: movable :type: bool Gets whether this ROI is movable. :returns: True if the ROI can be moved, False otherwise. :rtype: bool .. py:class:: Curve(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: _get_displayed_data() -> tuple[np.ndarray, np.ndarray] Get the displayed data of the curve. :returns: The x and y data of the curve. :rtype: tuple[np.ndarray, np.ndarray] .. py:method:: get_data() -> tuple[np.ndarray | None, np.ndarray | None] Get the data of the curve. :returns: X and Y data of the curve. :rtype: tuple[np.ndarray,np.ndarray] .. py:method:: remove() Remove the curve from the plot. .. py:method:: set(**kwargs) Set the properties of the curve. :param \*\*kwargs: Keyword arguments for the properties to be set. Possible properties: - color: str - symbol: str - symbol_color: str - symbol_size: int - pen_width: int - pen_style: Literal["solid", "dash", "dot", "dashdot"] .. py:method:: set_color(color: str, symbol_color: str | None = None) Change the color of the curve. :param color: Color of the curve. :type color: str :param symbol_color: Color of the symbol. Defaults to None. :type symbol_color: str, optional .. py:method:: set_color_map_z(colormap: str) Set the colormap for the scatter plot z gradient. :param colormap: Colormap for the scatter plot. :type colormap: str .. py:method:: set_data(x: list | np.ndarray, y: list | np.ndarray) Set the data of the curve. :param x: The x data. :type x: list|np.ndarray :param y: The y data. :type y: list|np.ndarray :raises ValueError: If the source is not custom. .. py:method:: set_pen_style(pen_style: Literal['solid', 'dash', 'dot', 'dashdot']) Change the pen style of the curve. :param pen_style: Style of the pen. :type pen_style: Literal["solid", "dash", "dot", "dashdot"] .. py:method:: set_pen_width(pen_width: int) Change the pen width of the curve. :param pen_width: Width of the pen. :type pen_width: int .. py:method:: set_symbol(symbol: str) Change the symbol of the curve. :param symbol: Symbol of the curve. :type symbol: str .. py:method:: set_symbol_color(symbol_color: str) Change the symbol color of the curve. :param symbol_color: Color of the symbol. :type symbol_color: str .. py:method:: set_symbol_size(symbol_size: int) Change the symbol size of the curve. :param symbol_size: Size of the symbol. :type symbol_size: int .. py:property:: _config_dict :type: dict Get the configuration of the widget. :returns: The configuration of the widget. :rtype: dict .. py:property:: _rpc_id :type: str Get the RPC ID of the widget. .. py:property:: dap_oversample Get the dap oversample. .. py:property:: dap_params Get the dap parameters. .. py:property:: dap_summary Get the dap summary. .. py:class:: DapComboBox(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Editable combobox listing the available DAP models. .. py:method:: select_fit_model(fit_name: str | None) Slot to update the fit model. :param fit_name: Fit model name. :type fit_name: str .. py:method:: select_x_axis(x_axis: str) Slot to update the x axis. :param x_axis: X axis. :type x_axis: str .. py:method:: select_y_axis(y_axis: str) Slot to update the y axis. :param y_axis: Y axis. :type y_axis: str .. py:class:: DeveloperView(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A view for users to write scripts and macros and execute them within the application. .. py:method:: activate() -> None Switch the parent application to this view. .. py:class:: DeviceBrowser(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` DeviceBrowser is a widget that displays all available devices in the current BEC session. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: DeviceInitializationProgressBar(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A progress bar that displays the progress of device initialization. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: DeviceInputBase(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Mixin base class for device input widgets. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: DeviceManagerView(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A view for users to manage devices within the application. .. py:method:: activate() -> None Switch the parent application to this view. .. py:class:: DockAreaView(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Modular dock area view for arranging and managing multiple dockable widgets. .. py:method:: activate() -> None Switch the parent application to this view. .. py:method:: attach_all() Re-attach floating docks back into the dock manager. .. py:method:: delete(object_name: str) -> bool Remove a widget from the dock area by its object name. :param object_name: The object name of the widget to remove. :returns: True if the widget was found and removed, False otherwise. :rtype: bool :raises ValueError: If no widget with the given object name is found. .. rubric:: Example >>> dock_area.delete("my_widget") True .. py:method:: delete_all() Delete all docks and their associated widgets. .. py:method:: delete_profile(name: str | None = None, show_dialog: bool = False) -> bool Delete a workspace profile. :param name: The name of the profile to delete. If None, uses the currently selected profile from the toolbar combo box (for UI usage). :param show_dialog: If True, show confirmation dialog before deletion. Defaults to False for CLI/programmatic usage. :returns: True if the profile was deleted, False otherwise. :rtype: bool :raises ValueError: If the profile is read-only or doesn't exist (when show_dialog=False). .. py:method:: describe_layout() -> list[dict[str, Any]] Return metadata describing splitter paths, orientations, and contained docks. Useful for determining the keys to use in `set_layout_ratios(splitter_overrides=...)`. .. py:method:: list_profiles() -> list[str] List available workspace profiles in the current namespace. :returns: List of profile names. :rtype: list[str] .. py:method:: load_profile(name: str | None = None) Load a workspace profile. Before switching, persist the current profile to the user copy. Prefer loading the user copy; fall back to the default copy. :param name: The name of the profile to load. If None, prompts the user. :type name: str | None .. py:method:: new(widget: QWidget | str, *, closable: bool = True, floatable: bool = True, movable: bool = True, start_floating: bool = False, where: Literal['left', 'right', 'top', 'bottom'] | None = None, tab_with: CDockWidget | QWidget | str | None = None, relative_to: CDockWidget | QWidget | str | None = None, show_title_bar: bool | None = None, title_buttons: Mapping[str, bool] | Sequence[str] | str | None = None, show_settings_action: bool | None = None, promote_central: bool = False, object_name: str | None = None, **widget_kwargs) -> QWidget | BECWidget Create a new widget (or reuse an instance) and add it as a dock. :param widget: Instance or registered widget type string. :type widget: QWidget | str :param closable: Whether the dock is closable. :type closable: bool :param floatable: Whether the dock is floatable. :type floatable: bool :param movable: Whether the dock is movable. :type movable: bool :param start_floating: Whether to start the dock floating. :type start_floating: bool :param where: Dock placement hint relative to the dock area (ignored when ``relative_to`` is provided without an explicit value). :type where: Literal["left", "right", "top", "bottom"] | None :param tab_with: Existing dock (or widget/name) to tab the new dock alongside. :type tab_with: CDockWidget | QWidget | str | None :param relative_to: Existing dock (or widget/name) used as the positional anchor. When supplied and ``where`` is ``None``, the new dock inherits the anchor's current dock area. :type relative_to: CDockWidget | QWidget | str | None :param show_title_bar: Explicitly show or hide the dock area's title bar. :type show_title_bar: bool | None :param title_buttons: Mapping or iterable describing which title bar buttons should remain visible. Provide a mapping of button names (``"float"``, ``"close"``, ``"menu"``, ``"auto_hide"``, ``"minimize"``) to booleans, or a sequence of button names to hide. :type title_buttons: Mapping[str, bool] | Sequence[str] | str | None :param show_settings_action: Control whether a dock settings/property action should be installed. Defaults to ``False`` for the basic dock area; subclasses such as `BECDockArea` override the default to ``True``. :type show_settings_action: bool | None :param promote_central: When True, promote the created dock to be the dock manager's central widget (useful for editor stacks or other root content). :type promote_central: bool :param object_name: Optional object name to assign to the created widget. :type object_name: str | None :param \*\*widget_kwargs: Additional keyword arguments passed to the widget constructor when creating by type name. :returns: The created or reused widget instance. :rtype: BECWidget .. py:method:: save_profile(name: str | None = None, *, show_dialog: bool = False, quick_select: bool | None = None) Save the current workspace profile. On first save of a given name: - writes a default copy to states/default/.ini with tag=default and created_at - writes a user copy to states/user/.ini with tag=user and created_at On subsequent saves of user-owned profiles: - updates both the default and user copies so restore uses the latest snapshot. Read-only bundled profiles cannot be overwritten. :param name: The name of the profile to save. If None and show_dialog is True, prompts the user. :type name: str | None :param show_dialog: If True, shows the SaveProfileDialog for user interaction. If False (default), saves directly without user interaction (useful for CLI usage). :type show_dialog: bool :param quick_select: Whether to include the profile in quick selection. If None (default), uses the existing value or True for new profiles. Only used when show_dialog is False; otherwise the dialog provides the value. :type quick_select: bool | None .. py:method:: set_layout_ratios(*, horizontal: Sequence[float] | Mapping[int | str, float] | None = None, vertical: Sequence[float] | Mapping[int | str, float] | None = None, splitter_overrides: Mapping[int | str | Sequence[int], Sequence[float] | Mapping[int | str, float]] | None = None) -> None Adjust splitter ratios in the dock layout. :param horizontal: Weights applied to every horizontal splitter encountered. :param vertical: Weights applied to every vertical splitter encountered. :param splitter_overrides: Optional overrides targeting specific splitters identified by their index path (e.g. ``{0: [1, 2], (1, 0): [3, 5]}``). Paths are zero-based indices following the splitter hierarchy, starting from the root splitter. .. rubric:: Example To build three columns with custom per-column ratios:: area.set_layout_ratios( horizontal=[1, 2, 1], # column widths splitter_overrides={ 0: [1, 2], # column 0 (two rows) 1: [3, 2, 1], # column 1 (three rows) 2: [1], # column 2 (single row) }, ) .. py:method:: widget_list(bec_widgets_only: bool = True) -> list[QWidget] Return a list of widgets contained in the dock area. :param bec_widgets_only: If True, only include widgets that are BECConnector instances. :type bec_widgets_only: bool .. py:method:: widget_map(bec_widgets_only: bool = True) -> dict[str, QWidget] Return a dictionary mapping widget names to their corresponding widgets. :param bec_widgets_only: If True, only include widgets that are BECConnector instances. :type bec_widgets_only: bool .. py:property:: mode :type: str None .. py:property:: workspace_is_locked :type: bool Get or set the lock state of the workspace. :returns: True if the workspace is locked, False otherwise. :rtype: bool .. py:class:: DockAreaWidget(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Lightweight dock area that exposes the core Qt ADS docking helpers without any .. py:method:: attach_all() Re-attach floating docks back into the dock manager. .. py:method:: delete(object_name: str) -> bool Remove a widget from the dock area by its object name. :param object_name: The object name of the widget to remove. :returns: True if the widget was found and removed, False otherwise. :rtype: bool :raises ValueError: If no widget with the given object name is found. .. rubric:: Example >>> dock_area.delete("my_widget") True .. py:method:: delete_all() Delete all docks and their associated widgets. .. py:method:: describe_layout() -> list[dict[str, Any]] Return metadata describing splitter paths, orientations, and contained docks. Useful for determining the keys to use in `set_layout_ratios(splitter_overrides=...)`. .. py:method:: dock_list() -> list[CDockWidget] Return the list of dock widgets. .. py:method:: dock_map() -> dict[str, CDockWidget] Return the dock widgets map as dictionary with names as keys. .. py:method:: new(widget: QWidget | str, *, closable: bool = True, floatable: bool = True, movable: bool = True, start_floating: bool = False, floating_state: Mapping[str, object] | None = None, where: Literal['left', 'right', 'top', 'bottom'] | None = None, on_close: Callable[[CDockWidget, QWidget], None] | None = None, tab_with: CDockWidget | QWidget | str | None = None, relative_to: CDockWidget | QWidget | str | None = None, return_dock: bool = False, show_title_bar: bool | None = None, title_buttons: Mapping[str, bool] | Sequence[str] | str | None = None, show_settings_action: bool | None = False, promote_central: bool = False, dock_icon: QIcon | None = None, apply_widget_icon: bool = True, object_name: str | None = None, **widget_kwargs) -> QWidget | CDockWidget | BECWidget Create a new widget (or reuse an instance) and add it as a dock. :param widget: Instance or registered widget type string. :type widget: QWidget | str :param closable: Whether the dock is closable. :type closable: bool :param floatable: Whether the dock is floatable. :type floatable: bool :param movable: Whether the dock is movable. :type movable: bool :param start_floating: Whether to start the dock floating. :type start_floating: bool :param floating_state: Optional floating geometry metadata to apply when floating. :type floating_state: Mapping | None :param where: Dock placement hint relative to the dock area (ignored when ``relative_to`` is provided without an explicit value). :type where: Literal["left", "right", "top", "bottom"] | None :param on_close: Optional custom close handler accepting (dock, widget). :type on_close: Callable[[CDockWidget, QWidget], None] | None :param tab_with: Existing dock (or widget/name) to tab the new dock alongside. :type tab_with: CDockWidget | QWidget | str | None :param relative_to: Existing dock (or widget/name) used as the positional anchor. When supplied and ``where`` is ``None``, the new dock inherits the anchor's current dock area. :type relative_to: CDockWidget | QWidget | str | None :param return_dock: When True, return the created dock instead of the widget. :type return_dock: bool :param show_title_bar: Explicitly show or hide the dock area's title bar. :type show_title_bar: bool | None :param title_buttons: Mapping or iterable describing which title bar buttons should remain visible. Provide a mapping of button names (``"float"``, ``"close"``, ``"menu"``, ``"auto_hide"``, ``"minimize"``) to booleans, or a sequence of button names to hide. :type title_buttons: Mapping[str, bool] | Sequence[str] | str | None :param show_settings_action: Control whether a dock settings/property action should be installed. Defaults to ``False`` for the basic dock area; subclasses such as `BECDockArea` override the default to ``True``. :type show_settings_action: bool | None :param promote_central: When True, promote the created dock to be the dock manager's central widget (useful for editor stacks or other root content). :type promote_central: bool :param dock_icon: Optional icon applied to the dock via ``CDockWidget.setIcon``. Provide a `QIcon` (e.g. from ``material_icon``). When ``None`` (default), the widget's ``ICON_NAME`` attribute is used when available. :type dock_icon: QIcon | None :param apply_widget_icon: When False, skip automatically resolving the icon from the widget's ``ICON_NAME`` (useful for callers who want no icon and do not pass one explicitly). :type apply_widget_icon: bool :param object_name: Optional object name to assign to the created widget. :type object_name: str | None :param \*\*widget_kwargs: Additional keyword arguments passed to the widget constructor when creating by type name. :returns: The widget instance by default, or the created `CDockWidget` when `return_dock` is True. .. py:method:: print_layout_structure() -> None Pretty-print the current splitter paths to stdout. .. py:method:: set_central_dock(dock: CDockWidget | QWidget | str) -> None Promote an existing dock to be the dock manager's central widget. :param dock: Dock reference to promote. :type dock: CDockWidget | QWidget | str .. py:method:: set_layout_ratios(*, horizontal: Sequence[float] | Mapping[int | str, float] | None = None, vertical: Sequence[float] | Mapping[int | str, float] | None = None, splitter_overrides: Mapping[int | str | Sequence[int], Sequence[float] | Mapping[int | str, float]] | None = None) -> None Adjust splitter ratios in the dock layout. :param horizontal: Weights applied to every horizontal splitter encountered. :param vertical: Weights applied to every vertical splitter encountered. :param splitter_overrides: Optional overrides targeting specific splitters identified by their index path (e.g. ``{0: [1, 2], (1, 0): [3, 5]}``). Paths are zero-based indices following the splitter hierarchy, starting from the root splitter. .. rubric:: Example To build three columns with custom per-column ratios:: area.set_layout_ratios( horizontal=[1, 2, 1], # column widths splitter_overrides={ 0: [1, 2], # column 0 (two rows) 1: [3, 2, 1], # column 1 (three rows) 2: [1], # column 2 (single row) }, ) .. py:method:: widget_list(bec_widgets_only: bool = True) -> list[QWidget] Return a list of widgets contained in the dock area. :param bec_widgets_only: If True, only include widgets that are BECConnector instances. :type bec_widgets_only: bool .. py:method:: widget_map(bec_widgets_only: bool = True) -> dict[str, QWidget] Return a dictionary mapping widget names to their corresponding widgets. :param bec_widgets_only: If True, only include widgets that are BECConnector instances. :type bec_widgets_only: bool .. py:class:: EllipticalROI(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Elliptical Region of Interest with centre/width/height tracking and auto-labelling. .. py:method:: get_coordinates(typed: bool | None = None) -> dict | tuple Return the ellipse's centre and size. :param typed: If True returns dict; otherwise tuple. :type typed: bool | None .. py:method:: get_data_from_image(image_item: pg.ImageItem | None = None, returnMappedCoords: bool = False, **kwargs) Wrapper around `pyqtgraph.ROI.getArrayRegion`. :param image_item: The ImageItem to sample. If None, auto-detects the first `ImageItem` in the same GraphicsScene as this ROI. :type image_item: pg.ImageItem or None :param returnMappedCoords: If True, also returns the coordinate array generated by *getArrayRegion*. :type returnMappedCoords: bool :param \*\*kwargs: Additional keyword arguments passed to *getArrayRegion* or *affineSlice*, such as `axes`, `order`, `shape`, etc. :returns: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True. :rtype: ndarray .. py:method:: set_position(x: float, y: float) Sets the position of the ROI. :param x: The x-coordinate of the new position. :type x: float :param y: The y-coordinate of the new position. :type y: float .. py:property:: label :type: str Gets the display name of this ROI. :returns: The current name of the ROI. :rtype: str .. py:property:: line_color :type: str Gets the current line color of the ROI. :returns: The current line color as a string (e.g., hex color code). :rtype: str .. py:property:: line_width :type: int Gets the current line width of the ROI. :returns: The current line width in pixels. :rtype: int .. py:property:: movable :type: bool Gets whether this ROI is movable. :returns: True if the ROI can be moved, False otherwise. :rtype: bool .. py:class:: Heatmap(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Heatmap widget for visualizing 2d grid data with color mapping for the z-axis. .. py:method:: add_roi(kind: Literal['rect', 'circle', 'ellipse'] = 'rect', name: str | None = None, line_width: int | None = 5, pos: tuple[float, float] | None = (10, 10), size: tuple[float, float] | None = (50, 50), movable: bool = True, **pg_kwargs) -> RectangularROI | CircularROI Add a ROI to the image. :param kind: The type of ROI to add. Options are "rect" or "circle". :type kind: str :param name: The name of the ROI. :type name: str :param line_width: The line width of the ROI. :type line_width: int :param pos: The position of the ROI. :type pos: tuple :param size: The size of the ROI. :type size: tuple :param movable: Whether the ROI is movable. :type movable: bool :param \*\*pg_kwargs: Additional arguments for the ROI. :returns: The created ROI object. :rtype: RectangularROI | CircularROI .. py:method:: attach() None .. py:method:: auto_range(value: bool = True) On demand apply autorange to the plot item based on the visible curves. :param value: If True, apply autorange to the visible curves. :type value: bool .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: enable_colorbar(enabled: bool, style: Literal['full', 'simple'] = 'full', vrange: tuple[int, int] | None = None) Enable the colorbar and switch types of colorbars. :param enabled: Whether to enable the colorbar. :type enabled: bool :param style: The type of colorbar to enable. :type style: Literal["full", "simple"] :param vrange: The range of values to use for the colorbar. :type vrange: tuple .. py:method:: plot(device_x: str, device_y: str, device_z: str, signal_x: None | str = None, signal_y: None | str = None, signal_z: None | str = None, color_map: str | None = 'plasma', validate_bec: bool = True, interpolation: Literal['linear', 'nearest'] | None = None, enforce_interpolation: bool | None = None, oversampling_factor: float | None = None, lock_aspect_ratio: bool | None = None, show_config_label: bool | None = None, reload: bool = False) Plot the heatmap with the given x, y, and z data. :param device_x: The name of the x-axis device signal. :type device_x: str :param device_y: The name of the y-axis device signal. :type device_y: str :param device_z: The name of the z-axis device signal. :type device_z: str :param signal_x: The entry for the x-axis device signal. :type signal_x: str | None :param signal_y: The entry for the y-axis device signal. :type signal_y: str | None :param signal_z: The entry for the z-axis device signal. :type signal_z: str | None :param color_map: The color map to use for the heatmap. :type color_map: str | None :param validate_bec: Whether to validate the entries against BEC signals. :type validate_bec: bool :param interpolation: The interpolation method to use. :type interpolation: Literal["linear", "nearest"] | None :param enforce_interpolation: Whether to enforce interpolation even for grid scans. :type enforce_interpolation: bool | None :param oversampling_factor: Factor to oversample the grid resolution. :type oversampling_factor: float | None :param lock_aspect_ratio: Whether to lock the aspect ratio of the image. :type lock_aspect_ratio: bool | None :param show_config_label: Whether to show the configuration label in the heatmap. :type show_config_label: bool | None :param reload: Whether to reload the heatmap with new data. :type reload: bool .. py:method:: remove() Cleanup the BECConnector .. py:method:: remove_roi(roi: int | str) Remove an ROI by index or label via the ROIController. .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set(**kwargs) Set the properties of the plot widget. :param \*\*kwargs: Keyword arguments for the properties to be set. Possible properties: - title: str - x_label: str - y_label: str - x_scale: Literal["linear", "log"] - y_scale: Literal["linear", "log"] - x_lim: tuple - y_lim: tuple - legend_label_size: int .. py:property:: auto_range_x :type: bool Set auto range for the x-axis. .. py:property:: auto_range_y :type: bool Set auto range for the y-axis. .. py:property:: autorange :type: bool Whether autorange is enabled. .. py:property:: autorange_mode :type: str Autorange mode. Options: - "max": Use the maximum value of the image for autoranging. - "mean": Use the mean value of the image for autoranging. .. py:property:: color_map :type: str Set the color map of the image. .. py:property:: device_x :type: str Device name for the X axis. .. py:property:: device_y :type: str Device name for the Y axis. .. py:property:: device_z :type: str Device name for the Z (color) axis. .. py:property:: enable_fps_monitor :type: bool Enable the FPS monitor. .. py:property:: enable_full_colorbar :type: bool Enable the full colorbar. .. py:property:: enable_side_panel :type: bool Show Side Panel .. py:property:: enable_simple_colorbar :type: bool Enable the simple colorbar. .. py:property:: enable_toolbar :type: bool Show Toolbar. .. py:property:: enforce_interpolation :type: bool Whether to enforce interpolation even for grid scans. .. py:property:: fft :type: bool Whether FFT postprocessing is enabled. .. py:property:: inner_axes :type: bool Show inner axes of the plot widget. .. py:property:: interpolation_method :type: str The interpolation method used for the heatmap. .. py:property:: legend_label_size :type: int The font size of the legend font. .. py:property:: lock_aspect_ratio :type: bool Whether the aspect ratio is locked. .. py:property:: log :type: bool Whether logarithmic scaling is applied. .. py:property:: main_image :type: ImageItem Access the main image item. .. py:property:: minimal_crosshair_precision :type: int Minimum decimal places for crosshair when dynamic precision is enabled. .. py:property:: outer_axes :type: bool Show the outer axes of the plot widget. .. py:property:: oversampling_factor :type: float The oversampling factor for grid resolution. .. py:property:: rois :type: list[BaseROI] Get the list of ROIs. .. py:property:: signal_x :type: str Signal entry for the X axis device. .. py:property:: signal_y :type: str Signal entry for the Y axis device. .. py:property:: signal_z :type: str Signal entry for the Z (color) axis device. .. py:property:: title :type: str Set title of the plot. .. py:property:: v_max :type: float Get the maximum value of the v_range. .. py:property:: v_min :type: float Get the minimum value of the v_range. .. py:property:: v_range :type: QPointF Set the v_range of the main image. .. py:property:: x_grid :type: bool Show grid on the x-axis. .. py:property:: x_label :type: str The set label for the x-axis. .. py:property:: x_limits :type: QPointF Get the x limits of the plot. .. py:property:: x_log :type: bool Set X-axis to log scale if True, linear if False. .. py:property:: y_grid :type: bool Show grid on the y-axis. .. py:property:: y_label :type: str The set label for the y-axis. .. py:property:: y_limits :type: QPointF Get the y limits of the plot. .. py:property:: y_log :type: bool Set Y-axis to log scale if True, linear if False. .. py:class:: Image(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Image widget for displaying 2D data. .. py:method:: add_roi(kind: Literal['rect', 'circle', 'ellipse'] = 'rect', name: str | None = None, line_width: int | None = 5, pos: tuple[float, float] | None = (10, 10), size: tuple[float, float] | None = (50, 50), movable: bool = True, **pg_kwargs) -> RectangularROI | CircularROI Add a ROI to the image. :param kind: The type of ROI to add. Options are "rect" or "circle". :type kind: str :param name: The name of the ROI. :type name: str :param line_width: The line width of the ROI. :type line_width: int :param pos: The position of the ROI. :type pos: tuple :param size: The size of the ROI. :type size: tuple :param movable: Whether the ROI is movable. :type movable: bool :param \*\*pg_kwargs: Additional arguments for the ROI. :returns: The created ROI object. :rtype: RectangularROI | CircularROI .. py:method:: attach() None .. py:method:: auto_range(value: bool = True) On demand apply autorange to the plot item based on the visible curves. :param value: If True, apply autorange to the visible curves. :type value: bool .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: enable_colorbar(enabled: bool, style: Literal['full', 'simple'] = 'full', vrange: tuple[int, int] | None = None) Enable the colorbar and switch types of colorbars. :param enabled: Whether to enable the colorbar. :type enabled: bool :param style: The type of colorbar to enable. :type style: Literal["full", "simple"] :param vrange: The range of values to use for the colorbar. :type vrange: tuple .. py:method:: image(device: str | None = None, signal: str | None = None, color_map: str | None = None, color_bar: Literal['simple', 'full'] | None = None, vrange: tuple[int, int] | None = None) -> ImageItem | None Set the image source and update the image. :param device: The name of the device to monitor. If None or empty string, the current monitor will be disconnected. :type device: str|None :param signal: The signal/entry name to monitor on the device. :type signal: str|None :param color_map: The color map to use for the image. :type color_map: str :param color_bar: The type of color bar to use. Options are "simple" or "full". :type color_bar: str :param vrange: The range of values to use for the color map. :type vrange: tuple :returns: The image object, or None if connection failed. :rtype: ImageItem .. py:method:: remove() Cleanup the BECConnector .. py:method:: remove_roi(roi: int | str) Remove an ROI by index or label via the ROIController. .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set(**kwargs) Set the properties of the plot widget. :param \*\*kwargs: Keyword arguments for the properties to be set. Possible properties: - title: str - x_label: str - y_label: str - x_scale: Literal["linear", "log"] - y_scale: Literal["linear", "log"] - x_lim: tuple - y_lim: tuple - legend_label_size: int .. py:property:: auto_range_x :type: bool Set auto range for the x-axis. .. py:property:: auto_range_y :type: bool Set auto range for the y-axis. .. py:property:: autorange :type: bool Whether autorange is enabled. .. py:property:: autorange_mode :type: str Autorange mode. Options: - "max": Use the maximum value of the image for autoranging. - "mean": Use the mean value of the image for autoranging. .. py:property:: color_map :type: str Set the color map of the image. .. py:property:: device :type: str The name of the device to monitor for image data. .. py:property:: enable_fps_monitor :type: bool Enable the FPS monitor. .. py:property:: enable_full_colorbar :type: bool Enable the full colorbar. .. py:property:: enable_side_panel :type: bool Show Side Panel .. py:property:: enable_simple_colorbar :type: bool Enable the simple colorbar. .. py:property:: enable_toolbar :type: bool Show Toolbar. .. py:property:: fft :type: bool Whether FFT postprocessing is enabled. .. py:property:: inner_axes :type: bool Show inner axes of the plot widget. .. py:property:: legend_label_size :type: int The font size of the legend font. .. py:property:: lock_aspect_ratio :type: bool Whether the aspect ratio is locked. .. py:property:: log :type: bool Whether logarithmic scaling is applied. .. py:property:: main_image :type: ImageItem Access the main image item. .. py:property:: minimal_crosshair_precision :type: int Minimum decimal places for crosshair when dynamic precision is enabled. .. py:property:: num_rotation_90 :type: int The number of 90° rotations to apply counterclockwise. .. py:property:: outer_axes :type: bool Show the outer axes of the plot widget. .. py:property:: rois :type: list[BaseROI] Get the list of ROIs. .. py:property:: signal :type: str The signal/entry name to monitor on the device. .. py:property:: title :type: str Set title of the plot. .. py:property:: transpose :type: bool Whether the image is transposed. .. py:property:: v_max :type: float Get the maximum value of the v_range. .. py:property:: v_min :type: float Get the minimum value of the v_range. .. py:property:: v_range :type: QPointF Set the v_range of the main image. .. py:property:: x_grid :type: bool Show grid on the x-axis. .. py:property:: x_label :type: str The set label for the x-axis. .. py:property:: x_limits :type: QPointF Get the x limits of the plot. .. py:property:: x_log :type: bool Set X-axis to log scale if True, linear if False. .. py:property:: y_grid :type: bool Show grid on the y-axis. .. py:property:: y_label :type: str The set label for the y-axis. .. py:property:: y_limits :type: QPointF Get the y limits of the plot. .. py:property:: y_log :type: bool Set Y-axis to log scale if True, linear if False. .. py:class:: ImageItem(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: get_data() -> np.ndarray Get the data of the image. :returns: The data of the image. :rtype: np.ndarray .. py:property:: autorange :type: bool None .. py:property:: autorange_mode :type: str None .. py:property:: color_map :type: str Get the current color map. .. py:property:: fft :type: bool Get or set whether FFT postprocessing is enabled. .. py:property:: log :type: bool Get or set whether logarithmic scaling is applied. .. py:property:: num_rotation_90 :type: Optional[int] Get or set the number of 90° rotations to apply. .. py:property:: transpose :type: bool Get or set whether the image is transposed. .. py:property:: v_max :type: float None .. py:property:: v_min :type: float None .. py:property:: v_range :type: tuple[float, float] Get the color intensity range of the image. .. py:class:: LaunchWindow(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: hide_launcher() Hide the launcher window. .. py:method:: show_launcher() Show the launcher window. .. py:class:: LogPanel(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Displays a log panel .. py:method:: set_html_text(text: str) -> None Set the HTML text of the widget. :param text: The text to set. :type text: str .. py:method:: set_plain_text(text: str) -> None Set the plain text of the widget. :param text: The text to set. :type text: str .. py:class:: Minesweeper(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:class:: MonacoDock(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` MonacoDock is a dock widget that contains Monaco editor instances. .. py:method:: attach_all() Re-attach floating docks back into the dock manager. .. py:method:: delete(object_name: str) -> bool Remove a widget from the dock area by its object name. :param object_name: The object name of the widget to remove. :returns: True if the widget was found and removed, False otherwise. :rtype: bool :raises ValueError: If no widget with the given object name is found. .. rubric:: Example >>> dock_area.delete("my_widget") True .. py:method:: delete_all() Delete all docks and their associated widgets. .. py:method:: describe_layout() -> list[dict[str, Any]] Return metadata describing splitter paths, orientations, and contained docks. Useful for determining the keys to use in `set_layout_ratios(splitter_overrides=...)`. .. py:method:: dock_list() -> list[CDockWidget] Return the list of dock widgets. .. py:method:: dock_map() -> dict[str, CDockWidget] Return the dock widgets map as dictionary with names as keys. .. py:method:: new(widget: QWidget | str, *, closable: bool = True, floatable: bool = True, movable: bool = True, start_floating: bool = False, floating_state: Mapping[str, object] | None = None, where: Literal['left', 'right', 'top', 'bottom'] | None = None, on_close: Callable[[CDockWidget, QWidget], None] | None = None, tab_with: CDockWidget | QWidget | str | None = None, relative_to: CDockWidget | QWidget | str | None = None, return_dock: bool = False, show_title_bar: bool | None = None, title_buttons: Mapping[str, bool] | Sequence[str] | str | None = None, show_settings_action: bool | None = False, promote_central: bool = False, dock_icon: QIcon | None = None, apply_widget_icon: bool = True, object_name: str | None = None, **widget_kwargs) -> QWidget | CDockWidget | BECWidget Create a new widget (or reuse an instance) and add it as a dock. :param widget: Instance or registered widget type string. :type widget: QWidget | str :param closable: Whether the dock is closable. :type closable: bool :param floatable: Whether the dock is floatable. :type floatable: bool :param movable: Whether the dock is movable. :type movable: bool :param start_floating: Whether to start the dock floating. :type start_floating: bool :param floating_state: Optional floating geometry metadata to apply when floating. :type floating_state: Mapping | None :param where: Dock placement hint relative to the dock area (ignored when ``relative_to`` is provided without an explicit value). :type where: Literal["left", "right", "top", "bottom"] | None :param on_close: Optional custom close handler accepting (dock, widget). :type on_close: Callable[[CDockWidget, QWidget], None] | None :param tab_with: Existing dock (or widget/name) to tab the new dock alongside. :type tab_with: CDockWidget | QWidget | str | None :param relative_to: Existing dock (or widget/name) used as the positional anchor. When supplied and ``where`` is ``None``, the new dock inherits the anchor's current dock area. :type relative_to: CDockWidget | QWidget | str | None :param return_dock: When True, return the created dock instead of the widget. :type return_dock: bool :param show_title_bar: Explicitly show or hide the dock area's title bar. :type show_title_bar: bool | None :param title_buttons: Mapping or iterable describing which title bar buttons should remain visible. Provide a mapping of button names (``"float"``, ``"close"``, ``"menu"``, ``"auto_hide"``, ``"minimize"``) to booleans, or a sequence of button names to hide. :type title_buttons: Mapping[str, bool] | Sequence[str] | str | None :param show_settings_action: Control whether a dock settings/property action should be installed. Defaults to ``False`` for the basic dock area; subclasses such as `BECDockArea` override the default to ``True``. :type show_settings_action: bool | None :param promote_central: When True, promote the created dock to be the dock manager's central widget (useful for editor stacks or other root content). :type promote_central: bool :param dock_icon: Optional icon applied to the dock via ``CDockWidget.setIcon``. Provide a `QIcon` (e.g. from ``material_icon``). When ``None`` (default), the widget's ``ICON_NAME`` attribute is used when available. :type dock_icon: QIcon | None :param apply_widget_icon: When False, skip automatically resolving the icon from the widget's ``ICON_NAME`` (useful for callers who want no icon and do not pass one explicitly). :type apply_widget_icon: bool :param object_name: Optional object name to assign to the created widget. :type object_name: str | None :param \*\*widget_kwargs: Additional keyword arguments passed to the widget constructor when creating by type name. :returns: The widget instance by default, or the created `CDockWidget` when `return_dock` is True. .. py:method:: print_layout_structure() -> None Pretty-print the current splitter paths to stdout. .. py:method:: set_central_dock(dock: CDockWidget | QWidget | str) -> None Promote an existing dock to be the dock manager's central widget. :param dock: Dock reference to promote. :type dock: CDockWidget | QWidget | str .. py:method:: set_layout_ratios(*, horizontal: Sequence[float] | Mapping[int | str, float] | None = None, vertical: Sequence[float] | Mapping[int | str, float] | None = None, splitter_overrides: Mapping[int | str | Sequence[int], Sequence[float] | Mapping[int | str, float]] | None = None) -> None Adjust splitter ratios in the dock layout. :param horizontal: Weights applied to every horizontal splitter encountered. :param vertical: Weights applied to every vertical splitter encountered. :param splitter_overrides: Optional overrides targeting specific splitters identified by their index path (e.g. ``{0: [1, 2], (1, 0): [3, 5]}``). Paths are zero-based indices following the splitter hierarchy, starting from the root splitter. .. rubric:: Example To build three columns with custom per-column ratios:: area.set_layout_ratios( horizontal=[1, 2, 1], # column widths splitter_overrides={ 0: [1, 2], # column 0 (two rows) 1: [3, 2, 1], # column 1 (three rows) 2: [1], # column 2 (single row) }, ) .. py:method:: widget_list(bec_widgets_only: bool = True) -> list[QWidget] Return a list of widgets contained in the dock area. :param bec_widgets_only: If True, only include widgets that are BECConnector instances. :type bec_widgets_only: bool .. py:method:: widget_map(bec_widgets_only: bool = True) -> dict[str, QWidget] Return a dictionary mapping widget names to their corresponding widgets. :param bec_widgets_only: If True, only include widgets that are BECConnector instances. :type bec_widgets_only: bool .. py:class:: MonacoWidget(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A simple Monaco editor widget .. py:method:: attach() None .. py:method:: current_cursor() -> dict[str, int] Get the current cursor position in the Monaco editor. :returns: A dictionary with keys 'line' and 'column' representing the cursor position. :rtype: dict[str, int] .. py:method:: delete_line(line: int | None = None) -> None Delete a line in the Monaco editor. :param line: The line number (1-based) to delete. If None, the current line will be deleted. :type line: int, optional .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: get_language() -> str Get the current programming language set in the Monaco editor. .. py:method:: get_lsp_header() -> str Get the current LSP header set in the Monaco editor. :returns: The LSP header. :rtype: str .. py:method:: get_text() -> str Get the current text from the Monaco editor. .. py:method:: get_theme() -> str Get the current theme of the Monaco editor. .. py:method:: insert_text(text: str, line: int | None = None, column: int | None = None) -> None Insert text at the current cursor position or at a specified line and column. :param text: The text to insert. :type text: str :param line: The line number (1-based) to insert the text at. Defaults to None. :type line: int, optional :param column: The column number (1-based) to insert the text at. Defaults to None. :type column: int, optional .. py:method:: open_file(file_name: str) -> None Open a file in the editor. :param file_name: The path + file name of the file that needs to be displayed. :type file_name: str .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set_cursor(line: int, column: int = 1, move_to_position: Literal[None, 'center', 'top', 'position'] = None) -> None Set the cursor position in the Monaco editor. :param line: Line number (1-based). :type line: int :param column: Column number (1-based), defaults to 1. :type column: int :param move_to_position: Position to move the cursor to. :type move_to_position: Literal[None, "center", "top", "position"], optional .. py:method:: set_language(language: str) -> None Set the programming language for syntax highlighting in the Monaco editor. :param language: The programming language to set (e.g., "python", "javascript"). :type language: str .. py:method:: set_lsp_header(header: str) -> None Set the LSP (Language Server Protocol) header for the Monaco editor. The header is used to provide context for language servers but is not displayed in the editor. :param header: The LSP header to set. :type header: str .. py:method:: set_minimap_enabled(enabled: bool) -> None Enable or disable the minimap in the Monaco editor. :param enabled: If True, the minimap will be enabled; otherwise, it will be disabled. :type enabled: bool .. py:method:: set_readonly(read_only: bool) -> None Set the Monaco editor to read-only mode. :param read_only: If True, the editor will be read-only. :type read_only: bool .. py:method:: set_text(text: str, file_name: str | None = None, reset: bool = False) -> None Set the text in the Monaco editor. :param text: The text to set in the editor. :type text: str :param file_name: Set the file name :type file_name: str :param reset: If True, reset the original content to the new text. :type reset: bool .. py:method:: set_theme(theme: str) -> None Set the theme for the Monaco editor. :param theme: The theme to set (e.g., "vs-dark", "light"). :type theme: str .. py:method:: set_vim_mode_enabled(enabled: bool) -> None Enable or disable Vim mode in the Monaco editor. :param enabled: If True, Vim mode will be enabled; otherwise, it will be disabled. :type enabled: bool .. py:class:: MotorMap(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Motor map widget for plotting motor positions in 2D including a trace of the last points. .. py:method:: attach() None .. py:method:: auto_range(value: bool = True) On demand apply autorange to the plot item based on the visible curves. :param value: If True, apply autorange to the visible curves. :type value: bool .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: get_data() -> dict Get the data of the motor map. :returns: Data of the motor map. :rtype: dict .. py:method:: map(device_x: str, device_y: str, validate_bec: bool = True, suppress_errors=False) -> None Set the x and y motor names. :param device_x: The name of the x motor. :type device_x: str :param device_y: The name of the y motor. :type device_y: str :param validate_bec: If True, validate the signal with BEC. Defaults to True. :type validate_bec: bool, optional :param suppress_errors: If True, suppress errors during validation. Defaults to False. Used for properties setting. If the validation fails, the changes are not applied. :type suppress_errors: bool, optional .. py:method:: remove() Cleanup the BECConnector .. py:method:: reset_history() Reset the history of the motor map. .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set(**kwargs) Set the properties of the plot widget. :param \*\*kwargs: Keyword arguments for the properties to be set. Possible properties: - title: str - x_label: str - y_label: str - x_scale: Literal["linear", "log"] - y_scale: Literal["linear", "log"] - x_lim: tuple - y_lim: tuple - legend_label_size: int .. py:property:: auto_range_x :type: bool Set auto range for the x-axis. .. py:property:: auto_range_y :type: bool Set auto range for the y-axis. .. py:property:: background_value :type: int Get the background value of the motor map. .. py:property:: color :type: tuple Get the color of the motor trace. :returns: Color of the motor trace. :rtype: tuple .. py:property:: device_x :type: str Name of the motor shown on the X axis. .. py:property:: device_y :type: str Name of the motor shown on the Y axis. .. py:property:: enable_fps_monitor :type: bool Enable the FPS monitor. .. py:property:: enable_side_panel :type: bool Show Side Panel .. py:property:: enable_toolbar :type: bool Show Toolbar. .. py:property:: inner_axes :type: bool Show inner axes of the plot widget. .. py:property:: legend_label_size :type: int The font size of the legend font. .. py:property:: lock_aspect_ratio :type: bool Lock aspect ratio of the plot widget. .. py:property:: max_points :type: int Get the maximum number of points to display. .. py:property:: minimal_crosshair_precision :type: int Minimum decimal places for crosshair when dynamic precision is enabled. .. py:property:: num_dim_points :type: int Get the number of dim points for the motor map. .. py:property:: outer_axes :type: bool Show the outer axes of the plot widget. .. py:property:: precision :type: int Set the decimal precision of the motor position. .. py:property:: scatter_size :type: int Get the scatter size of the motor map plot. .. py:property:: title :type: str Set title of the plot. .. py:property:: x_grid :type: bool Show grid on the x-axis. .. py:property:: x_label :type: str The set label for the x-axis. .. py:property:: x_limits :type: QPointF Get the x limits of the plot. .. py:property:: x_log :type: bool Set X-axis to log scale if True, linear if False. .. py:property:: y_grid :type: bool Show grid on the y-axis. .. py:property:: y_label :type: str The set label for the y-axis. .. py:property:: y_limits :type: QPointF Get the y limits of the plot. .. py:property:: y_log :type: bool Set Y-axis to log scale if True, linear if False. .. py:class:: MultiWaveform(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` MultiWaveform widget for displaying multiple waveforms emitted by a single signal. .. py:method:: attach() None .. py:method:: auto_range(value: bool = True) On demand apply autorange to the plot item based on the visible curves. :param value: If True, apply autorange to the visible curves. :type value: bool .. py:method:: clear_curves() Remove all curves from the plot, excluding crosshair items. .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: plot(monitor: str, color_palette: str | None = 'plasma') Create a plot for the given monitor. :param monitor: The monitor to set. :type monitor: str :param color_palette: The color palette to use for the plot. :type color_palette: str|None .. py:method:: remove() Cleanup the BECConnector .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set(**kwargs) Set the properties of the plot widget. :param \*\*kwargs: Keyword arguments for the properties to be set. Possible properties: - title: str - x_label: str - y_label: str - x_scale: Literal["linear", "log"] - y_scale: Literal["linear", "log"] - x_lim: tuple - y_lim: tuple - legend_label_size: int .. py:method:: set_curve_highlight(index: int) Set the curve highlight based on visible curves. :param index: The index of the curve to highlight among visible curves. :type index: int .. py:method:: set_curve_limit(max_trace: int, flush_buffer: bool) Set the maximum number of traces to display on the plot. :param max_trace: The maximum number of traces to display. :type max_trace: int :param flush_buffer: Flush the buffer. :type flush_buffer: bool .. py:property:: auto_range_x :type: bool Set auto range for the x-axis. .. py:property:: auto_range_y :type: bool Set auto range for the y-axis. .. py:property:: color_palette :type: str The color palette of the figure widget. .. py:property:: enable_fps_monitor :type: bool Enable the FPS monitor. .. py:property:: enable_side_panel :type: bool Show Side Panel .. py:property:: enable_toolbar :type: bool Show Toolbar. .. py:property:: flush_buffer :type: bool The flush_buffer property. .. py:property:: highlight_last_curve :type: bool Get the highlight_last_curve property. :returns: The highlight_last_curve property. :rtype: bool .. py:property:: highlighted_index None .. py:property:: inner_axes :type: bool Show inner axes of the plot widget. .. py:property:: legend_label_size :type: int The font size of the legend font. .. py:property:: lock_aspect_ratio :type: bool Lock aspect ratio of the plot widget. .. py:property:: max_trace :type: int The maximum number of traces to display on the plot. .. py:property:: minimal_crosshair_precision :type: int Minimum decimal places for crosshair when dynamic precision is enabled. .. py:property:: monitor :type: str The monitor of the figure widget. .. py:property:: opacity :type: int The opacity of the figure widget. .. py:property:: outer_axes :type: bool Show the outer axes of the plot widget. .. py:property:: title :type: str Set title of the plot. .. py:property:: x_grid :type: bool Show grid on the x-axis. .. py:property:: x_label :type: str The set label for the x-axis. .. py:property:: x_limits :type: QPointF Get the x limits of the plot. .. py:property:: x_log :type: bool Set X-axis to log scale if True, linear if False. .. py:property:: y_grid :type: bool Show grid on the y-axis. .. py:property:: y_label :type: str The set label for the y-axis. .. py:property:: y_limits :type: QPointF Get the y limits of the plot. .. py:property:: y_log :type: bool Set Y-axis to log scale if True, linear if False. .. py:class:: PdfViewerWidget(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A widget to display PDF documents with toolbar controls. .. py:method:: fit_to_page() Fit PDF to page. .. py:method:: fit_to_width() Fit PDF to width. .. py:method:: go_to_first_page() Go to the first page. .. py:method:: go_to_last_page() Go to the last page. .. py:method:: jump_to_page(page_number: int) Jump to a specific page number (1-based index). .. py:method:: load_pdf(file_path: str) Load a PDF file into the viewer. :param file_path: Path to the PDF file to load. :type file_path: str .. py:method:: next_page() Go to next page. .. py:method:: previous_page() Go to previous page. .. py:method:: reset_zoom() Reset zoom to 100% (1.0 factor). .. py:method:: toggle_continuous_scroll(checked: bool) Toggle between single page and continuous scroll mode. :param checked: True to enable continuous scroll, False for single page mode. :type checked: bool .. py:method:: zoom_in() Zoom in the PDF view. .. py:method:: zoom_out() Zoom out the PDF view. .. py:property:: current_file_path Get the current PDF file path. .. py:property:: current_page Get the current page number (1-based index). .. py:property:: page_spacing Get the spacing between pages in continuous scroll mode. .. py:property:: side_margins Get the horizontal margins (side spacing) around the PDF content. .. py:class:: PositionIndicator(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Display a position within a defined range, e.g. motor limits. .. py:method:: set_range(min_value: float, max_value: float) Set the range of the position indicator :param min_value: Minimum value of the range :type min_value: float :param max_value: Maximum value of the range :type max_value: float .. py:method:: set_value(position: float) Set the position of the indicator :param position: The new position of the indicator .. py:property:: indicator_width Property to get the width of the indicator .. py:property:: rounded_corners Property to get the rounded corners of the position indicator .. py:property:: vertical Property to determine the orientation of the position indicator .. py:class:: PositionerBox(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Simple Widget to control a positioner in box form .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set_positioner(positioner: str | Positioner) Set the device :param positioner: Positioner to set, accepts str or the device :type positioner: Positioner | str .. py:class:: PositionerBox2D(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Simple Widget to control two positioners in box form .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set_positioner_hor(positioner: str | Positioner) Set the device :param positioner: Positioner to set, accepts str or the device :type positioner: Positioner | str .. py:method:: set_positioner_ver(positioner: str | Positioner) Set the device :param positioner: Positioner to set, accepts str or the device :type positioner: Positioner | str .. py:property:: enable_controls_hor :type: bool Persisted switch for horizontal control buttons (tweak/step). .. py:property:: enable_controls_ver :type: bool Persisted switch for vertical control buttons (tweak/step). .. py:class:: PositionerControlLine(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A widget that controls a single device. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set_positioner(positioner: str | Positioner) Set the device :param positioner: Positioner to set, accepts str or the device :type positioner: Positioner | str .. py:class:: PositionerGroup(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Simple Widget to control a positioner in box form .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set_positioners(device_names: str) Redraw grid with positioners from device_names string Device names must be separated by space .. py:class:: RectangularROI(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Defines a rectangular Region of Interest (ROI) with additional functionality. .. py:method:: get_coordinates(typed: bool | None = None) -> dict | tuple Returns the coordinates of a rectangle's corners, rectangle center and dimensions. Supports returning them as either a dictionary with descriptive keys or a tuple of coordinates. :param typed: If True, returns coordinates as a dictionary with descriptive keys. If False, returns them as a tuple. Defaults to the value of `self.description`. :type typed: bool | None :returns: The rectangle's corner coordinates, rectangle center and dimensions, where the format depends on the `typed` parameter. :rtype: dict | tuple .. py:method:: get_data_from_image(image_item: pg.ImageItem | None = None, returnMappedCoords: bool = False, **kwargs) Wrapper around `pyqtgraph.ROI.getArrayRegion`. :param image_item: The ImageItem to sample. If None, auto-detects the first `ImageItem` in the same GraphicsScene as this ROI. :type image_item: pg.ImageItem or None :param returnMappedCoords: If True, also returns the coordinate array generated by *getArrayRegion*. :type returnMappedCoords: bool :param \*\*kwargs: Additional keyword arguments passed to *getArrayRegion* or *affineSlice*, such as `axes`, `order`, `shape`, etc. :returns: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True. :rtype: ndarray .. py:method:: set_position(x: float, y: float) Sets the position of the ROI. :param x: The x-coordinate of the new position. :type x: float :param y: The y-coordinate of the new position. :type y: float .. py:property:: label :type: str Gets the display name of this ROI. :returns: The current name of the ROI. :rtype: str .. py:property:: line_color :type: str Gets the current line color of the ROI. :returns: The current line color as a string (e.g., hex color code). :rtype: str .. py:property:: line_width :type: int Gets the current line width of the ROI. :returns: The current line width in pixels. :rtype: int .. py:property:: movable :type: bool Gets whether this ROI is movable. :returns: True if the ROI can be moved, False otherwise. :rtype: bool .. py:class:: ResumeButton(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A button that continue scan queue. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: Ring(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: set_background(color: str | tuple | QColor) Set the background color for the ring widget. The background color is only used when colors are not linked. :param color: Background color for the ring widget. Can be HEX code or tuple (R, G, B, A). :type color: str | tuple .. py:method:: set_color(color: str | tuple) Set the color for the ring widget :param color: Color for the ring widget. Can be HEX code or tuple (R, G, B, A). :type color: str | tuple .. py:method:: set_colors_linked(linked: bool) Set whether the colors are linked for the ring widget. If colors are linked, changing the main color will also change the background color. :param linked: Whether to link the colors for the ring widget :type linked: bool .. py:method:: set_line_width(width: int) Set the line width for the ring widget :param width: Line width for the ring widget :type width: int .. py:method:: set_min_max_values(min_value: int | float, max_value: int | float) Set the min and max values for the ring widget. :param min_value: Minimum value for the ring widget :type min_value: int | float :param max_value: Maximum value for the ring widget :type max_value: int | float .. py:method:: set_precision(precision: int) Set the precision for the ring widget. :param precision: Precision for the ring widget :type precision: int .. py:method:: set_start_angle(start_angle: int) Set the start angle for the ring widget. :param start_angle: Start angle for the ring widget in degrees :type start_angle: int .. py:method:: set_update(mode: Literal['manual', 'scan', 'device'], device: str = '', signal: str = '') Set the update mode for the ring widget. Modes: - "manual": Manual update mode, the value is set by the user. - "scan": Update mode for the scan progress. The value is updated by the current scan progress. - "device": Update mode for the device readback. The value is updated by the device readback. Take into account that user has to set the device name and limits. :param mode: Update mode for the ring widget. Can be "manual", "scan" or "device" :type mode: str :param device: Device name for the device readback mode, only used when mode is "device" :type device: str :param signal: Signal name for the device readback mode, only used when mode is "device" :type signal: str .. py:method:: set_value(value: int | float) Set the value for the ring widget :param value: Value for the ring widget :type value: int | float .. py:class:: RingProgressBar(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: add_ring(config: dict | None = None) -> bec_widgets.widgets.progress.ring_progress_bar.ring.Ring Add a new ring to the ring progress bar. Optionally, a configuration dictionary can be provided but the ring can also be configured later. The config dictionary must provide the qproperties of the Qt Ring object. :param config: Optional configuration dictionary for the ring. :type config: dict | None :returns: The newly added ring object. :rtype: Ring .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:method:: remove_ring(index: int | None = None) Remove a ring from the ring progress bar. :param index: Index of the ring to remove. If None, removes the last ring. :type index: int | None .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set_center_label(text: str) Set the center label text. :param text: Text for the center label. :type text: str .. py:method:: set_gap(value: int) Set the gap between rings. :param value: Gap value in pixels. :type value: int .. py:property:: rings :type: list[bec_widgets.widgets.progress.ring_progress_bar.ring.Ring] None .. py:class:: SBBMonitor(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A widget to display the SBB monitor website. .. py:class:: ScanControl(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Widget to submit new scans to the queue. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:class:: ScanProgressBar(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Widget to display a progress bar that is hooked up to the scan progress of a scan. .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: ScatterCurve(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Scatter curve item for the scatter waveform widget. .. py:property:: color_map :type: str The color map of the scatter curve. .. py:class:: ScatterWaveform(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: attach() None .. py:method:: auto_range(value: bool = True) On demand apply autorange to the plot item based on the visible curves. :param value: If True, apply autorange to the visible curves. :type value: bool .. py:method:: clear_all() Clear all the curves from the plot. .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: plot(device_x: str, device_y: str, device_z: str, signal_x: None | str = None, signal_y: None | str = None, signal_z: None | str = None, color_map: str | None = 'plasma', label: str | None = None, validate_bec: bool = True) -> ScatterCurve Plot the data from the device signals. :param device_x: The name of the x device signal. :type device_x: str :param device_y: The name of the y device signal. :type device_y: str :param device_z: The name of the z device signal. :type device_z: str :param signal_x: The x entry of the device signal. :type signal_x: None | str :param signal_y: The y entry of the device signal. :type signal_y: None | str :param signal_z: The z entry of the device signal. :type signal_z: None | str :param color_map: The color map of the scatter waveform. :type color_map: str | None :param label: The label of the curve. :type label: str | None :param validate_bec: Whether to validate the device signals with current BEC instance. :type validate_bec: bool :returns: The scatter curve object. :rtype: ScatterCurve .. py:method:: remove() Cleanup the BECConnector .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set(**kwargs) Set the properties of the plot widget. :param \*\*kwargs: Keyword arguments for the properties to be set. Possible properties: - title: str - x_label: str - y_label: str - x_scale: Literal["linear", "log"] - y_scale: Literal["linear", "log"] - x_lim: tuple - y_lim: tuple - legend_label_size: int .. py:method:: update_with_scan_history(scan_index: int = None, scan_id: str = None) Update the scan curves with the data from the scan storage. Provide only one of scan_id or scan_index. :param scan_id: ScanID of the scan to be updated. Defaults to None. :type scan_id: str, optional :param scan_index: Index of the scan to be updated. Defaults to None. :type scan_index: int, optional .. py:property:: auto_range_x :type: bool Set auto range for the x-axis. .. py:property:: auto_range_y :type: bool Set auto range for the y-axis. .. py:property:: color_map :type: str The color map of the scatter waveform. .. py:property:: device_x :type: str Device name for the X axis. .. py:property:: device_y :type: str Device name for the Y axis. .. py:property:: device_z :type: str Device name for the Z (color) axis. .. py:property:: enable_fps_monitor :type: bool Enable the FPS monitor. .. py:property:: enable_side_panel :type: bool Show Side Panel .. py:property:: enable_toolbar :type: bool Show Toolbar. .. py:property:: inner_axes :type: bool Show inner axes of the plot widget. .. py:property:: legend_label_size :type: int The font size of the legend font. .. py:property:: lock_aspect_ratio :type: bool Lock aspect ratio of the plot widget. .. py:property:: minimal_crosshair_precision :type: int Minimum decimal places for crosshair when dynamic precision is enabled. .. py:property:: outer_axes :type: bool Show the outer axes of the plot widget. .. py:property:: signal_x :type: str Signal entry for the X axis device. .. py:property:: signal_y :type: str Signal entry for the Y axis device. .. py:property:: signal_z :type: str Signal entry for the Z (color) axis device. .. py:property:: title :type: str Set title of the plot. .. py:property:: x_grid :type: bool Show grid on the x-axis. .. py:property:: x_label :type: str The set label for the x-axis. .. py:property:: x_limits :type: QPointF Get the x limits of the plot. .. py:property:: x_log :type: bool Set X-axis to log scale if True, linear if False. .. py:property:: y_grid :type: bool Show grid on the y-axis. .. py:property:: y_label :type: str The set label for the y-axis. .. py:property:: y_limits :type: QPointF Get the y limits of the plot. .. py:property:: y_log :type: bool Set Y-axis to log scale if True, linear if False. .. py:class:: SignalLabel(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:property:: custom_label :type: str Use a cusom label rather than the signal name .. py:property:: custom_units :type: str Use a custom unit string .. py:property:: decimal_places :type: int Format to a given number of decimal_places. Set to 0 to disable. .. py:property:: display_array_data :type: bool Displays the full data from array signals if set to True. .. py:property:: max_list_display_len :type: int For small lists, the max length to display .. py:property:: show_config_signals :type: bool In the signal selection menu, show config signals .. py:property:: show_default_units :type: bool Show default units obtained from the signal alongside it .. py:property:: show_hinted_signals :type: bool In the signal selection menu, show hinted signals .. py:property:: show_normal_signals :type: bool In the signal selection menu, show normal signals .. py:property:: show_select_button :type: bool Show the button to select the signal to display .. py:class:: TextBox(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A widget that displays text in plain and HTML format .. py:method:: set_html_text(text: str) -> None Set the HTML text of the widget. :param text: The text to set. :type text: str .. py:method:: set_plain_text(text: str) -> None Set the plain text of the widget. :param text: The text to set. :type text: str .. py:class:: ViewBase(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Wrapper for a content widget used inside the main app's stacked view. .. py:method:: activate() -> None Switch the parent application to this view. .. py:class:: Waveform(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` Widget for plotting waveforms. .. py:method:: add_dap_curve(device_label: str, dap_name: str | list[str], color: str | None = None, dap_oversample: int = 1, dap_parameters: dict | list | lmfit.Parameters | None = None, **kwargs) -> Curve Create a new DAP curve referencing the existing curve `device_label`, with the data processing model `dap_name`. DAP curves can be attached to curves that originate from live devices, history, or fully custom data sources. :param device_label: The label of the source curve to add DAP to. :type device_label: str :param dap_name: The name of the DAP model to use, or a list of model names to build a composite model. :type dap_name: str | list[str] :param color: The color of the curve. :type color: str :param dap_oversample: The oversampling factor for the DAP curve. :type dap_oversample: int :param dap_parameters: Optional lmfit parameter overrides sent to the DAP server. :type dap_parameters: dict | list | lmfit.Parameters | None :param \*\*kwargs: :returns: The new DAP curve. :rtype: Curve .. py:method:: attach() None .. py:method:: auto_range(value: bool = True) On demand apply autorange to the plot item based on the visible curves. :param value: If True, apply autorange to the visible curves. :type value: bool .. py:method:: clear_all() Clear all curves from the plot widget. .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: get_all_data(output: Literal['dict', 'pandas'] = 'dict') -> dict Extract all curve data into a dictionary or a pandas DataFrame. :param output: Format of the output data. :type output: Literal["dict", "pandas"] :returns: Data of all curves in the specified format. :rtype: dict | pd.DataFrame .. py:method:: get_curve(curve: int | str) -> Curve | None Get a curve from the plot widget. :param curve: The curve to get. It Can be the order of the curve or the name of the curve. :type curve: int|str Return(Curve|None): The curve object if found, None otherwise. .. py:method:: get_dap_params() -> dict[str, dict] Get the DAP parameters of all DAP curves. :returns: DAP parameters of all DAP curves. :rtype: dict[str, dict] .. py:method:: get_dap_summary() -> dict[str, dict] Get the DAP summary of all DAP curves. :returns: DAP summary of all DAP curves. :rtype: dict[str, dict] .. py:method:: plot(arg1: list | np.ndarray | str | None = None, y: list | np.ndarray | None = None, x: list | np.ndarray | None = None, device_x: str | None = None, device_y: str | None = None, signal_x: str | None = None, signal_y: str | None = None, color: str | None = None, label: str | None = None, dap: str | list[str] | None = None, dap_parameters: dict | list | lmfit.Parameters | None | object = None, scan_id: str | None = None, scan_number: int | None = None, **kwargs) -> Curve Plot a curve to the plot widget. :param arg1: First argument, which can be x data, y data, or device_y. :type arg1: list | np.ndarray | str | None :param y: Custom y data to plot. :type y: list | np.ndarray :param x: Custom y data to plot. :type x: list | np.ndarray :param device_x: Name of the x signal. - "auto": Use the best effort signal. - "timestamp": Use the timestamp signal. - "index": Use the index signal. - Custom signal name of a device from BEC. :type device_x: str :param device_y: The name of the device for the y-axis. :type device_y: str :param signal_x: The name of the entry for the x-axis. :type signal_x: str :param signal_y: The name of the entry for the y-axis. :type signal_y: str :param color: The color of the curve. :type color: str :param label: The label of the curve. :type label: str :param dap: The dap model to use for the curve. When provided, a DAP curve is attached automatically for device, history, or custom data sources. Use the same string as the LMFit model name, or a list of model names to build a composite. :type dap: str | list[str] :param dap_parameters: Optional lmfit parameter overrides sent to the DAP server. For a single model: values can be numeric (interpreted as fixed parameters) or dicts like `{"value": 1.0, "vary": False}`. For composite models (dap is list), use either a list aligned to the model list (each item is a param dict), or a dict of `{ "ModelName": { "param": {...} } }` when model names are unique. :type dap_parameters: dict | list | lmfit.Parameters | None :param scan_id: Optional scan ID. When provided, the curve is treated as a **history** curve and the y‑data (and optional x‑data) are fetched from that historical scan. Such curves are never cleared by live‑scan resets. :type scan_id: str :param scan_number: Optional scan index. When provided, the curve is treated as a **history** curve and :type scan_number: int :returns: The curve object. :rtype: Curve .. py:method:: remove() Cleanup the BECConnector .. py:method:: remove_curve(curve: int | str) Remove a curve from the plot widget. :param curve: The curve to remove. It Can be the order of the curve or the name of the curve. :type curve: int|str .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: select_roi(region: tuple[float, float]) Public method if you want the old `select_roi` style. .. py:method:: set(**kwargs) Set the properties of the plot widget. :param \*\*kwargs: Keyword arguments for the properties to be set. Possible properties: - title: str - x_label: str - y_label: str - x_scale: Literal["linear", "log"] - y_scale: Literal["linear", "log"] - x_lim: tuple - y_lim: tuple - legend_label_size: int .. py:method:: update_with_scan_history(scan_index: int = None, scan_id: str = None) Update the scan curves with the data from the scan storage. If both arguments are provided, scan_id takes precedence and scan_index is ignored. :param scan_id: ScanID of the scan to be updated. Defaults to None. :type scan_id: str, optional :param scan_index: Index (scan number) of the scan to be updated. Defaults to None. :type scan_index: int, optional .. py:property:: _config_dict :type: dict Get the configuration of the widget. :returns: The configuration of the widget. :rtype: dict .. py:property:: auto_range_x :type: bool Set auto range for the x-axis. .. py:property:: auto_range_y :type: bool Set auto range for the y-axis. .. py:property:: color_palette :type: str The color palette of the figure widget. .. py:property:: curves :type: list[Curve] Get the curves of the plot widget as a list. :returns: List of curves. :rtype: list .. py:property:: enable_fps_monitor :type: bool Enable the FPS monitor. .. py:property:: enable_side_panel :type: bool Show Side Panel .. py:property:: enable_toolbar :type: bool Show Toolbar. .. py:property:: inner_axes :type: bool Show inner axes of the plot widget. .. py:property:: legend_label_size :type: int The font size of the legend font. .. py:property:: lock_aspect_ratio :type: bool Lock aspect ratio of the plot widget. .. py:property:: max_dataset_size_mb :type: float The maximum dataset size (in MB) permitted when fetching async data from history before prompting the user. .. py:property:: minimal_crosshair_precision :type: int Minimum decimal places for crosshair when dynamic precision is enabled. .. py:property:: outer_axes :type: bool Show the outer axes of the plot widget. .. py:property:: signal_x :type: str | None The x signal name. .. py:property:: skip_large_dataset_check :type: bool Whether to skip the large dataset warning when fetching async data. .. py:property:: skip_large_dataset_warning :type: bool Whether to skip the large dataset warning when fetching async data. .. py:property:: title :type: str Set title of the plot. .. py:property:: x_grid :type: bool Show grid on the x-axis. .. py:property:: x_label :type: str The set label for the x-axis. .. py:property:: x_limits :type: QPointF Get the x limits of the plot. .. py:property:: x_log :type: bool Set X-axis to log scale if True, linear if False. .. py:property:: x_mode :type: str None .. py:property:: y_grid :type: bool Show grid on the y-axis. .. py:property:: y_label :type: str The set label for the y-axis. .. py:property:: y_limits :type: QPointF Get the y limits of the plot. .. py:property:: y_log :type: bool Set Y-axis to log scale if True, linear if False. .. py:class:: WaveformViewInline(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: activate() -> None Switch the parent application to this view. .. py:class:: WaveformViewPopup(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` .. py:method:: activate() -> None Switch the parent application to this view. .. py:class:: WebConsole(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A simple widget to display a website .. py:method:: attach() None .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: remove() Cleanup the BECConnector .. py:class:: WebsiteWidget(gui_id: str | None = None, config: dict | None = None, object_name: str | None = None, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.cli.rpc.rpc_base.RPCBase` A simple widget to display a website .. py:method:: attach() None .. py:method:: back() Go back in the history .. py:method:: detach() Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget. .. py:method:: forward() Go forward in the history .. py:method:: get_url() -> str Get the current url of the website widget :returns: The current url :rtype: str .. py:method:: reload() Reload the website .. py:method:: screenshot(file_name: str | None = None) Take a screenshot of the dock area and save it to a file. .. py:method:: set_url(url: str) -> None Set the url of the website widget :param url: The url to set :type url: str .. py:class:: _WidgetsEnumType Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enum for the available widgets, to be generated programmatically Initialize self. See help(type(self)) for accurate signature.