From 72262436b35a9060726ba4bf3dfcaaeffc5c7962 Mon Sep 17 00:00:00 2001 From: x10sa Date: Thu, 19 Mar 2026 11:01:58 +0100 Subject: [PATCH] Automatic backup triggered by new deployment --- pxii_bec/device_configs/x10sa_device_config.yaml | 12 ++++++++++++ pxii_bec/devices/smargopolo_smargon.py | 4 ++-- pxii_bec/guards/__init__.py | 0 pxii_bec/macros/APscripts.py | 16 ++++++++++++++++ tests/tests_devices/mock_smargopolo.py | 4 ++-- 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 pxii_bec/guards/__init__.py diff --git a/pxii_bec/device_configs/x10sa_device_config.yaml b/pxii_bec/device_configs/x10sa_device_config.yaml index 91a4104..166bbb5 100644 --- a/pxii_bec/device_configs/x10sa_device_config.yaml +++ b/pxii_bec/device_configs/x10sa_device_config.yaml @@ -11,3 +11,15 @@ id_gap: readOnly: false softwareTrigger: false +smargon: + description: REST-based device which connects to Smargopolo + deviceClass: pxii_bec.devices.smargopolo_smargon.Smargon + deviceConfig: {prefix: 'http://x10sa-smargopolo.psi.ch:3000'} + onFailure: buffer + enabled: True + readoutPriority: baseline + deviceTags: + - smargon + - motors + readOnly: false + softwareTrigger: false \ No newline at end of file diff --git a/pxii_bec/devices/smargopolo_smargon.py b/pxii_bec/devices/smargopolo_smargon.py index 1dc6515..ed7b1a4 100644 --- a/pxii_bec/devices/smargopolo_smargon.py +++ b/pxii_bec/devices/smargopolo_smargon.py @@ -56,8 +56,8 @@ class SmargonController(OphydObject): def __init__(self, *, prefix, **kwargs): self._prefix = prefix - self._readback_endpoint = "/ReadbackSCS" - self._target_endpoint = "/TargetSCS" + self._readback_endpoint = "/readbackSCS" + self._target_endpoint = "/targetSCS" self._targets = {} self._signal_registry: set[str] = set() self._readback_poll_interval: float = _POLL_INTERVAL_SLOW diff --git a/pxii_bec/guards/__init__.py b/pxii_bec/guards/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pxii_bec/macros/APscripts.py b/pxii_bec/macros/APscripts.py index 74ad4d4..bf88d70 100755 --- a/pxii_bec/macros/APscripts.py +++ b/pxii_bec/macros/APscripts.py @@ -1484,4 +1484,20 @@ def scan_eg(erange, nsteps=50, fit=True): ################################################ # +def scan_window(wname="Scan", fit=True): + dock_area = bec.gui.new() + # Add a new dock with a Waveform to the BECDockArea + nam = "waveform_dock_"+wname + dock_area.new(name=nam, widget="Waveform") + # dock_area.panels + # dock_area.panel_list + plt1 = dock_area.panels[nam] + # Add signals to the WaveformWidget + plt1.plot(device_x='id_gap', device_y='bpm') + dock2 = dock_area.new(name="motor_dock", widget="MotorMap",relative_to=nam, position="right") + ###do stuff + + + ### if done, remove + dock2.remove() diff --git a/tests/tests_devices/mock_smargopolo.py b/tests/tests_devices/mock_smargopolo.py index 233b7e0..7d51830 100644 --- a/tests/tests_devices/mock_smargopolo.py +++ b/tests/tests_devices/mock_smargopolo.py @@ -81,13 +81,13 @@ def validate_axes(axes: Iterable[str] | None) -> list[str]: return list(axes) -@app.get("/ReadbackSCS") +@app.get("/readbackSCS") async def readback_scs(axis: list[str] | None = Query(None)): selected_axes = validate_axes(axis) return {ax: motors[ax].position for ax in selected_axes} -@app.put("/TargetSCS") +@app.put("/targetSCS") async def target_scs(req: Request): targets = {ax: float(t) for ax, t in req.query_params.items()} if targets is None: