Source code for csaxs_bec.bec_widgets.auto_updates.auto_updates

from __future__ import annotations

from typing import TYPE_CHECKING

from bec_widgets.widgets.containers.auto_update.auto_updates import AutoUpdates

if TYPE_CHECKING:  # pragma: no cover
    from bec_lib.messages import ScanStatusMessage


[docs] class cSAXSUpdate(AutoUpdates): ####################################################################### ################# GUI Callbacks ####################################### #######################################################################
[docs] def on_start(self) -> None: """ Procedure to run when the auto updates are enabled. """ self.start_default_dock()
[docs] def on_stop(self) -> None: """ Procedure to run when the auto updates are disabled. """
[docs] def on_scan_open(self, msg: ScanStatusMessage) -> None: """ Procedure to run when a scan starts. Args: msg (ScanStatusMessage): The scan status message. """ if msg.scan_name == "line_scan" and msg.scan_report_devices: return self.simple_line_scan(msg) if msg.scan_name == "grid_scan" and msg.scan_report_devices: return self.simple_grid_scan(msg) if msg.scan_report_devices: return self.best_effort(msg) return None
[docs] def on_scan_closed(self, msg: ScanStatusMessage) -> None: """ Procedure to run when a scan ends. Args: msg (ScanStatusMessage): The scan status message. """
[docs] def on_scan_abort(self, msg: ScanStatusMessage) -> None: """ Procedure to run when a scan is aborted. Args: msg (ScanStatusMessage): The scan status message. """
[docs] class cSAXSUpdateAlignment(AutoUpdates): ...
[docs] class cSAXSUpdateScan(AutoUpdates): ...