Skip to content

Digitizer Block: Remove minor code duplication #100

@alexxcons

Description

@alexxcons

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:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions