45 std::vector<const confmodel::DaqModule*> modules;
51 auto dlhClass = dlhConf->get_template_for();
56 if (dlhConf->get_generate_timesync()) {
57 throw(BadConf(
ERS_HERE,
"TimeSync generation is enabled for a FakeHSIApplication and this is not allowed"));
63 auto destination_class = rule->get_destination_class();
64 auto data_type = rule->get_descriptor()->get_data_type();
65 if (destination_class ==
"DataHandlerModule" || destination_class == dlhClass) {
66 dlhInputQDesc = rule->get_descriptor();
75 auto endpoint_class = rule->get_endpoint_class();
76 auto data_type = rule->get_descriptor()->get_data_type();
78 if (endpoint_class ==
"DataHandlerModule" || endpoint_class == dlhClass) {
79 if (data_type ==
"TimeSync") {
80 tsNetDesc = rule->get_descriptor();
82 if (data_type ==
"DataRequest") {
83 dlhReqInputNetDesc = rule->get_descriptor();
86 if (data_type ==
"HSIEvent") {
87 hsiNetDesc = rule->get_descriptor();
93 throw(BadConf(
ERS_HERE,
"No FakeHSIEventGeneratorModule configuration given"));
95 if (dlhInputQDesc ==
nullptr) {
96 throw(BadConf(
ERS_HERE,
"No DLH data input queue descriptor given"));
98 if (dlhReqInputNetDesc ==
nullptr) {
99 throw(BadConf(
ERS_HERE,
"No DLH request input network descriptor given"));
101 if (hsiNetDesc ==
nullptr) {
102 throw(BadConf(
ERS_HERE,
"No HSIEvent output network descriptor given"));
106 if (idconf ==
nullptr) {
107 throw(BadConf(
ERS_HERE,
"No SourceIDConf given"));
109 auto id = idconf->get_sid();
112 std::string uid(
"DLH-" + std::to_string(
id));
113 TLOG_DEBUG(7) <<
"creating OKS configuration object for Data Link Handler class " << dlhClass <<
", id " << id;
116 dlhObj.
set_by_val<uint32_t>(
"detector_id", det_id);
117 dlhObj.
set_by_val<
bool>(
"post_processing_enabled",
false);
118 dlhObj.
set_obj(
"module_configuration", &dlhConf->config_object());
122 auto sessionApps =
session->enabled_applications();
123 std::vector<conffwk::ConfigObject> fragOutObjs;
124 for (
auto app : sessionApps) {
126 if (dfapp ==
nullptr)
130 for (
auto rule : dfNRules) {
131 auto descriptor = rule->get_descriptor();
132 auto data_type = descriptor->get_data_type();
133 if (data_type ==
"Fragment") {
136 fragOutObjs.push_back(frag_conn);
142 std::vector<const conffwk::ConfigObject*> fh_output_objs;
143 for (
auto& fNet : fragOutObjs) {
144 fh_output_objs.push_back(&fNet);
148 if (dlhConf->get_generate_timesync()) {
150 fh_output_objs.push_back(&tsNetObj);
152 dlhObj.
set_objs(
"outputs", fh_output_objs);
157 dlhObj.
set_objs(
"inputs", { &queueObj, &faNetObj });
164 std::string genuid(
"FakeHSI-" + std::to_string(
id));
166 obj_fac.
create(
"FakeHSIEventGeneratorModule", genuid);
167 fakehsiObj.
set_obj(
"configuration", &rdrConf->config_object());
168 fakehsiObj.
set_objs(
"outputs", { &queueObj, &hsiNetObj });
169 if (tsNetDesc !=
nullptr) {
171 fakehsiObj.
set_objs(
"inputs", { &tsNetObjIn });