set unit together with datatype

Change-Id: I412471880e71792160ee56a79375dc62dd4aaafc
This commit is contained in:
2021-10-06 09:07:09 +02:00
parent 21dfcbd290
commit 09056ea87e
2 changed files with 29 additions and 30 deletions

View File

@ -27,7 +27,7 @@ from os.path import basename, 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
from secop.core import Attached, BoolType, Parameter, Readable, StringType, FloatRange
def linear(x):
@ -174,7 +174,7 @@ class Sensor(Readable):
calib = Parameter('calibration name', datatype=StringType(), readonly=False)
abs = Parameter('True: take abs(raw) before calib', datatype=BoolType(), readonly=False, default=True)
value = Parameter(unit='K')
value = Parameter(datatype=FloatRange(unit='K'))
pollinterval = Parameter(export=False)
status = Parameter(default=(Readable.Status.ERROR, 'unintialized'))