diff --git a/pxiii_bec/bec_ipython_client/plugins/beam_stop_scan.py b/pxiii_bec/bec_ipython_client/plugins/beam_stop_scan.py new file mode 100644 index 0000000..c1fb5a6 --- /dev/null +++ b/pxiii_bec/bec_ipython_client/plugins/beam_stop_scan.py @@ -0,0 +1,2 @@ +def beam_stop_scan(): + print("running beam stop scan") \ No newline at end of file diff --git a/pxiii_bec/bec_widgets/auto_updates.py b/pxiii_bec/bec_widgets/auto_updates.py index abb8c78..9707d3a 100644 --- a/pxiii_bec/bec_widgets/auto_updates.py +++ b/pxiii_bec/bec_widgets/auto_updates.py @@ -15,12 +15,25 @@ class PlotUpdate(AutoUpdates): # plt = self.figure.plot(dev_x, dev_y) # plt.set(title=f"PXIII: Scan {info.scan_number}", x_label=dev_x, y_label=dev_y) + + def px_default_line_scan(self, info:ScanInfo): + dev_x = info.scan_report_devices[0] + dev_y = "bpm4i" + self.figure.clear_all() + plt = self.figure.plot(dev_x, dev_y) + plt.set(title="Custom line scan with samy") + + def handler(self, info: ScanInfo) -> None: # EXAMPLES: # if info.scan_name == "line_scan" and info.scan_report_devices: # self.simple_line_scan(info) # return # if info.scan_name == "grid_scan" and info.scan_report_devices: - # self.run_grid_scan_update(info) + # self.simple_grid_scan(info) # return + + if info.scan_report_devices and info.scan_report_devices[0] == "samy": + self.px_default_line_scan(info) + return super().handler(info) diff --git a/start_bec_client.py b/start_bec_client.py new file mode 100644 index 0000000..802f54a --- /dev/null +++ b/start_bec_client.py @@ -0,0 +1,22 @@ +from bec_ipython_client import BECIPythonClient +from bec_lib import bec_logger, ServiceConfig +logger = bec_logger.logger +bec_logger.level = bec_logger.LOGLEVEL.SUCCESS + +config = ServiceConfig(redis={"host":"x06da-bec-001", "port":6379}) + +bec = BECIPythonClient(config=config) +bec.start() +bec.load_high_level_interface("spec_hli") + +dev = bec.device_manager.devices +scans = bec.scans + +logger.success("Started BECClient") + +########################################## + +from pxiii_bec.bec_ipython_client.plugins.beam_stop_scan import beam_stop_scan + +beam_stop_scan() +