We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The number of (enabled) AI/DI ports on the Digitizer on different occasions is counted by looping on all AI's / DI's. Here an example:
gr-digitizers/lib/digitizer_block_impl.cc
Lines 615 to 626 in 19061f7
Instead, provide a method which returns the number
The text was updated successfully, but these errors were encountered:
the counting functions already exist in the file:
Line 448 in 19061f7
Line 509 in 19061f7
Sorry, something went wrong.
The number of (enabled) AI/DI ports on the Digitizer on different occasions is counted by looping on all AI's / DI's. Here an example: gr-digitizers/lib/digitizer_block_impl.cc Lines 615 to 626 in 19061f7 int num_enabled_ai_channels = 0; int num_enabled_di_ports = 0; for (auto i = 0; i < d_ai_channels; i++) { if (d_channel_settings[i].enabled) { num_enabled_ai_channels++; } } for (auto i = 0; i < d_ports; i++) { if (d_port_settings[i].enabled) { num_enabled_di_ports++; } } Instead, provide a method which returns the number
Your assessment is correct and std::accumulate is your friend, e.g.
auto nEnabled = std::accumulate(V.begin(), V.end(), 0, [](int a, int b){ return pred(b) ? a+b: a; });
The quoted code is pre-C++11 and C-like which we should start modernising ...
No branches or pull requests
The number of (enabled) AI/DI ports on the Digitizer on different occasions is counted by looping on all AI's / DI's. Here an example:
gr-digitizers/lib/digitizer_block_impl.cc
Lines 615 to 626 in 19061f7
Instead, provide a method which returns the number
The text was updated successfully, but these errors were encountered: