Skip to content

Commit 7277bbf

Browse files
committed
[config] Config files should explicitly follow the 0-11 link scheme
1 parent 378c379 commit 7277bbf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cru_template.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,3 @@ gbtMux=TTC
8383
[link4]
8484
enabled=false
8585
gbtMux=ddg
86-
87-
[link21]
88-
enabled=true
89-
gbtMux=swt

src/CardConfigurator.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ void CardConfigurator::parseConfigUri(std::string configUri, Parameters& paramet
127127
enabled = conf->get<bool>("enabled");
128128

129129
if (enabled) {
130-
for (int i = 0; i < 24; i++) {
130+
for (int i = 0; i < 12; i++) {
131131
linkMask.insert((uint32_t)i);
132132
}
133133
}
134134

135135
gbtMux = conf->get<std::string>("gbtMux");
136-
for (int i = 0; i < 24; i++) {
136+
for (int i = 0; i < 12; i++) {
137137
gbtMuxMap.insert(std::make_pair((uint32_t)i, GbtMux::fromString(gbtMux)));
138138
}
139139

@@ -144,6 +144,10 @@ void CardConfigurator::parseConfigUri(std::string configUri, Parameters& paramet
144144
std::string linkIndexString = group.substr(group.find("k") + 1);
145145
uint32_t linkIndex = std::stoul(linkIndexString, NULL, 10);
146146

147+
if (linkIndex > 11) {
148+
BOOST_THROW_EXCEPTION(ParseException() << ErrorInfo::ConfigParse(group));
149+
}
150+
147151
conf->setPrefix(group);
148152

149153
enabled = conf->get<bool>("enabled");

0 commit comments

Comments
 (0)