49 std::vector<const confmodel::DaqModule*> modules;
51 std::map<std::string, std::vector<const appmodel::HermesDataSender*>> ctrlhost_sender_map;
58 if (d2d_conn_res->disabled(*
session)) {
59 TLOG_DEBUG(7) <<
"Ignoring disabled DetectorToDaqConnection " << d2d_conn_res->UID();
63 TLOG_DEBUG(6) <<
"Processing DetectorToDaqConnection " << d2d_conn_res->UID();
68 throw(BadConf(
ERS_HERE,
"ReadoutApplication contains something other than DetectorToDaqConnection"));
71 if (d2d_conn->get_contains().empty()) {
72 throw(BadConf(
ERS_HERE,
"DetectorToDaqConnection does not contain senders or receivers"));
76 auto det_receiver = d2d_conn->get_receiver();
82 throw(BadConf(
ERS_HERE, fmt::format(
"WEICApplication requires NWDetDataReceiver, found {} of class {}", det_receiver->UID(), det_receiver->class_name())));
86 for (
const auto* sender : det_senders) {
88 if ( sender->disabled(*
session) ) {
89 TLOG() <<
"Skipping disabled sender: " << sender->UID();
96 throw(BadConf(
ERS_HERE, fmt::format(
"DataSender {} is not a appmodel::HermesDataSender", sender->UID())));
99 ctrlhost_sender_map[hrms_sender->get_control_host()].push_back(hrms_sender);
103 for(
const auto& [ctrlhost, senders] : ctrlhost_sender_map ) {
108 bool enable_fembs[4] = {
false,
false,
false,
false};
110 for (
const auto* sender : senders ){
111 for (
const auto* res : sender->get_contains() ) {
116 uint32_t femb_id = (stream_id & 0xf) / 2 + 2*((stream_id >> 6) & 0xf);
122 enable_fembs[femb_id] |= !det_stream->disabled(*
session);
126 std::string wib_uid = fmt::format(
"wib-ctrl-{}-{}", this->
UID(), ctrlhost);
127 config->
create(dbfile,
"WIBModule", wib_uid, wib_obj);
129 wib_obj.
set_by_val<
bool>(
"enabled_femb0", enable_fembs[0]);
130 wib_obj.
set_by_val<
bool>(
"enabled_femb1", enable_fembs[1]);
131 wib_obj.
set_by_val<
bool>(
"enabled_femb2", enable_fembs[2]);
132 wib_obj.
set_by_val<
bool>(
"enabled_femb3", enable_fembs[3]);
140 std::string hermes_uid = fmt::format(
"hermes-ctrl-{}-{}", this->
UID(), ctrlhost);
141 config->
create(dbfile,
"HermesModule", hermes_uid, hermes_obj);
145 hermes_obj.
set_obj(
"destination", &nw_receiver->get_uses()->config_object());
147 std::vector< const conffwk::ConfigObject * > links_obj;
148 for (
const auto* sndr : senders ){
149 links_obj.push_back(&sndr->config_object());
151 hermes_obj.
set_objs(
"links", links_obj);
void get(const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
Get object by class name and object id (multi-thread safe).