From 0b5cf24c2eaf4121c0920a5971c138cc5a99ed17 Mon Sep 17 00:00:00 2001 From: Iva Laginja Date: Mon, 23 Oct 2023 17:10:21 +0200 Subject: [PATCH] help pls --- catkit2/services/andor_camera/andor_camera.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/catkit2/services/andor_camera/andor_camera.py b/catkit2/services/andor_camera/andor_camera.py index f1ce6b02e..def619e40 100644 --- a/catkit2/services/andor_camera/andor_camera.py +++ b/catkit2/services/andor_camera/andor_camera.py @@ -24,11 +24,27 @@ def open(self): self.initialize_cooling() # Set properties from config. + def make_property_helper(name, read_only=False): + if read_only: + self.make_property(name, lambda: getattr(self, name)) + else: + self.make_property(name, lambda: getattr(self, name), lambda val: setattr(self, name, val)) + self.width = self.config.get('width', 400) self.height = self.config.get('height', 400) self.offset_y = self.config.get('aoi_left', 1) self.offset_x = self.config.get('aoi_top', 100) + make_property_helper('width') + make_property_helper('height') + make_property_helper('offset_x') + make_property_helper('offset_y') + + make_property_helper('sensor_width', read_only=True) + make_property_helper('sensor_height', read_only=True) + + make_property_helper('exposure_time') + # Set standard camera settings self.cam.PreAmpGainControl = 5 self.cam.AOIWidth = self.width