improved softcal

+ removed debug code from ls370
This commit is contained in:
l_samenv 2021-03-18 14:01:28 +01:00
parent 499ae69f29
commit 185bf7bc88
2 changed files with 7 additions and 4 deletions

View File

@ -228,7 +228,7 @@ class ResChannel(HasIodev, Readable):
if autorange:
result['autorange'] = 'hard'
# else: do not change autorange
self.log.info('%s range %r %r %r' % (self.name, rng, autorange, self.autorange))
# self.log.info('%s range %r %r %r' % (self.name, rng, autorange, self.autorange))
if excoff:
result.update(iexc=0, vexc=0)
elif iscur:

View File

@ -181,13 +181,16 @@ class Sensor(Readable):
pollerClass = None
_value_error = None
def __init__(self, name, logger, cfgdict, srv):
cfgdict.setdefault('description', 'calibrated value of module %r' % cfgdict['rawsensor'])
super().__init__(name, logger, cfgdict, srv)
def checkProperties(self):
if 'description' not in self.propertyValues:
self.description = '_' # avoid complaining about missing description
super().checkProperties()
def initModule(self):
self._rawsensor.registerCallbacks(self, ['status']) # auto update status
self._calib = CalCurve(self.calib)
if self.description == '_':
self.description = '%r calibrated with curve %r' % (self.rawsensor, self.calib)
def write_calib(self, value):
self._calib = CalCurve(value)