3 from robot.api
import logger
4 from robot.utils
import DotDict
5 from robot.utils
import timestr_to_secs
8 from ModDaqif.Daqif
import (
12 from ModDaqif.Daqif.OcmDaqControl
import OcmDaqControlSync
13 from ModStdif.Stdif.StdCmds
import StdCmdsSync
19 uris = arg.split(
"@")[1]
20 return uris.split(
",")[0]
25 return DotDict(id=r.getId(), error=r.getError())
32 state=str(r.getState()).split(
".")[1],
33 subState=str(r.getSubState()).split(
".")[1],
36 message=r.getMessage(),
37 timestamp=r.getTimestamp(),
47 """Robot library providing keywords for the daqif.OcmDaqControl and stdif interface"""
51 ROBOT_LIBRARY_SCOPE =
"GLOBAL"
54 logger.debug(
"Loading MAL and creating factory")
55 self.
mal = pymal.loadMal(
"zpb", {})
56 self.
factory = pymal.CiiFactory.getInstance()
58 logger.debug(
"Loading MAL and creating factory done")
61 """Creates RR clientss with a given ReplyTime timeout."""
62 timeout = timestr_to_secs(timeout)
if timeout
is not None else 5
64 logger.info(
"Create client for uri %s with timeout %d" % (root_uri, timeout))
66 clients.daq = self.
factory.getClient(
69 pymal.rr.qos.ReplyTime(datetime.timedelta(seconds=timeout)),
71 clients.std = self.
factory.getClient(
74 pymal.rr.qos.ReplyTime(datetime.timedelta(seconds=timeout)),
79 logger.info(
"OcmDaqControl.GetStatus(%s): Sending request", daq_id)
80 r = clients.daq.GetStatus(daq_id)
81 logger.info(
"OcmDaqControl.GetStatus(%s): Got reply", daq_id)
85 logger.info(
"OcmDaqControl.ForceAbort(%s): Sending request", daq_id)
86 r = clients.daq.ForceAbortDaq(daq_id)
87 logger.info(
"OcmDaqControl.ForceAbort(%s): Got reply", daq_id)
91 logger.info(
"StdCmds.GetState(): Sending request")
92 r = clients.std.GetState()
93 logger.info(
"StdCmds.GetState(): Got reply")
97 logger.info(
"OcmDaqControl.GetActive(): Sending request")
98 daqs = clients.daq.GetActiveList()
99 logger.info(
"OcmDaqControl.GetActive(): Got reply")