minor fixes
This commit is contained in:
@ -4,6 +4,6 @@ from AbstractSinkHandler import AbstractSinkHandler
|
|||||||
# make sure other derived modules/classes from AbstractSinkHandler/AbstractSinkHandler
|
# make sure other derived modules/classes from AbstractSinkHandler/AbstractSinkHandler
|
||||||
# use the same name for the module and the class within
|
# use the same name for the module and the class within
|
||||||
|
|
||||||
class GenericSinkHandler(AbstractSinkHandler):
|
class DummySinkHandler(AbstractSinkHandler):
|
||||||
def sinkAction(self, dataObject):
|
def sinkAction(self, dataObject):
|
||||||
logger.info(f"sink {self.name} received {dataObject} for experiment {self.experiment}")
|
logger.info(f"sink {self.name} received {dataObject} for experiment {self.experiment}")
|
@ -12,6 +12,7 @@ from SlaveHandler import SlaveHandler
|
|||||||
POISON_PILL = DataObject(name="PoisonPill", topic="kill", payload=None)
|
POISON_PILL = DataObject(name="PoisonPill", topic="kill", payload=None)
|
||||||
TIMEOUT_PILL = DataObject(name="TimeoutPill", topic="timeout", payload=None)
|
TIMEOUT_PILL = DataObject(name="TimeoutPill", topic="timeout", payload=None)
|
||||||
|
|
||||||
|
LOOP_SLICE = 0.1 # seconds
|
||||||
GRACE_PERIOD = 50
|
GRACE_PERIOD = 50
|
||||||
|
|
||||||
class e_State(Enum):
|
class e_State(Enum):
|
||||||
@ -37,7 +38,7 @@ class RigCmdHandler(threading.Thread):
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
dataObject = self.inQueue.get(timeout=0.1)
|
dataObject = self.inQueue.get(timeout=LOOP_SLICE)
|
||||||
except Empty:
|
except Empty:
|
||||||
dataObject = TIMEOUT_PILL
|
dataObject = TIMEOUT_PILL
|
||||||
if (dataObject == POISON_PILL):
|
if (dataObject == POISON_PILL):
|
||||||
|
@ -11,15 +11,15 @@ slaves=dev05 dev06 rig01
|
|||||||
[dev05]
|
[dev05]
|
||||||
topic=rd/set01/rig01/dev05/md
|
topic=rd/set01/rig01/dev05/md
|
||||||
dataObjectName=value
|
dataObjectName=value
|
||||||
sinkHandler=GenericSinkHandler
|
sinkHandler=DummySinkHandler
|
||||||
|
|
||||||
[dev06]
|
[dev06]
|
||||||
topic=rd/set01/rig01/dev06/md
|
topic=rd/set01/rig01/dev06/md
|
||||||
dataObjectName=value
|
dataObjectName=value
|
||||||
sinkHandler=GenericSinkHandler
|
sinkHandler=DummySinkHandler
|
||||||
|
|
||||||
[rig01]
|
[rig01]
|
||||||
topic=rd/set01/rig01/log
|
topic=rd/set01/rig01/log
|
||||||
dataObjectName=log
|
dataObjectName=log
|
||||||
sinkHandler=GenericSinkHandler
|
sinkHandler=DummySinkHandler
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user