bec_widgets.widgets.containers.auto_update.auto_updates#

Classes#

AutoUpdates

Mixin class for all BEC widgets, to handle cleanup

Module Contents#

class AutoUpdates(parent=None, gui_id: str = None, window_title='Auto Update', *args, **kwargs)#

Bases: bec_widgets.widgets.containers.main_window.main_window.BECMainWindow

Mixin class for all BEC widgets, to handle cleanup

Base class for all BEC widgets. This class should be used as a mixin class for all BEC widgets, e.g.:

>>> class MyWidget(BECWidget, QWidget):
>>>     def __init__(self, parent=None, client=None, config=None, gui_id=None):
>>>         super().__init__(parent=parent, client=client, config=config, gui_id=gui_id)
Parameters:
  • client (BECClient, optional) – The BEC client.

  • config (ConnectionConfig, optional) – The connection configuration.

  • gui_id (str, optional) – The GUI ID.

  • theme_update (bool, optional) – Whether to subscribe to theme updates. Defaults to False. When set to True, the widget’s apply_theme method will be called when the theme changes.

_on_scan_status(content: dict, metadata: dict) None#

Callback for scan status messages.

best_effort(info: bec_lib.messages.ScanStatusMessage) None#

Best effort scan.

Parameters:

info (ScanStatusMessage) – The scan status message.

cleanup() None#

Cleanup procedure to run when the auto updates are disabled.

enable_gui_highlights(enable: bool) None#

Enable or disable GUI highlights.

Parameters:

enable (bool) – Whether to enable or disable the highlights.

get_selected_device(monitored_devices, selected_device: str | None = None) str | None#

Get the selected device for the plot. If no device is selected, the first device in the monitored devices list is selected.

on_scan_abort(msg: bec_lib.messages.ScanStatusMessage) None#

Procedure to run when a scan is aborted.

Parameters:

msg (ScanStatusMessage) – The scan status message.

on_scan_closed(msg: bec_lib.messages.ScanStatusMessage) None#

Procedure to run when a scan ends.

Parameters:

msg (ScanStatusMessage) – The scan status message.

on_scan_open(msg: bec_lib.messages.ScanStatusMessage) None#

Procedure to run when a scan starts.

Parameters:

msg (ScanStatusMessage) – The scan status message.

on_start() None#

Procedure to run when the auto updates are enabled.

on_stop() None#

Procedure to run when the auto updates are disabled.

set_dock_to_widget(widget: Literal['Waveform']) bec_widgets.widgets.plots.waveform.waveform.Waveform#
set_dock_to_widget(widget: Literal['Image']) bec_widgets.widgets.plots.image.image.Image
set_dock_to_widget(widget: Literal['ScatterWaveform']) bec_widgets.widgets.plots.scatter_waveform.scatter_waveform.ScatterWaveform
set_dock_to_widget(widget: Literal['MotorMap']) bec_widgets.widgets.plots.motor_map.motor_map.MotorMap
set_dock_to_widget(widget: Literal['MultiWaveform']) bec_widgets.widgets.plots.multi_waveform.multi_waveform.MultiWaveform

Set the dock to the widget.

Parameters:

widget (str) – The widget to set the dock to. Must be the name of a valid widget class.

Returns:

The widget that was set.

Return type:

BECWidget

simple_grid_scan(info: bec_lib.messages.ScanStatusMessage) None#

Simple grid scan.

Parameters:

info (ScanStatusMessage) – The scan status message.

simple_line_scan(info: bec_lib.messages.ScanStatusMessage) None#

Simple line scan.

Parameters:

info (ScanStatusMessage) – The scan status message.

start_auto_update()#

Establish all connections for the auto updates.

start_default_dock()#

Create a default dock for the auto updates.

stop_auto_update()#

Disconnect all connections for the auto updates.

PLUGIN = False#
RPC = True#
USER_ACCESS = ['enabled', 'enabled.setter', 'selected_device', 'selected_device.setter']#
current_widget: bec_widgets.utils.bec_widget.BECWidget | None = None#
dock_area#
dock_name = None#
property enabled: bool#

Get the enabled status of the auto updates.

rpc_widget_class = 'AutoUpdates'#
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