Commit 328705ef authored by vertighel's avatar vertighel
Browse files
parent 598ba639
Loading
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ class Camera(BaseDevice):
        self._last_exptime = None
        self._last_imagetype = None
        self._last_datetime = None
        self._setpoint = None

        try:
            self._lib = ctypes.CDLL("/usr/lib/libatikcameras.so")
@@ -79,6 +80,11 @@ class Camera(BaseDevice):
                if self._handle:
                    self._lib.ArtemisProperties(self._handle, ctypes.byref(self._props))
                    self._subframe = [0, 0, self._props.nPixelsX, self._props.nPixelsY]
                    flags, level, minl, maxl, setp = [ctypes.c_int() for _ in range(5)]
                    self._lib.ArtemisCoolingInfo(self._handle, ctypes.byref(flags),
                                                 ctypes.byref(level), ctypes.byref(minl),
                                                 ctypes.byref(maxl), ctypes.byref(setp))
                    self._setpoint = setp.value / 100.0
                    self.error = []
                else:
                    msg = "Atik connected but failed to acquire handle"
@@ -251,8 +257,7 @@ class Camera(BaseDevice):

    @temperature.setter
    def temperature(self, t):
        h = self._check_connection()
        if h: self._lib.ArtemisSetCooling(h, int(t * 100))
        self._setpoint = t

    @property
    def cooler(self):
@@ -268,8 +273,11 @@ class Camera(BaseDevice):
    def cooler(self, b):
        h = self._check_connection()
        if not h: return
        if b: self.put('temperature', -10.0)
        else: self._lib.ArtemisCoolerWarmUp(h)
        if b:
            setp = self._setpoint if self._setpoint is not None else -10.0
            self._lib.ArtemisSetCooling(h, int(setp * 100))
        else:
            self._lib.ArtemisCoolerWarmUp(h)

    @property
    def binning(self):
@@ -315,13 +323,7 @@ class Camera(BaseDevice):

    @property
    def setpoint(self):
        h = self._check_connection()
        if not h: return None
        flags, level, minl, maxl, setp = [ctypes.c_int() for _ in range(5)]
        self._lib.ArtemisCoolingInfo(h, ctypes.byref(flags), ctypes.byref(level),
                                     ctypes.byref(minl), ctypes.byref(maxl),
                                     ctypes.byref(setp))
        return setp.value / 100.0
        return self._setpoint

    @property
    def fan(self):