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