bec_widgets.widgets.control.scan_control ======================================== .. py:module:: bec_widgets.widgets.control.scan_control Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/bec_widgets/widgets/control/scan_control/scan_control/index /autoapi/bec_widgets/widgets/control/scan_control/scan_group_box/index Classes ------- .. autoapisummary:: bec_widgets.widgets.control.scan_control.ScanControl Package Contents ---------------- .. py: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: :py:obj:`bec_widgets.utils.bec_widget.BECWidget`, :py:obj:`qtpy.QtWidgets.QWidget` Widget 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) :param client: The BEC client. :type client: BECClient, optional :param config: The connection configuration. :type config: ConnectionConfig, optional :param gui_id: The GUI ID. :type gui_id: str, optional :param theme_update: 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. :type theme_update: bool, optional .. py:method:: _add_metadata_form() .. py:method:: _init_UI() Initializes the UI of the scan control widget. Create the top box for scan selection and populate scans to main combobox. .. py:method:: _restore_kwargs(scan_kwargs: dict) Restores the kwargs for the given scan parameters. .. py:method:: add_arg_group(group: dict) Adds the given gui_groups to the scan control layout. Args: .. py:method:: add_kwargs_boxes(groups: list) Adds the given gui_groups to the scan control layout. :param groups: List of dictionaries containing the gui_group information. :type groups: list .. py:method:: cleanup() Cleanup the scan control widget. .. py:method:: current_scan() Returns the scan name for the currently selected scan. .. py:method:: 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 .. py:method:: get_scan_parameters(bec_object: bool = True) Returns the scan parameters for the selected scan. :param bec_object: If True, returns the BEC object for the scan parameters such as device objects. :type bec_object: bool .. py:method:: hide_add_remove_buttons() Property to hide the add_remove buttons. .. py:method:: hide_arg_box() Property to hide the argument box. .. py:method:: hide_kwarg_boxes() Property to hide the keyword argument boxes. .. py:method:: hide_metadata() Property to hide the metadata form. .. py:method:: hide_optional_metadata() Property to hide the optional metadata form. .. py:method:: hide_scan_control_buttons() Property to hide the scan control buttons. .. py:method:: hide_scan_selection_combobox() Property to hide the scan selection combobox. .. py:method:: on_scan_selection_changed(index: int) Callback for scan selection combo box .. py:method:: populate_scans() Populates the scan selection combo box with available scans from BEC session. .. py:method:: remove_kwarg_boxes() .. py:method:: request_last_executed_scan_parameters(*_) Requests the last executed scan parameters from BEC and restores them to the scan control widget. .. py:method:: reset_layout() Clears the scan control layout from GuiGroups and ArgGroups boxes. .. py:method:: restore_scan_parameters(scan_name: str) Restores the scan parameters for the given scan name :param scan_name: Name of the scan to restore the parameters for. :type scan_name: str .. py:method:: run_scan() Starts the selected scan with the given parameters. .. py:method:: save_current_scan_parameters() Saves the current scan parameters to the scan control config for further use. .. py:method:: scan_select(scan_name: str) Slot for scan selection. Updates the scan control layout based on the selected scan. :param scan_name: Name of the selected scan. :type scan_name: str .. py:method:: set_current_scan(scan_name: str) Slot for setting the current scan to the given scan name. :param scan_name: Name of the scan to set as current. :type scan_name: str .. py:method:: show_scan_control_buttons(show: bool) Shows or hides the scan control buttons. .. py:method:: show_scan_selection_combobox(show: bool) Shows or hides the scan selection combobox. .. py:method:: update_scan_metadata(md: dict | None) .. py:attribute:: ARG_BOX_POSITION :type: int :value: 2 .. py:attribute:: ICON_NAME :value: 'tune' .. py:attribute:: PLUGIN :value: True .. py:attribute:: USER_ACCESS :value: ['attach', 'detach', 'screenshot'] .. py:attribute:: arg_box :value: None .. py:attribute:: device_selected .. py:attribute:: expert_mode :value: False .. py:attribute:: kwarg_boxes :value: [] .. py:attribute:: last_scan_found :value: None .. py:attribute:: layout .. py:attribute:: previous_scan :value: None .. py:attribute:: scan_args .. py:attribute:: scan_selected .. py:attribute:: scan_started