예제 #1
0
def acmd(mods: list) -> cmd.CmdObj:
    """ 
    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
    """
    return cmd.CmdObj(modules=cmd.AddressedCmds(
        cmd.AddressedCmd(match=m, data=o) for m, o in mods))
예제 #2
0
def 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
    """
    return rccmd.RCCommand(id=ccmd.CmdId(cmdid),
                           entry_state=rccmd.State(instate),
                           exit_state=rccmd.State(outstate),
                           data=cmd.CmdObj(modules=cmd.AddressedCmds(
                               cmd.AddressedCmd(match=m, data=o)
                               for m, o in mods)))
예제 #3
0
def conf(modconf=()):
    from dunedaq.appfwk import cmd  # must call make_otypes() first
    return cmd.Command(id=cmd.CmdId("conf"), data=cmd.AddressedCmds(modconf))