9#ifndef APPFWK_SRC_DAQMODULEMANAGER_HPP_
10#define APPFWK_SRC_DAQMODULEMANAGER_HPP_
13#include "nlohmann/json.hpp"
32 DAQModuleManagerNotInitialized,
33 "Command " << cmdid <<
" received before initialization",
38 "\"init\" Command received when already initialized",
42 CommandDispatchingFailed,
43 "Command " << cmdid << " was not executed correctly by: " << modules,
44 ((
std::
string)cmdid)((
std::
string)modules))
48 "Command " << cmdid << " matches multiple times modules: " << modules,
49 ((
std::
string)cmdid)((
std::
string)modules))
54 ExceptionWhileInfoGathering,
56 module << " threw
exception while info gathering: " << message,
57 ((
std::
string)module),
58 ((
std::
string)message))
62 "No action plan found for command " << cmd << ", taking the following action: " << message,
63 ((
std::
string)cmd)((
std::
string)message))
74 using dataobj_t = nlohmann::json;
76 explicit DAQModuleManager(
const std::string& session_name);
83 void execute(
const std::string& cmd,
const dataobj_t& cmd_data);
86 typedef std::map<std::string, std::shared_ptr<DAQModule>> DAQModuleMap_t;
88 void init_modules(
const std::vector<const dunedaq::confmodel::DaqModule*>& modules,
opmonlib::OpMonManager&);
90 void check_cmd_data(
const std::string&
id,
const dataobj_t& cmd_data);
91 dataobj_t get_dataobj_for_module(
const std::string& mod_name,
const dataobj_t& cmd_data);
92 bool execute_action(
const std::string& mod_name,
const std::string& action,
const dataobj_t& data_obj);
93 void execute_action_plan_step(
const std::string& cmd,
95 const dataobj_t& cmd_data,
96 bool execution_mode_is_serial);
98 void check_mod_has_cmd(
const std::string& cmd,
const std::string& mod_class,
const std::string& mod_id =
"");
101 std::shared_ptr<ConfigurationManager> m_configuration_mgr;
103 std::string m_session_name;
106 DAQModuleMap_t m_module_map;
107 std::map<std::string, std::vector<std::string>> m_modules_by_type;
#define ERS_DECLARE_ISSUE_BASE(namespace_name, class_name, base_class_name, message, base_attributes, attributes)
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
caught dunedaq::conffwk::Exception exception
Unsupported std::string uri Execution of command failed
init Command received when already initialized
LED calibration failed to initialize
DAQModuleManagerAlreadyInitialized
init Command received when already ERS_EMPTY ConflictingCommandMatching