fix: Add logs for simulated DDG
CI for csaxs_bec / test (pull_request) Successful in 2m6s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 1s
CI for csaxs_bec / test (push) Successful in 2m35s

This commit was merged in pull request #197.
This commit is contained in:
2026-04-22 17:17:35 +02:00
parent 0bb6c6ce54
commit 8fca6bed11
@@ -2,6 +2,7 @@
from __future__ import annotations
from bec_lib.logger import bec_logger
from ophyd import Device
from ophyd_devices import StatusBase
from ophyd_devices.tests.utils import patched_device
@@ -9,6 +10,8 @@ from ophyd_devices.tests.utils import patched_device
from csaxs_bec.devices.epics.delay_generator_csaxs.ddg_1 import DDG1
from csaxs_bec.devices.epics.fast_shutter import cSAXSFastEpicsShutter
logger = bec_logger.logger
class cSAXSSimulatedFastShutter(Device):
"""
@@ -32,6 +35,12 @@ class DDG1WithPatchedStage(DDG1):
We inherit here to be able to overwrite the on_stage method if needed, without compromising the rest of the device's functionality.
"""
def on_stage(self):
logger.warning(
f"Staging of {self.name}. This is a simulated device of {self.__class__.__name__}."
)
super().on_stage()
def on_trigger(self):
"""
We overwrite and patch the on_trigger method. This resolves immediately now and
@@ -46,5 +55,5 @@ class DDG1WithPatchedStage(DDG1):
class SimulatedDDG1(Device):
def __new__(cls, *args, **kwargs):
with patched_device(DDG1, *args, **kwargs) as ddg1:
with patched_device(DDG1WithPatchedStage, *args, **kwargs) as ddg1:
return ddg1