@@ -109,42 +109,40 @@ void CardConfigurator::parseConfigUriCru(std::string configUri, Parameters& para
109109 try {
110110 for (auto it : tree) {
111111 group = it.first ;
112+ auto subtree = it.second ;
112113
113114 if (group == " cru" ) { // Configure the CRU globally
114115
115116 std::string parsedString;
116- conf->setPrefix (group);
117117
118- parsedString = conf-> get <std::string>(" clock" );
118+ parsedString = subtree. get <std::string>(" clock" );
119119 clock = Clock::fromString (parsedString);
120120
121- parsedString = conf-> get <std::string>(" datapathMode" );
121+ parsedString = subtree. get <std::string>(" datapathMode" );
122122 datapathMode = DatapathMode::fromString (parsedString);
123123
124- parsedString = conf-> get <std::string>(" gbtMode" );
124+ parsedString = subtree. get <std::string>(" gbtMode" );
125125 gbtMode = GbtMode::fromString (parsedString);
126126
127- parsedString = conf-> get <std::string>(" downstreamData" );
127+ parsedString = subtree. get <std::string>(" downstreamData" );
128128 downstreamData = DownstreamData::fromString (parsedString);
129129
130- loopback = conf-> get <bool >(" loopback" );
131- ponUpstream = conf-> get <bool >(" ponUpstream" );
132- dynamicOffset = conf-> get <bool >(" dynamicOffset" );
130+ loopback = subtree. get <bool >(" loopback" );
131+ ponUpstream = subtree. get <bool >(" ponUpstream" );
132+ dynamicOffset = subtree. get <bool >(" dynamicOffset" );
133133
134- parsedString = conf-> get <std::string>(" onuAddress" );
134+ parsedString = subtree. get <std::string>(" onuAddress" );
135135 onuAddress = Hex::fromString (parsedString);
136136
137- parsedString = conf-> get <std::string>(" cruId" );
137+ parsedString = subtree. get <std::string>(" cruId" );
138138 cruId = Hex::fromString (parsedString);
139139
140- allowRejection = conf-> get <bool >(" allowRejection" );
140+ allowRejection = subtree. get <bool >(" allowRejection" );
141141
142- triggerWindowSize = conf-> get <int >(" triggerWindowSize" );
142+ triggerWindowSize = subtree. get <int >(" triggerWindowSize" );
143143
144- gbtEnabled = conf->get <bool >(" gbtEnabled" );
145- userLogicEnabled = conf->get <bool >(" userLogicEnabled" );
146-
147- conf->setPrefix (" " );
144+ gbtEnabled = subtree.get <bool >(" gbtEnabled" );
145+ userLogicEnabled = subtree.get <bool >(" userLogicEnabled" );
148146
149147 parameters.setClock (clock);
150148 parameters.setDatapathMode (datapathMode);
@@ -162,22 +160,19 @@ void CardConfigurator::parseConfigUriCru(std::string configUri, Parameters& para
162160
163161 } else if (group == " links" ) { // Configure all links with default values
164162
165- conf->setPrefix (group);
166- enabled = conf->get <bool >(" enabled" );
163+ enabled = subtree.get <bool >(" enabled" );
167164
168165 if (enabled) {
169166 for (int i = 0 ; i < 12 ; i++) {
170167 linkMask.insert ((uint32_t )i);
171168 }
172169 }
173170
174- gbtMux = conf-> get <std::string>(" gbtMux" );
171+ gbtMux = subtree. get <std::string>(" gbtMux" );
175172 for (int i = 0 ; i < 12 ; i++) {
176173 gbtMuxMap.insert (std::make_pair ((uint32_t )i, GbtMux::fromString (gbtMux)));
177174 }
178175
179- conf->setPrefix (" " );
180-
181176 } else if (!group.find (" link" )) { // Configure individual links
182177
183178 std::string linkIndexString = group.substr (group.find (" k" ) + 1 );
@@ -187,23 +182,19 @@ void CardConfigurator::parseConfigUriCru(std::string configUri, Parameters& para
187182 BOOST_THROW_EXCEPTION (ParseException () << ErrorInfo::ConfigParse (group));
188183 }
189184
190- conf->setPrefix (group);
191-
192- enabled = conf->get <bool >(" enabled" );
185+ enabled = subtree.get <bool >(" enabled" );
193186 if (enabled) {
194187 linkMask.insert (linkIndex);
195188 } else {
196189 linkMask.erase (linkIndex);
197190 }
198191
199- gbtMux = conf-> get <std::string>(" gbtMux" );
192+ gbtMux = subtree. get <std::string>(" gbtMux" );
200193 if (gbtMuxMap.find (linkIndex) != gbtMuxMap.end ()) {
201194 gbtMuxMap[linkIndex] = GbtMux::fromString (gbtMux);
202195 } else {
203196 gbtMuxMap.insert (std::make_pair (linkIndex, GbtMux::fromString (gbtMux)));
204197 }
205-
206- conf->setPrefix (" " );
207198 }
208199 }
209200
0 commit comments