From d77ed99bc65c8601a7e6a2b4d8d2219d9e72e26a Mon Sep 17 00:00:00 2001 From: Artur Sztuc Date: Tue, 26 Nov 2024 13:01:45 +0100 Subject: [PATCH 1/4] Adding ta/tc gen option to triggerapp schema --- schema/appmodel/trigger.schema.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schema/appmodel/trigger.schema.xml b/schema/appmodel/trigger.schema.xml index 4e2801d..6783049 100644 --- a/schema/appmodel/trigger.schema.xml +++ b/schema/appmodel/trigger.schema.xml @@ -385,6 +385,8 @@ + + From 413d8cecfe01b9de52367814fa23ac335b6f6337 Mon Sep 17 00:00:00 2001 From: Artur Sztuc Date: Tue, 26 Nov 2024 13:02:22 +0100 Subject: [PATCH 2/4] Reduce redundant code & add ta/tc gen option in TriggerApp --- src/TriggerApplication.cpp | 47 +++++++++++++++----------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/src/TriggerApplication.cpp b/src/TriggerApplication.cpp index 005fa2d..f233b0f 100644 --- a/src/TriggerApplication.cpp +++ b/src/TriggerApplication.cpp @@ -127,14 +127,14 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb, rule->get_descriptor()->get_data_type() == "TriggerCandidate") { // For TA->TC tout_net_desc = rule->get_descriptor(); - handler_name = "tahandler"; + handler_name = "tahandler"; } else if (tin_net_desc->get_data_type() == "TriggerCandidate" && rule->get_descriptor()->get_data_type() == "TriggerActivity") { // For TA->TC if we saved TC network connection as input first... tout_net_desc = tin_net_desc; tin_net_desc = rule->get_descriptor(); - handler_name = "tahandler"; + handler_name = "tahandler"; } else { throw (BadConf(ERS_HERE, "Unexpected input & output network connection descriptors provided")); @@ -156,7 +156,6 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb, conffwk::ConfigObject tin_net_obj; conffwk::ConfigObject tout_net_obj; conffwk::ConfigObject tset_out_net_obj; - //auto handlerConf = get_trigger_inputs_handler(); if ( req_net_desc== nullptr) { throw (BadConf(ERS_HERE, "No network descriptor given to receive request and send data was set")); @@ -177,36 +176,19 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb, input_queue_obj.set_by_val("queue_type", ti_inputq_desc->get_queue_type()); input_queue_obj.set_by_val("capacity", ti_inputq_desc->get_capacity()); - auto req_service_obj = req_net_desc->get_associated_service()->config_object(); - std::string req_net_uid(req_net_desc->get_uid_base()+UID());; - confdb->create(dbfile, "NetworkConnection", req_net_uid, req_net_obj); - req_net_obj.set_by_val("connection_type", req_net_desc->get_connection_type()); - req_net_obj.set_by_val("data_type", req_net_desc->get_data_type()); - req_net_obj.set_obj("associated_service", &req_service_obj); - - auto tin_service_obj = tin_net_desc->get_associated_service()->config_object(); - std::string t_in_stream_uid(tin_net_desc->get_uid_base()+".*"); - confdb->create(dbfile, "NetworkConnection", t_in_stream_uid, tin_net_obj); - tin_net_obj.set_by_val("data_type", tin_net_desc->get_data_type()); - tin_net_obj.set_by_val("connection_type", tin_net_desc->get_connection_type()); - tin_net_obj.set_obj("associated_service", &tin_service_obj); - - auto tout_service_obj = tout_net_desc->get_associated_service()->config_object(); - std::string t_stream_uid(tout_net_desc->get_uid_base()+UID()); - confdb->create(dbfile, "NetworkConnection", t_stream_uid, tout_net_obj); - tout_net_obj.set_by_val("data_type", tout_net_desc->get_data_type()); - tout_net_obj.set_by_val("connection_type", tout_net_desc->get_connection_type()); - tout_net_obj.set_obj("associated_service", &tout_service_obj); + + req_net_obj = create_network_connection(req_net_desc->get_uid_base()+UID(), + req_net_desc, confdb, dbfile); + tin_net_obj = create_network_connection(tin_net_desc->get_uid_base()+".*", + tin_net_desc, confdb, dbfile); + tout_net_obj = create_network_connection(tout_net_desc->get_uid_base()+UID(), + tout_net_desc, confdb, dbfile); if (tset_out_net_desc) { - auto tset_out_service_obj = tset_out_net_desc->get_associated_service()->config_object(); - std::string tset_stream_uid(tset_out_net_desc->get_uid_base()+UID()); - confdb->create(dbfile, "NetworkConnection", tset_stream_uid, tset_out_net_obj); - tset_out_net_obj.set_by_val("data_type", tset_out_net_desc->get_data_type()); - tset_out_net_obj.set_by_val("connection_type", tset_out_net_desc->get_connection_type()); - tset_out_net_obj.set_obj("associated_service", &tset_out_service_obj); + tset_out_net_obj = create_network_connection(tset_out_net_desc->get_uid_base()+UID(), + tset_out_net_desc, confdb, dbfile); } auto ti_conf_obj = ti_conf->config_object(); @@ -219,6 +201,13 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb, confdb->create(dbfile, ti_class, ti_uid, ti_obj); ti_obj.set_by_val("source_id", source_id); ti_obj.set_by_val("detector_id", 1); // 1 == kDAQ + if (handler_name == "tphandler") { + ti_obj.set_by_val("post_processing_enabled", get_ta_generation_enabled()); + } + if (handler_name == "tahandler") { + ti_obj.set_by_val("post_processing_enabled", get_tc_generation_enabled()); + } + ti_obj.set_obj("module_configuration", &ti_conf_obj); ti_obj.set_objs("inputs", {&input_queue_obj, &req_net_obj}); if (tset_out_net_desc!= nullptr) { From 8d65a624c925659484d22104f85443d8d19f7031 Mon Sep 17 00:00:00 2001 From: Artur Sztuc Date: Tue, 26 Nov 2024 14:55:31 +0100 Subject: [PATCH 3/4] Expanding description for ta/tc - generation disabling --- schema/appmodel/trigger.schema.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/appmodel/trigger.schema.xml b/schema/appmodel/trigger.schema.xml index 6783049..3408794 100644 --- a/schema/appmodel/trigger.schema.xml +++ b/schema/appmodel/trigger.schema.xml @@ -385,8 +385,8 @@ - - + + From cb53d273b2415230ca3bc1c5dfe78e924f014874 Mon Sep 17 00:00:00 2001 From: Artur Sztuc Date: Tue, 3 Dec 2024 17:51:34 +0100 Subject: [PATCH 4/4] Renaming attribute disabling post-processing in trigger app --- schema/appmodel/trigger.schema.xml | 3 +-- src/TriggerApplication.cpp | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/schema/appmodel/trigger.schema.xml b/schema/appmodel/trigger.schema.xml index 3408794..facd907 100644 --- a/schema/appmodel/trigger.schema.xml +++ b/schema/appmodel/trigger.schema.xml @@ -385,8 +385,7 @@ - - + diff --git a/src/TriggerApplication.cpp b/src/TriggerApplication.cpp index f233b0f..f6ef707 100644 --- a/src/TriggerApplication.cpp +++ b/src/TriggerApplication.cpp @@ -201,12 +201,7 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb, confdb->create(dbfile, ti_class, ti_uid, ti_obj); ti_obj.set_by_val("source_id", source_id); ti_obj.set_by_val("detector_id", 1); // 1 == kDAQ - if (handler_name == "tphandler") { - ti_obj.set_by_val("post_processing_enabled", get_ta_generation_enabled()); - } - if (handler_name == "tahandler") { - ti_obj.set_by_val("post_processing_enabled", get_tc_generation_enabled()); - } + ti_obj.set_by_val("post_processing_enabled", !get_tx_generation_disabled()); ti_obj.set_obj("module_configuration", &ti_conf_obj); ti_obj.set_objs("inputs", {&input_queue_obj, &req_net_obj});