39ConfigurationManager::ConfigurationManager(std::string
const& config_spec,
40 std::string
const& app_name,
41 std::string
const& session_name)
42 : m_confdb(new
conffwk::Configuration(config_spec))
43 , m_app_name(app_name)
44 , m_session_name(session_name)
45 , m_oks_config_spec(config_spec)
47 TLOG() <<
"configSpec <" << config_spec <<
"> session name " << session_name <<
" application name " << app_name;
49 TLOG_DBG(
TLVL_SESSION) <<
"getting session " << session_name;
51 if (m_session ==
nullptr) {
52 TLOG() <<
"Failed to get session " << session_name;
58ConfigurationManager::initialize()
63 TLOG_DBG(
TLVL_APP) <<
"getting app " << m_app_name;
65 if (m_application ==
nullptr) {
66 TLOG() <<
"Failed to get app " << m_app_name;
70 TLOG_DBG(
TLVL_APP) <<
"getting modules for app " << m_app_name;
73 auto cpos = m_oks_config_spec.find(
":") + 1;
74 std::string oksFile = m_oks_config_spec.substr(cpos);
75 m_modules = smart_daq_app->generate_modules(m_session);
77 for (
auto& plan : smart_daq_app->get_action_plans()) {
78 auto cmd = plan->get_command()->get_cmd();
79 TLOG_DBG(
TLVL_ACTION_PLAN) <<
"Registering action plan " << plan->UID() <<
" for cmd " << cmd;
80 if (m_action_plans.count(cmd)) {
81 throw ActionPlanValidationFailed(
82 ERS_HERE, cmd,
"N/A",
"Multiple ActionPlans registered for cmd, conflicting plan is " + plan->UID());
84 m_action_plans[cmd] = plan;
89 m_modules = daq_app->get_modules();
91 for (
auto& plan : daq_app->get_action_plans()) {
92 auto cmd = plan->get_command()->get_cmd();
93 TLOG_DBG(
TLVL_ACTION_PLAN) <<
"Registering action plan " << plan->UID() <<
" for cmd " << cmd;
94 if (m_action_plans.count(cmd)) {
95 throw ActionPlanValidationFailed(
96 ERS_HERE, cmd,
"N/A",
"Multiple ActionPlans registered for cmd, conflicting plan is " + plan->UID());
98 m_action_plans[cmd] = plan;
101 throw(NotADaqApplication(
ERS_HERE, m_application->UID()));
105 m_connsvc_config = m_session->get_connectivity_service();
107 std::set<std::string> connectionsAdded;
108 for (
auto mod : m_modules) {
109 TLOG_DBG(
TLVL_MODULE) <<
"initialising " << mod->class_name() <<
" module " << mod->UID();
111 auto outputs = mod->get_outputs();
113 for (
auto con : connections) {
114 auto [
c, inserted] = connectionsAdded.insert(con->UID());
121 TLOG_DBG(
TLVL_QUEUE) <<
"Adding queue " << queue->UID();
122 m_queues.emplace_back(queue);
126 m_networkconnections.emplace_back(net_con);
131 m_initialized =
true;
135ConfigurationManager::action_plan(std::string cmd)
const
137 if (m_action_plans.count(cmd)) {
138 return m_action_plans.at(cmd);
const TARGET * cast() const noexcept
Casts object to different class.
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...