diff --git a/phoenix_bec/devices/unsupported_legacy/psi_detector_base.py b/phoenix_bec/devices/unsupported_legacy/psi_detector_base.py index 8226c35..1f76a4d 100644 --- a/phoenix_bec/devices/unsupported_legacy/psi_detector_base.py +++ b/phoenix_bec/devices/unsupported_legacy/psi_detector_base.py @@ -10,6 +10,8 @@ import time import traceback from typing import Generic, TypeVar +from ophyd import Component as Cpt +from ophyd_devices.sim.sim_signals import SetableSignal from bec_lib.file_utils import FileWriter from bec_lib.logger import bec_logger from ophyd import Device, DeviceStatus, Kind @@ -23,14 +25,13 @@ from ophyd_devices.utils.errors import DeviceStopError, DeviceTimeoutError logger = bec_logger.logger -T = TypeVar("T", bound="BECDeviceBase") class BECDeviceBaseError(Exception): """Error class for BECDeviceBase.""" -class CustomPrepare(Generic[T]): +class CustomDetectorMixin: """Custom prepare class for beamline specific logic. This class provides a set of hooks for beamline specific logic to be implemented. @@ -316,7 +317,7 @@ class CustomPrepare(Generic[T]): return status -class BECDeviceBase(Device): +class PSIDetectorBase(Device): """ Base class for custom device integrations at PSI. This class wraps around the ophyd's standard set of methods, providing hooks for custom logic to be implemented in the custom_prepare_cls. @@ -325,7 +326,9 @@ class BECDeviceBase(Device): (https://bec.readthedocs.io/en/latest/) for more information about device integration. """ - custom_prepare_cls = CustomPrepare + custom_prepare_cls = CustomDetectorMixin + + filepath = Cpt(SetableSignal, value="", kind=Kind.config) # All possible subscription types that the Device Manager subscribes to # Run the command _run_subs(sub_type=self.SUB_VALUE, value=value) to trigger