42 std::vector<const confmodel::DaqModule*> modules;
48 auto dlhClass = dlhConf->get_template_for();
53 if (dlhConf->get_generate_timesync()) {
54 throw(BadConf(
ERS_HERE,
"TimeSync generation is enabled for a FakeHSIApplication and this is not allowed"));
60 auto destination_class = rule->get_destination_class();
61 auto data_type = rule->get_descriptor()->get_data_type();
62 if (destination_class ==
"DataHandlerModule" || destination_class == dlhClass) {
63 dlhInputQDesc = rule->get_descriptor();
72 auto endpoint_class = rule->get_endpoint_class();
73 auto data_type = rule->get_descriptor()->get_data_type();
75 if (endpoint_class ==
"DataHandlerModule" || endpoint_class == dlhClass) {
76 if (data_type ==
"TimeSync") {
77 tsNetDesc = rule->get_descriptor();
79 if (data_type ==
"DataRequest") {
80 dlhReqInputNetDesc = rule->get_descriptor();
83 if (data_type ==
"HSIEvent") {
84 hsiNetDesc = rule->get_descriptor();
90 throw(BadConf(
ERS_HERE,
"No FakeHSIEventGeneratorModule configuration given"));
92 if (dlhInputQDesc ==
nullptr) {
93 throw(BadConf(
ERS_HERE,
"No DLH data input queue descriptor given"));
95 if (dlhReqInputNetDesc ==
nullptr) {
96 throw(BadConf(
ERS_HERE,
"No DLH request input network descriptor given"));
98 if (hsiNetDesc ==
nullptr) {
99 throw(BadConf(
ERS_HERE,
"No HSIEvent output network descriptor given"));
103 if (idconf ==
nullptr) {
104 throw(BadConf(
ERS_HERE,
"No SourceIDConf given"));
106 auto id = idconf->get_sid();
109 std::string uid(
"DLH-" + std::to_string(
id));
110 TLOG_DEBUG(7) <<
"creating OKS configuration object for Data Link Handler class " << dlhClass <<
", id " << id;
113 dlhObj.
set_by_val<uint32_t>(
"detector_id", det_id);
114 dlhObj.
set_by_val<
bool>(
"post_processing_enabled",
false);
115 dlhObj.
set_obj(
"module_configuration", &dlhConf->config_object());
119 std::vector<conffwk::ConfigObject> fragOutObjs;
120 for (
auto [uid, descriptor]:
121 helper->get_netdescriptors(
"Fragment",
"DFApplication")) {
122 fragOutObjs.emplace_back(obj_fac.
create_net_obj(descriptor, uid));
126 std::vector<const conffwk::ConfigObject*> fh_output_objs;
127 for (
auto& fNet : fragOutObjs) {
128 fh_output_objs.push_back(&fNet);
132 if (dlhConf->get_generate_timesync()) {
134 fh_output_objs.push_back(&tsNetObj);
136 dlhObj.
set_objs(
"outputs", fh_output_objs);
141 dlhObj.
set_objs(
"inputs", { &queueObj, &faNetObj });
148 std::string genuid(
"FakeHSI-" + std::to_string(
id));
150 obj_fac.
create(
"FakeHSIEventGeneratorModule", genuid);
151 fakehsiObj.
set_obj(
"configuration", &rdrConf->config_object());
152 fakehsiObj.
set_objs(
"outputs", { &queueObj, &hsiNetObj });
153 if (tsNetDesc !=
nullptr) {
155 fakehsiObj.
set_objs(
"inputs", { &tsNetObjIn });