getTaskControls method

Set<TaskControl> getTaskControls(
  1. TriggerConfiguration trigger
)
inherited

Gets all conditions which control that tasks get started or stopped on devices in this protocol by the specified trigger.

Throws an error if trigger is not part of this study protocol.

Implementation

Set<TaskControl> getTaskControls(TriggerConfiguration trigger) {
  assert(triggers.values.contains(trigger),
      'The passed trigger is not part of this study protocol.');
  int triggerId = indexOfTrigger(trigger);

  Set<TaskControl> tt = {};
  // search the list of task controls
  for (var taskControl in taskControls) {
    if (taskControl.triggerId == triggerId) {
      tt.add(taskControl);
    }
  }

  return tt;
}