ppms fixes (psi repo!) as of 2022-02-01
Change-Id: I96c81a0772baf5e6038d27d3a40e1163c4669289
This commit is contained in:
parent
903e17a6e5
commit
3b25251e10
@ -73,7 +73,7 @@ class Main(Communicator):
|
|||||||
"""ppms communicator module"""
|
"""ppms communicator module"""
|
||||||
|
|
||||||
pollinterval = Parameter('poll interval', FloatRange(), readonly=False, default=2)
|
pollinterval = Parameter('poll interval', FloatRange(), readonly=False, default=2)
|
||||||
data = Parameter('internal', StringType(), poll=True, export=True, # export for test only
|
data = Parameter('internal', StringType(), poll=True, export=False, # export for test only
|
||||||
default="", readonly=True)
|
default="", readonly=True)
|
||||||
|
|
||||||
class_id = Property('Quantum Design class id', StringType(), export=False)
|
class_id = Property('Quantum Design class id', StringType(), export=False)
|
||||||
@ -89,6 +89,7 @@ class Main(Communicator):
|
|||||||
pollerClass = Poller
|
pollerClass = Poller
|
||||||
|
|
||||||
def earlyInit(self):
|
def earlyInit(self):
|
||||||
|
super().earlyInit()
|
||||||
self.modules = {}
|
self.modules = {}
|
||||||
self._ppms_device = ppmshw.QDevice(self.class_id)
|
self._ppms_device = ppmshw.QDevice(self.class_id)
|
||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
@ -99,8 +100,9 @@ class Main(Communicator):
|
|||||||
def communicate(self, command):
|
def communicate(self, command):
|
||||||
"""GPIB command"""
|
"""GPIB command"""
|
||||||
with self.lock:
|
with self.lock:
|
||||||
|
self.log.debug('> %s' % command)
|
||||||
reply = self._ppms_device.send(command)
|
reply = self._ppms_device.send(command)
|
||||||
self.log.debug("%s|%s", command, reply)
|
self.log.debug('< %s' % reply)
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
def read_data(self):
|
def read_data(self):
|
||||||
@ -143,23 +145,9 @@ class PpmsMixin:
|
|||||||
pollinterval = Parameter('', FloatRange(), needscfg=False, export=False)
|
pollinterval = Parameter('', FloatRange(), needscfg=False, export=False)
|
||||||
|
|
||||||
def initModule(self):
|
def initModule(self):
|
||||||
|
super().initModule()
|
||||||
self._iodev.register(self)
|
self._iodev.register(self)
|
||||||
|
|
||||||
def startModule(self, started_callback):
|
|
||||||
# no polls except on main module
|
|
||||||
started_callback()
|
|
||||||
|
|
||||||
def read_value(self):
|
|
||||||
# polling is done by the main module
|
|
||||||
# and PPMS does not deliver really more fresh values when polled more often
|
|
||||||
return Done
|
|
||||||
|
|
||||||
def read_status(self):
|
|
||||||
# polling is done by the main module
|
|
||||||
# and PPMS does not deliver really fresh status values anyway: the status is not
|
|
||||||
# changed immediately after a target change!
|
|
||||||
return Done
|
|
||||||
|
|
||||||
def update_value_status(self, value, packed_status):
|
def update_value_status(self, value, packed_status):
|
||||||
# update value and status
|
# update value and status
|
||||||
# to be reimplemented for modules looking at packed_status
|
# to be reimplemented for modules looking at packed_status
|
||||||
@ -176,7 +164,7 @@ class PpmsMixin:
|
|||||||
class Channel(PpmsMixin, HasIodev, Readable):
|
class Channel(PpmsMixin, HasIodev, Readable):
|
||||||
"""channel base class"""
|
"""channel base class"""
|
||||||
|
|
||||||
value = Parameter('main value of channels', poll=True)
|
value = Parameter('main value of channels', poll=False, needscfg=False)
|
||||||
enabled = Parameter('is this channel used?', readonly=False, poll=False,
|
enabled = Parameter('is this channel used?', readonly=False, poll=False,
|
||||||
datatype=BoolType(), default=False)
|
datatype=BoolType(), default=False)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user