46 TLOG_DEBUG(6) <<
"Generating modules for application " << this->
UID();
48 std::vector<const confmodel::DaqModule*> modules;
58 if (reader_conf == 0) {
59 throw(BadConf(
ERS_HERE,
"No DataReaderModule configuration given"));
61 const std::string reader_class = reader_conf->get_template_for();
65 if (writer_confs.size() == 0) {
66 throw(BadConf(
ERS_HERE,
"No DataWriterModule configuration given"));
74 if (raw_data_callback_desc ==
nullptr) {
75 throw(BadConf(
ERS_HERE,
"No Raw Data Callback descriptor given"));
85 std::map<uint32_t, const appmodel::DataMoveCallbackConf*> callback_confs_by_sid;
87 uint16_t conn_idx = 0;
92 if (helper->is_disabled(d2d_conn)) {
93 TLOG_DEBUG(7) <<
"Ignoring disabled DetectorToDaqConnection " << d2d_conn->UID();
97 TLOG_DEBUG(6) <<
"Processing DetectorToDaqConnection " << d2d_conn->UID();
100 std::vector<const confmodel::DetectorStream*> enabled_det_streams;
102 for (
auto stream : d2d_conn->streams()) {
105 if (helper->is_disabled(stream)) {
106 TLOG_DEBUG(7) <<
"Ignoring disabled DetectorStream " << stream->UID();
110 enabled_det_streams.push_back(stream);
114 std::vector<const conffwk::ConfigObject*> raw_data_callback_objs;
117 for (
auto ds : enabled_det_streams) {
120 raw_data_callback_objs.push_back(&callback_conf->config_object());
121 callback_confs_by_sid[ds->get_source_id()] = callback_conf;
135 std::string reader_uid(fmt::format(
"crtdatareader-{}-{}", this->
UID(), std::to_string(conn_idx++)));
136 TLOG_DEBUG(6) << fmt::format(
"creating OKS configuration object for Data reader class {} with id {}", reader_class, reader_uid);
137 auto reader_obj = obj_fac.
create(reader_class, reader_uid);
140 reader_obj.
set_obj(
"configuration", &reader_conf->config_object());
141 reader_obj.set_objs(
"connections", { &d2d_conn->config_object() });
142 reader_obj.set_objs(
"raw_data_callbacks", raw_data_callback_objs);
159 for (
const auto writer_conf : writer_confs) {
161 const std::string writer_class = writer_conf->get_template_for();
163 std::string writer_uid(fmt::format(
"socketdatawriter-{}-{}", this->
UID(), std::to_string(conn_idx++)));
165 "Creating OKS configuration object for socket data writer class {} with id {}", writer_class, writer_uid);
166 auto writer_obj = obj_fac.
create(writer_class, writer_uid);
169 writer_obj.
set_obj(
"configuration", &writer_conf->config_object());
170 writer_obj.set_objs(
"connections", {&d2d_conn->config_object()});