From 9f656546dff94dbb026a79fa785d9959e313dffb Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Tue, 20 Sep 2022 12:06:46 +0200 Subject: [PATCH] fix undefined status in softcal --- secop_psi/softcal.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/secop_psi/softcal.py b/secop_psi/softcal.py index 530c7be..45b385c 100644 --- a/secop_psi/softcal.py +++ b/secop_psi/softcal.py @@ -27,7 +27,8 @@ from os.path import basename, dirname, exists, join import numpy as np from scipy.interpolate import splev, splrep # pylint: disable=import-error -from secop.core import Attached, BoolType, Parameter, Readable, StringType, FloatRange +from secop.core import Attached, BoolType, Parameter, Readable, StringType, \ + FloatRange, Done def linear(x): @@ -182,7 +183,6 @@ class Sensor(Readable): description = 'a calibrated sensor value' _value_error = None - enablePoll = False def checkProperties(self): if 'description' not in self.propertyValues: @@ -196,6 +196,9 @@ class Sensor(Readable): if self.description == '_': self.description = '%r calibrated with curve %r' % (self.rawsensor, self.calib) + def doPoll(self): + self.read_status() + def write_calib(self, value): self._calib = CalCurve(value) return value @@ -221,3 +224,8 @@ class Sensor(Readable): def read_value(self): return self._calib(self.rawsensor.read_value()) + + def read_status(self): + self.update_status(self.rawsensor.status) + return Done +