update code in several drivers

- remove poll arguments
- change from HasIodev to HasIO

Change-Id: I2668f1068c17a50d9aff43b1bb3e4fb03c8d840e
This commit is contained in:
2022-09-08 09:13:03 +02:00
parent 38b3a192ab
commit 0fec736886
7 changed files with 63 additions and 123 deletions

View File

@ -21,10 +21,8 @@
# *****************************************************************************
"""transducer DPM3 read out"""
import time
from secop.core import Readable, Parameter, FloatRange, StringIO,\
HasIodev, IntRange, Done
HasIO, IntRange, Done
class DPM3IO(StringIO):
@ -47,22 +45,22 @@ def float2hex(value, digits):
return '%06X' % intvalue
class DPM3(HasIodev, Readable):
class DPM3(HasIO, Readable):
OFFSET = 0x8f
SCALE = 0x8c
MAGNITUDE = {'1': 1, '2': 10, '3': 100, '4': 1e3, '5': 1e4, '6': 1e5,
'9': -1, 'A': -10, 'B': -100, 'C': -1e3, 'D': -1e4, 'E': -1e5}
iodevClass = DPM3IO
ioClass = DPM3IO
value = Parameter(datatype=FloatRange(unit='N'))
digits = Parameter('number of digits for value', IntRange(0, 5), initwrite=True, readonly=False)
# Note: we have to treat the units properly.
# We got an output of 150 for 10N. The maximal force we want to deal with is 100N,
# thus a maximal output of 1500. 10=150/f
offset = Parameter('', FloatRange(-1e5, 1e5), readonly=False, poll=True)
scale_factor = Parameter('', FloatRange(-1e5, 1e5, unit='input_units/N'), readonly=False, poll=True)
offset = Parameter('', FloatRange(-1e5, 1e5), readonly=False)
scale_factor = Parameter('', FloatRange(-1e5, 1e5, unit='input_units/N'), readonly=False)
def query(self, adr, value=None):
if value is not None: