DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
appfwk.utils Namespace Reference

Functions

 mspec (inst, plugin, conn_refs)
 
 acmd (list mods)
 
 mcmd (str cmdid, list mods)
 
 mrccmd (cmdid, instate, outstate, mods)
 

Function Documentation

◆ acmd()

appfwk.utils.acmd ( list mods)
Helper function to create appfwk's CmdObj of Addressed module commands.
    
:param      cmdid:  The coommand id
:type       cmdid:  str
:param      mods:   List of module name/data structures 
:type       mods:   list

:returns:   A constructed Command object
:rtype:     dunedaq.appfwk.cmd.Command

Definition at line 35 of file utils.py.

35def acmd(mods: list):
36 """
37 Helper function to create appfwk's CmdObj of Addressed module commands.
38
39 :param cmdid: The coommand id
40 :type cmdid: str
41 :param mods: List of module name/data structures
42 :type mods: list
43
44 :returns: A constructed Command object
45 :rtype: dunedaq.appfwk.cmd.Command
46 """
47 return cmd.CmdObj(
48 modules=cmd.AddressedCmds(
49 cmd.AddressedCmd(match=m, data=o)
50 for m,o in mods
51 )
52 )
53

◆ mcmd()

appfwk.utils.mcmd ( str cmdid,
list mods )
Helper function to create appfwk's Commands addressed to modules.

:param      cmdid:  The coommand id
:type       cmdid:  str
:param      mods:   List of module name/data structures 
:type       mods:   list

:returns:   A constructed Command object
:rtype:     dunedaq.appfwk.cmd.Command

Definition at line 54 of file utils.py.

54def mcmd(cmdid: str, mods: list):
55 """
56 Helper function to create appfwk's Commands addressed to modules.
57
58 :param cmdid: The coommand id
59 :type cmdid: str
60 :param mods: List of module name/data structures
61 :type mods: list
62
63 :returns: A constructed Command object
64 :rtype: dunedaq.appfwk.cmd.Command
65 """
66 return ccmd.Command(
67 id=ccmd.CmdId(cmdid),
68 data=acmd(mods)
69 )
70

◆ mrccmd()

appfwk.utils.mrccmd ( cmdid,
instate,
outstate,
mods )
Helper function to create appfwk's Commands addressed to modules.

:param      cmdid:  The coommand id
:type       cmdid:  str
:param      instate:  The state before command execution
:type       instate:  str
:param      outstate:  The state after command execution
:type       outstate:  str
:param      mods:   List of module name/data structures 
:type       mods:   list

:returns:   A constructed Command object
:rtype:     dunedaq.rcif.cmd.RCCommand

Definition at line 71 of file utils.py.

71def mrccmd(cmdid, instate, outstate, mods):
72 """
73 Helper function to create appfwk's Commands addressed to modules.
74
75 :param cmdid: The coommand id
76 :type cmdid: str
77 :param instate: The state before command execution
78 :type instate: str
79 :param outstate: The state after command execution
80 :type outstate: str
81 :param mods: List of module name/data structures
82 :type mods: list
83
84 :returns: A constructed Command object
85 :rtype: dunedaq.rcif.cmd.RCCommand
86 """
87 return rccmd.RCCommand(
88 id=ccmd.CmdId(cmdid),
89 entry_state=rccmd.State(instate),
90 exit_state=rccmd.State(outstate),
91 data=cmd.CmdObj(
92 modules=cmd.AddressedCmds(
93 cmd.AddressedCmd(match=m, data=o)
94 for m,o in mods
95 )
96 )
97 )
98

◆ mspec()

appfwk.utils.mspec ( inst,
plugin,
conn_refs )
Helper function to create Module Specification objects

:param      inst:    Instance
:type       inst:    str
:param      plugin:  Appfwk Module Plugin name
:type       plugin:  str
:param      cinfos:  List of dunedaq.iomanager.ConnectionRef objects
:type       cinfos:  list

:returns:   A constructed ModSpec object
:rtype:     dunedaq.appfwk.app.ModSpec

Definition at line 15 of file utils.py.

15def mspec(inst, plugin, conn_refs):
16 """
17 Helper function to create Module Specification objects
18
19 :param inst: Instance
20 :type inst: str
21 :param plugin: Appfwk Module Plugin name
22 :type plugin: str
23 :param cinfos: List of dunedaq.iomanager.ConnectionRef objects
24 :type cinfos: list
25
26 :returns: A constructed ModSpec object
27 :rtype: dunedaq.appfwk.app.ModSpec
28 """
29 return app.ModSpec(inst=inst, plugin=plugin,
30 data=app.ModInit(
31 conn_refs=app.ConnectionReferences_t(conn_refs)
32 )
33 )
34