55 std::vector<const confmodel::DaqModule*> modules;
60 auto dlhClass = dlhConf->get_template_for();
65 auto destination_class = rule->get_destination_class();
66 if (destination_class ==
"DataHandlerModule" || destination_class == dlhClass) {
67 dlhInputQDesc = rule->get_descriptor();
76 auto endpoint_class = rule->get_endpoint_class();
77 auto data_type = rule->get_descriptor()->get_data_type();
79 if (endpoint_class ==
"DataHandlerModule" || endpoint_class == dlhClass) {
80 if (data_type ==
"TimeSync") {
81 tsNetDesc = rule->get_descriptor();
83 if (data_type ==
"DataRequest") {
84 dlhReqInputNetDesc = rule->get_descriptor();
87 if (data_type ==
"HSIEvent") {
88 hsiNetDesc = rule->get_descriptor();
93 if (CIB_conf ==
nullptr) {
94 throw(BadConf(
ERS_HERE,
"No CIBModule configuration given"));
96 if (dlhInputQDesc ==
nullptr) {
97 throw(BadConf(
ERS_HERE,
"No DLH data input queue descriptor given"));
99 if (dlhReqInputNetDesc ==
nullptr) {
100 throw(BadConf(
ERS_HERE,
"No DLH request input network descriptor given"));
102 if (hsiNetDesc ==
nullptr) {
103 throw(BadConf(
ERS_HERE,
"No HSIEvent output network descriptor given"));
108 std::vector<conffwk::ConfigObject> fragOutObjs;
109 for (
auto [uid, descriptor]:
110 helper->get_netdescriptors(
"Fragment",
"DFApplication")) {
111 fragOutObjs.emplace_back(obj_fac.
create_net_obj(descriptor, uid));
115 std::vector<const conffwk::ConfigObject*> fh_output_objs;
116 for (
auto& fNet : fragOutObjs) {
117 fh_output_objs.push_back(&fNet);
120 std::vector<conffwk::ConfigObject> CIB_module_outputs;
123 int id =
static_cast<int>(source_id->get_sid());
129 TLOG() <<
"creating OKS configuration object for CIB Data Link Handler class " << dlhClass <<
", id " << id;
130 std::string uid(
"DLH-CIB");
132 dlhObj.
set_by_val<uint32_t>(
"source_id",
static_cast<uint32_t
>(id));
133 dlhObj.
set_by_val<uint32_t>(
"detector_id",
static_cast<uint32_t
>(det_id));
134 dlhObj.
set_by_val<
bool>(
"post_processing_enabled",
false);
135 dlhObj.
set_obj(
"module_configuration", &dlhConf->config_object());
137 auto net_objc(fh_output_objs);
141 if (dlhConf->get_generate_timesync()) {
142 std::string tsStreamUid = tsNetDesc->
get_uid_base() + std::to_string(
id);
144 net_objc.push_back(&tsNetObj);
147 dlhObj.
set_objs(
"outputs", net_objc);
150 std::string dataQueueUid(dlhInputQDesc->
get_uid_base() + std::string(
"CIB"));
152 queueObj.
rename(dataQueueUid);
154 CIB_module_outputs.push_back(queueObj);
159 dlhObj.
set_objs(
"inputs", { &queueObj, &faNetObj });
164 CIB_module_outputs.push_back(hsiNetObj);
172 std::vector<const conffwk::ConfigObject*> CIB_module_output_ptrs;
173 for (
const auto & o : CIB_module_outputs ) {
174 CIB_module_output_ptrs.push_back( & o );
177 module_obj.
set_objs(
"outputs", CIB_module_output_ptrs);
179 auto module = obj_fac.get_dal<appmodel::CIBModule>(module_obj.UID());
181 modules.push_back(module);
193 json[
"sockets"] = nlohmann::json::object();
194 if (socket_host.has_value())
196 json[
"sockets"][
"receiver"] = nlohmann::json::object();
197 json[
"sockets"][
"receiver"][
"host"] = socket_host.value();
198 json[
"sockets"][
"receiver"][
"port"] = socket_port.value();
202 json[
"sockets"][
"receiver"] = nlohmann::json::object();
207 TLOG() <<
"JSON frag : [" << json.dump() <<
"] " ;