main module of LS370 is now drivable

- the main value is the channel
- it is busy when pausing during scanning
+ allow softcal to ignore the sign
This commit is contained in:
l_samenv
2020-11-10 07:57:48 +01:00
parent ad07ecdd69
commit 82b4af4faa
2 changed files with 15 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ import math
import numpy as np
from scipy.interpolate import splrep, splev # pylint: disable=import-error
from secop.core import Readable, Parameter, Override, Attached, StringType
from secop.core import Readable, Parameter, Override, Attached, StringType, BoolType
def linear(x):
@@ -152,6 +152,7 @@ class Sensor(Readable):
}
parameters = {
'calib': Parameter('calibration name', datatype=StringType(), readonly=False),
'abs': Parameter('True: take abs(raw) before calib', datatype=BoolType(), readonly=False, default=True),
'value': Override(unit='K'),
'pollinterval': Override(export=False),
'status': Override(default=(Readable.Status.ERROR, 'unintialized'))
@@ -169,10 +170,15 @@ class Sensor(Readable):
return value
def update_value(self, value):
if self.abs:
value = abs(value)
self.value = self._calib(value)
self._value_error = None
def error_update_value(self, err):
if self.abs and str(err) == 'R_UNDER':
self._value_error = None
return None
self._value_error = repr(err)
raise err