Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

is_calibrating incoherent behaviour #4

Open
lorrandal opened this issue Jun 6, 2017 · 2 comments
Open

is_calibrating incoherent behaviour #4

lorrandal opened this issue Jun 6, 2017 · 2 comments

Comments

@lorrandal
Copy link
Collaborator

is_calibrating property exhibits an incoherent behaviour: it gives different results if it is called before or after the first calibration. eg:

In [3]: b.is_calibrating
Out[3]: True

In [4]: b.calibrate()

In [5]: b.is_calibrating
Out[5]: False

Function:

    @property #TODO: after the first calibration, different resultss
    def is_calibrating(self):
#        r = self._dll.LCP_IsCalibrationFinished(self._handle[0])
#        return bool(r)
        r = self._call('LCP_IsCalibrationFinished', self._handle[0])
        if r == 0:
            return True
        else:
            return False
@hoechenberger
Copy link
Member

hoechenberger commented Jun 7, 2017

In fact, QmixPump.is_calibrating is always Trueafter powering on the system, as reported by LCP_IsCalibrationFinished(); we should ask Cetoni about this, it appears to be a bug in their code.

@hoechenberger
Copy link
Member

I assume it's a documentation problem on Cetoni's side:
LCP_IsCalibrationFinished() would naturally produce a negative response right after powering up the system, because no calibration has been carried out at this point. After a successful calibration, the response would be positive.

So while Cetoni's docs say,

0 - Device is calibrating
1 - Device calibration has finished
<0 - Error code

I believe the first line should rather read 0 | - Device has not yet been calibrated or is currently calibrating.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants