improved softcal
+ removed debug code from ls370
This commit is contained in:
parent
499ae69f29
commit
185bf7bc88
@ -228,7 +228,7 @@ class ResChannel(HasIodev, Readable):
|
|||||||
if autorange:
|
if autorange:
|
||||||
result['autorange'] = 'hard'
|
result['autorange'] = 'hard'
|
||||||
# else: do not change autorange
|
# 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:
|
if excoff:
|
||||||
result.update(iexc=0, vexc=0)
|
result.update(iexc=0, vexc=0)
|
||||||
elif iscur:
|
elif iscur:
|
||||||
|
@ -181,13 +181,16 @@ class Sensor(Readable):
|
|||||||
pollerClass = None
|
pollerClass = None
|
||||||
_value_error = None
|
_value_error = None
|
||||||
|
|
||||||
def __init__(self, name, logger, cfgdict, srv):
|
def checkProperties(self):
|
||||||
cfgdict.setdefault('description', 'calibrated value of module %r' % cfgdict['rawsensor'])
|
if 'description' not in self.propertyValues:
|
||||||
super().__init__(name, logger, cfgdict, srv)
|
self.description = '_' # avoid complaining about missing description
|
||||||
|
super().checkProperties()
|
||||||
|
|
||||||
def initModule(self):
|
def initModule(self):
|
||||||
self._rawsensor.registerCallbacks(self, ['status']) # auto update status
|
self._rawsensor.registerCallbacks(self, ['status']) # auto update status
|
||||||
self._calib = CalCurve(self.calib)
|
self._calib = CalCurve(self.calib)
|
||||||
|
if self.description == '_':
|
||||||
|
self.description = '%r calibrated with curve %r' % (self.rawsensor, self.calib)
|
||||||
|
|
||||||
def write_calib(self, value):
|
def write_calib(self, value):
|
||||||
self._calib = CalCurve(value)
|
self._calib = CalCurve(value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user