@@ -48,7 +48,7 @@ CardConfigurator::CardConfigurator(Parameters& parameters, bool forceConfigure)
4848 auto bar2 = ChannelFactory ().getBar (parameters);
4949 bar2->configure (forceConfigure);
5050 } else if (cardType == CardType::Crorc) {
51- parameters.setChannelNumber (0 ); // we need to change bar 0
51+ parameters.setChannelNumber (0 ); // we need to change to bar 0
5252 auto bar0 = ChannelFactory ().getBar (parameters);
5353 bar0->configure (forceConfigure);
5454 }
@@ -68,11 +68,39 @@ void CardConfigurator::parseConfigUri(CardType::type cardType, std::string confi
6868 }
6969}
7070
71- void CardConfigurator::parseConfigUriCrorc (std::string /* configUri*/ , Parameters& /* parameters*/ ) // TODO: Fill me
71+ // / configUri has to start with "ini://", "json://" or "consul://"
72+ void CardConfigurator::parseConfigUriCrorc (std::string configUri, Parameters& parameters)
7273{
73- Logger::get () << " Non-parameter configuration not supported for the CRORC yet" << LogErrorOps << endm;
74- BOOST_THROW_EXCEPTION (Exception ());
74+ bool dynamicOffset = false ;
75+ uint32_t timeFrameLength = 0x100 ;
76+
77+ std::unique_ptr<o2::configuration::ConfigurationInterface> conf;
78+ try {
79+ conf = o2::configuration::ConfigurationFactory::getConfiguration (configUri);
80+ } catch (std::exception& e) {
81+ throw ;
82+ }
83+
84+ auto tree = conf->getRecursive (" " );
85+ std::string group = " " ;
86+ try {
87+ for (auto it : tree) {
88+ group = it.first ;
89+ auto subtree = it.second ;
90+
91+ if (group == " crorc" ) { // Configure the CRORC
92+ dynamicOffset = subtree.get <bool >(" dynamicOffset" );
93+ timeFrameLength = subtree.get <int >(" timeFrameLength" );
94+ }
95+
96+ parameters.setDynamicOffsetEnabled (dynamicOffset);
97+ parameters.setTimeFrameLength (timeFrameLength);
98+ }
99+ } catch (...) {
100+ BOOST_THROW_EXCEPTION (ParseException () << ErrorInfo::ConfigParse (group));
101+ }
75102}
103+
76104// / configUri has to start with "ini://", "json://" or "consul://"
77105void CardConfigurator::parseConfigUriCru (std::string configUri, Parameters& parameters)
78106{
0 commit comments