added counters
Build on RHEL9 docker image / build (push) Successful in 3m42s
Build on RHEL8 docker image / build (push) Successful in 5m2s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m17s
Run Simulator Tests on local RHEL8 / build (push) Successful in 21m51s

This commit is contained in:
Erik Frojdh
2026-05-20 16:39:15 +02:00
parent ed8c885de0
commit f35e09a2ac
+5 -4
View File
@@ -1014,15 +1014,16 @@ std::string Caller::counters(int action) {
if (args.empty()) {
WrongNumberOfParameters(1);
}
if (std::any_of(args.cbegin(), args.cend(), [](std::string s) {
return (StringTo<int>(s) < 0 || StringTo<int>(s) > 2);
//convert args to string and then to a vector of ints
auto counters = StringTo<std::vector<int>>( ToString(args));
if (std::any_of(counters.cbegin(), counters.cend(), [](int val) {
return (val < 0 || val > 2);
})) {
throw RuntimeError("Invalid counter indices list. Example: 0 1 2");
}
// convert vector to counter enable mask
uint32_t mask = 0;
for (size_t i = 0; i < args.size(); ++i) {
int val = StringTo<int>(args[i]);
for (auto val : counters) {
// already enabled earlier
if (mask & (1 << val)) {
std::ostringstream oss;