Skip to content

accept comma separated rx_dbitlist#1463

Open
erikfrojdh wants to merge 4 commits into
developerfrom
fix/rx_dbitlist
Open

accept comma separated rx_dbitlist#1463
erikfrojdh wants to merge 4 commits into
developerfrom
fix/rx_dbitlist

Conversation

@erikfrojdh
Copy link
Copy Markdown
Member

@erikfrojdh erikfrojdh commented May 20, 2026

PR included fix to github actions needed for conda build to work
https://github.com/slsdetectorgroup/aare/pull/309

Actual change to detector software:

  • Accept comma separated list of rx_dbitlist without requiring space
p rx_dbitlist 12,13 45, 27
  • Added same parsing for counters

Open question should we do a get, reformat args or just print what the user put in?

@erikfrojdh erikfrojdh self-assigned this May 20, 2026
@erikfrojdh erikfrojdh added the action - Bug Something isn't working as expected label May 20, 2026
@erikfrojdh erikfrojdh added this to the 10.0.1 milestone May 20, 2026
@erikfrojdh erikfrojdh marked this pull request as ready for review May 20, 2026 14:41
item.erase(std::remove_if(item.begin(), item.end(),
[](char c) {
return c == '[' || c == ']' || c == '"' ||
c == ' ';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw if start of string is [ and end is not closing ] ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but then we need to keep track of which symbols we found. I'm not sure it's needed but can be convinced.

}
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the help string in both commands - such that it includes comma seperated values and list

int val = StringTo<int>(args[i]);
for (auto val : counters) {
// already enabled earlier
if (mask & (1 << val)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the end use: os << ToString(counters) << '\n'; instead of args. Returns what you actually set.

t = StringTo<std::vector<int>>(ToString(args));
}
det->setRxDbitList(t, std::vector<int>{det_id});
os << ToString(args) << '\n';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here ToString(t)

Copy link
Copy Markdown
Contributor

@AliceMazzoleni99 AliceMazzoleni99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think there is still an issue with command trimen and threshold for mythen. Also update the Release Notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action - Bug Something isn't working as expected infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rx_dbitlist only takes first value when providing a comma separated list

2 participants