result from merge with gerrit

secop subdir only

Change-Id: I65ab7049719b374ae3ec0259483e7e7d16aafcd1
This commit is contained in:
2022-03-07 17:49:08 +01:00
parent dee3514065
commit bd246c5ca7
20 changed files with 760 additions and 583 deletions

View File

@ -27,13 +27,10 @@ from time import sleep
from secop.datatypes import FloatRange
from secop.lib import mkthread
from secop.modules import BasicPoller, Drivable, \
Module, Parameter, Readable, Writable, Command
from secop.modules import Drivable, Module, Parameter, Readable, Writable, Command
class SimBase:
pollerClass = BasicPoller
def __new__(cls, devname, logger, cfgdict, dispatcher):
extra_params = cfgdict.pop('extra_params', '') or cfgdict.pop('.extra_params', '')
attrs = {}
@ -60,6 +57,7 @@ class SimBase:
return object.__new__(type('SimBase_%s' % devname, (cls,), attrs))
def initModule(self):
super().initModule()
self._sim_thread = mkthread(self._sim)
def _sim(self):
@ -119,7 +117,7 @@ class SimDrivable(SimReadable, Drivable):
self._value = self.target
speed *= self.interval
try:
self.pollParams(0)
self.doPoll()
except Exception:
pass
@ -132,7 +130,7 @@ class SimDrivable(SimReadable, Drivable):
self._value = self.target
sleep(self.interval)
try:
self.pollParams(0)
self.doPoll()
except Exception:
pass
self.status = self.Status.IDLE, ''