From 5cca9649d095804b4e0be09d451baa57af45f4a0 Mon Sep 17 00:00:00 2001 From: Erin Pougheon Date: Tue, 4 Jun 2024 13:46:09 +0200 Subject: [PATCH] Change property_name variable name (to specify the camera) --- .../allied_vision_camera/allied_vision_camera.py | 6 +++--- .../services/hamamatsu_camera/hamamatsu_camera.py | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/catkit2/services/allied_vision_camera/allied_vision_camera.py b/catkit2/services/allied_vision_camera/allied_vision_camera.py index 1c385285..f971e303 100644 --- a/catkit2/services/allied_vision_camera/allied_vision_camera.py +++ b/catkit2/services/allied_vision_camera/allied_vision_camera.py @@ -23,10 +23,10 @@ from catkit2.testbed.service import Service -def _create_property(property_name, read_only=False, stopped_acquisition=True): +def _create_property(av_property_name, read_only=False, stopped_acquisition=True): def getter(self): with self.mutex: - return getattr(self.cam, property_name).get() + return getattr(self.cam, av_property_name).get() if read_only: setter = None @@ -41,7 +41,7 @@ def setter(self, value): time.sleep(0.001) with self.mutex: - getattr(self.cam, property_name).set(value) + getattr(self.cam, av_property_name).set(value) if was_running and stopped_acquisition: self.start_acquisition() diff --git a/catkit2/services/hamamatsu_camera/hamamatsu_camera.py b/catkit2/services/hamamatsu_camera/hamamatsu_camera.py index eaa04506..e157f150 100644 --- a/catkit2/services/hamamatsu_camera/hamamatsu_camera.py +++ b/catkit2/services/hamamatsu_camera/hamamatsu_camera.py @@ -22,13 +22,13 @@ raise -def _create_property(property_name, read_only=False, stopped_acquisition=True): +def _create_property(hamamatsu_property_name, read_only=False, stopped_acquisition=True): def getter(self): with self.mutex: - if property_name != 'EXPOSURETIME': - return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, property_name)) + if hamamatsu_property_name != 'EXPOSURETIME': + return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, hamamatsu_property_name)) else: - return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, property_name)) * 1e6 + return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, hamamatsu_property_name)) * 1e6 if read_only: setter = None @@ -43,10 +43,10 @@ def setter(self, value): time.sleep(0.001) with self.mutex: - if property_name != 'EXPOSURETIME': - self.cam.prop_setvalue(getattr(dcam.DCAM_IDPROP, property_name), value) + if hamamatsu_property_name != 'EXPOSURETIME': + self.cam.prop_setvalue(getattr(dcam.DCAM_IDPROP, hamamatsu_property_name), value) else: - self.cam.prop_setvalue(getattr(dcam.DCAM_IDPROP, property_name), value / 1e6) + self.cam.prop_setvalue(getattr(dcam.DCAM_IDPROP, hamamatsu_property_name), value / 1e6) if was_running and stopped_acquisition: self.start_acquisition()