45std::vector<const confmodel::Resource*>
50std::vector<const confmodel::DaqModule*>
55 std::vector<const confmodel::DaqModule*> modules;
65 auto destination_class = rule->get_destination_class();
66 auto data_type = rule->get_descriptor()->get_data_type();
67 if (destination_class ==
"FakeDataProdModule") {
68 if (data_type ==
"DataRequest") {
69 dlhReqInputQDesc = rule->get_descriptor();
71 }
else if (destination_class ==
"FragmentAggregatorModule") {
72 faOutputQDesc = rule->get_descriptor();
75 if (faOutputQDesc ==
nullptr) {
76 throw(BadConf(
ERS_HERE,
"No fragment output queue descriptor given"));
78 if (dlhReqInputQDesc ==
nullptr) {
79 throw(BadConf(
ERS_HERE,
"No DLH request input queue descriptor given"));
85 auto endpoint_class = rule->get_endpoint_class();
86 if (endpoint_class ==
"FragmentAggregatorModule") {
87 faNetDesc = rule->get_descriptor();
88 }
else if (endpoint_class ==
"FakeDataProdModule") {
89 tsNetDesc = rule->get_descriptor();
92 if (faNetDesc ==
nullptr) {
93 throw(BadConf(
ERS_HERE,
"No Fragment output network descriptor given"));
95 if (tsNetDesc ==
nullptr) {
96 throw(BadConf(
ERS_HERE,
"No TimeSync output network descriptor given"));
102 std::vector<const confmodel::Connection*> faOutputQueues;
108 if (fdpConf->is_disabled(*
session)) {
109 TLOG_DEBUG(7) <<
"Ignoring disabled FakeDataProdConf " << fdpConf->UID();
114 if (stream ==
nullptr) {
115 throw(BadConf(
ERS_HERE,
"ReadoutGroup contains something other than FakeDataProdConf"));
119 std::string uid(
"FakeDataProdModule-" + std::to_string(
id));
120 TLOG_DEBUG(7) <<
"creating OKS configuration object for FakeDataProdModule";
122 dlhObj.
set_obj(
"configuration", &stream->config_object());
125 auto tsNetObj = obj_fac.
create_net_obj(tsNetDesc, std::to_string(
id));
127 dlhObj.
set_objs(
"outputs", { &faQueueObj, &tsNetObj });
133 dlhReqInputQDesc->
get_uid_base() + std::to_string(
id)));
135 dlhObj.
set_objs(
"inputs", { &reqQueueObj });
141 std::string faUid(
"fragmentaggregator-" +
UID());
142 TLOG_DEBUG(7) <<
"creating OKS configuration object for Fragment Aggregator class ";
149 std::vector<const conffwk::ConfigObject*> qObjs;
150 for (
auto q : faOutputQueues) {
151 qObjs.push_back(&q->config_object());
153 faObj.
set_objs(
"inputs", { &faNetObj, &faQueueObj });
conffwk::ConfigObject create_queue_sid_obj(const QueueDescriptor *qdesc, uint32_t src_id) const
conffwk::ConfigObject create_net_obj(const NetworkConnectionDescriptor *ndesc, std::string uid) const
Helper function that gets a network connection config.
const T * get_dal(std::string uid) const
conffwk::ConfigObject create_queue_obj(const QueueDescriptor *qdesc, std::string uid="") const
conffwk::ConfigObject create(const std::string &class_name, const std::string &id) const
std::vector< const dunedaq::confmodel::DaqModule * > generate_modules(const confmodel::Session *) const override
const std::vector< const dunedaq::appmodel::FakeDataProdConf * > & get_producers() const
Get "producers" relationship value. List of configurations of fake data producer modules to be used b...
virtual std::vector< const Resource * > contained_resources() const override
uint32_t get_source_id() const
Get "source_id" attribute value. The SourceID of this link.
const std::string & get_uid_base() const
Get "uid_base" attribute value. Base for UID string. May be combined with a source id.
const std::vector< const dunedaq::appmodel::NetworkConnectionRule * > & get_network_rules() const
Get "network_rules" relationship value.
const std::vector< const dunedaq::appmodel::QueueConnectionRule * > & get_queue_rules() const
Get "queue_rules" relationship value.
void set_objs(const std::string &name, const std::vector< const ConfigObject * > &o, bool skip_non_null_check=false)
Set relationship multi-value.
void set_obj(const std::string &name, const ConfigObject *o, bool skip_non_null_check=false)
Set relationship single-value.
const std::string & UID() const noexcept
std::vector< const dunedaq::confmodel::Resource * > to_resources(const std::vector< T * > &vector_of_children)
#define TLOG_DEBUG(lvl,...)