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))
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)))