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 auto sessionApps =
session->enabled_applications();
109 std::vector<conffwk::ConfigObject> fragOutObjs;
110 for (
auto app : sessionApps) {
112 if (dfapp ==
nullptr)
116 for (
auto rule : dfNRules) {
117 auto descriptor = rule->get_descriptor();
118 auto data_type = descriptor->get_data_type();
119 if (data_type ==
"Fragment") {
120 std::string dreqNetUid(descriptor->get_uid_base() + dfapp->UID());
122 fragOutObjs.push_back(frag_conn);
128 std::vector<const conffwk::ConfigObject*> fh_output_objs;
129 for (
auto& fNet : fragOutObjs) {
130 fh_output_objs.push_back(&fNet);
133 std::vector<conffwk::ConfigObject> CIB_module_outputs;
136 int id =
static_cast<int>(source_id->get_sid());
142 TLOG() <<
"creating OKS configuration object for CIB Data Link Handler class " << dlhClass <<
", id " << id;
143 std::string uid(
"DLH-CIB");
145 dlhObj.
set_by_val<uint32_t>(
"source_id",
static_cast<uint32_t
>(id));
146 dlhObj.
set_by_val<uint32_t>(
"detector_id",
static_cast<uint32_t
>(det_id));
147 dlhObj.
set_by_val<
bool>(
"post_processing_enabled",
false);
148 dlhObj.
set_obj(
"module_configuration", &dlhConf->config_object());
150 auto net_objc(fh_output_objs);
154 if (dlhConf->get_generate_timesync()) {
155 std::string tsStreamUid = tsNetDesc->
get_uid_base() + std::to_string(
id);
157 net_objc.push_back(&tsNetObj);
160 dlhObj.
set_objs(
"outputs", net_objc);
163 std::string dataQueueUid(dlhInputQDesc->
get_uid_base() + std::string(
"CIB"));
165 queueObj.
rename(dataQueueUid);
167 CIB_module_outputs.push_back(queueObj);
172 dlhObj.
set_objs(
"inputs", { &queueObj, &faNetObj });
177 CIB_module_outputs.push_back(hsiNetObj);
185 std::vector<const conffwk::ConfigObject*> CIB_module_output_ptrs;
186 for (
const auto & o : CIB_module_outputs ) {
187 CIB_module_output_ptrs.push_back( & o );
190 module_obj.
set_objs(
"outputs", CIB_module_output_ptrs);
192 auto module = obj_fac.get_dal<appmodel::CIBModule>(module_obj.UID());
194 modules.push_back(module);
206 json[
"sockets"] = nlohmann::json::object();
207 if (socket_host.has_value())
209 json[
"sockets"][
"receiver"] = nlohmann::json::object();
210 json[
"sockets"][
"receiver"][
"host"] = socket_host.value();
211 json[
"sockets"][
"receiver"][
"port"] = socket_port.value();
215 json[
"sockets"][
"receiver"] = nlohmann::json::object();
220 TLOG() <<
"JSON frag : [" << json.dump() <<
"] " ;