From a01593fa4b42d4cfe78b3598a2ed76796e8994b8 Mon Sep 17 00:00:00 2001 From: appel_c Date: Tue, 5 Aug 2025 10:43:20 +0200 Subject: [PATCH] refactor(ids_camera): add deprecation warning for ids_camera --- csaxs_bec/devices/ids_cameras/__init__.py | 1 + csaxs_bec/devices/ids_cameras/base_integration/utils.py | 3 +++ csaxs_bec/devices/ids_cameras/ids_camera.py | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/csaxs_bec/devices/ids_cameras/__init__.py b/csaxs_bec/devices/ids_cameras/__init__.py index e69de29..a16d89e 100644 --- a/csaxs_bec/devices/ids_cameras/__init__.py +++ b/csaxs_bec/devices/ids_cameras/__init__.py @@ -0,0 +1 @@ +from .ids_camera_new import IDSCamera diff --git a/csaxs_bec/devices/ids_cameras/base_integration/utils.py b/csaxs_bec/devices/ids_cameras/base_integration/utils.py index c059cab..0128d52 100644 --- a/csaxs_bec/devices/ids_cameras/base_integration/utils.py +++ b/csaxs_bec/devices/ids_cameras/base_integration/utils.py @@ -240,6 +240,9 @@ if ueye is not None: ueye.IS_CM_UYVY_BAYER_PACKED: 16, ueye.IS_CM_CBYCRY_PACKED: 16, } +else: + error_codes = {} + bits_per_pixel = {} def get_bits_per_pixel(color_mode): diff --git a/csaxs_bec/devices/ids_cameras/ids_camera.py b/csaxs_bec/devices/ids_cameras/ids_camera.py index 1b7fe7f..1250927 100644 --- a/csaxs_bec/devices/ids_cameras/ids_camera.py +++ b/csaxs_bec/devices/ids_cameras/ids_camera.py @@ -2,11 +2,14 @@ import threading import time import numpy as np +from bec_lib.logger import bec_logger from ophyd import Component as Cpt from ophyd import DeviceStatus, Kind, Signal, StatusBase from ophyd_devices.interfaces.base_classes.psi_device_base import PSIDeviceBase from ophyd_devices.utils.bec_signals import PreviewSignal +logger = bec_logger.logger + class ROISignal(Signal): """ @@ -131,6 +134,9 @@ class IDSCamera(PSIDeviceBase): self.thread_event = threading.Event() self.data_thread = None self._roi: tuple | None = None # x, y, width, height + logger.info( + f"Deprecation warning: The IDSCamera class is deprecated. Use the new IDSCameraNew class instead." + ) def set_roi(self, x: int, y: int, width: int, height: int): self._roi = (x, y, width, height)