bec_widgets.widgets.control.scan_control#
Submodules#
Classes#
Widget to submit new scans to the queue. |
Package Contents#
- class ScanControl(parent=None, client=None, config: ScanControlConfig | dict | None = None, gui_id: str | None = None, allowed_scans: list | None = None, default_scan: str | None = None, **kwargs)#
Bases:
bec_widgets.utils.bec_widget.BECWidget,qtpy.QtWidgets.QWidgetWidget to submit new scans to the queue.
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.
- _add_metadata_form()#
- _init_UI()#
Initializes the UI of the scan control widget. Create the top box for scan selection and populate scans to main combobox.
- _restore_kwargs(scan_kwargs: dict)#
Restores the kwargs for the given scan parameters.
- add_arg_group(group: dict)#
Adds the given gui_groups to the scan control layout.
Args:
- add_kwargs_boxes(groups: list)#
Adds the given gui_groups to the scan control layout.
- Parameters:
groups (list) – List of dictionaries containing the gui_group information.
- cleanup()#
Cleanup the scan control widget.
- current_scan()#
Returns the scan name for the currently selected scan.
- emit_device_selected(dev_names)#
Emit the signal to inform about selected device(s)
“dev_names” is a string separated by space, in case of multiple devices
- get_scan_parameters(bec_object: bool = True)#
Returns the scan parameters for the selected scan.
- Parameters:
bec_object (bool) – If True, returns the BEC object for the scan parameters such as device objects.
- hide_add_remove_buttons()#
Property to hide the add_remove buttons.
- hide_arg_box()#
Property to hide the argument box.
- hide_kwarg_boxes()#
Property to hide the keyword argument boxes.
- hide_metadata()#
Property to hide the metadata form.
- hide_optional_metadata()#
Property to hide the optional metadata form.
- hide_scan_control_buttons()#
Property to hide the scan control buttons.
- hide_scan_selection_combobox()#
Property to hide the scan selection combobox.
- on_scan_selection_changed(index: int)#
Callback for scan selection combo box
- populate_scans()#
Populates the scan selection combo box with available scans from BEC session.
- remove_kwarg_boxes()#
- request_last_executed_scan_parameters(*_)#
Requests the last executed scan parameters from BEC and restores them to the scan control widget.
- reset_layout()#
Clears the scan control layout from GuiGroups and ArgGroups boxes.
- restore_scan_parameters(scan_name: str)#
Restores the scan parameters for the given scan name
- Parameters:
scan_name (str) – Name of the scan to restore the parameters for.
- run_scan()#
Starts the selected scan with the given parameters.
- save_current_scan_parameters()#
Saves the current scan parameters to the scan control config for further use.
- scan_select(scan_name: str)#
Slot for scan selection. Updates the scan control layout based on the selected scan.
- Parameters:
scan_name (str) – Name of the selected scan.
- set_current_scan(scan_name: str)#
Slot for setting the current scan to the given scan name.
- Parameters:
scan_name (str) – Name of the scan to set as current.
- show_scan_control_buttons(show: bool)#
Shows or hides the scan control buttons.
- show_scan_selection_combobox(show: bool)#
Shows or hides the scan selection combobox.
- update_scan_metadata(md: dict | None)#
- ARG_BOX_POSITION: int = 2#
- ICON_NAME = 'tune'#
- PLUGIN = True#
- USER_ACCESS = ['attach', 'detach', 'screenshot']#
- arg_box = None#
- device_selected#
- expert_mode = False#
- kwarg_boxes = []#
- last_scan_found = None#
- layout#
- previous_scan = None#
- scan_args#
- scan_selected#
- scan_started#