start method

  1. @override
void start([
  1. bool start = true
])
override

Start this controller.

If start is true, immediately start data collection according to the parameters specified in configure.

configure must be called before starting sampling.

Implementation

@override
void start([bool start = true]) {
  info(
      '$runtimeType - Starting data sampling for study deployment: ${deployment?.studyDeploymentId}');

  // if this study has not yet been deployed, do this first.
  if (status.index < StudyStatus.Deployed.index) {
    tryDeployment().then((value) {
      configure().then((value) {
        super.start();
        if (start) _executor.start();
      });
    });
  } else {
    super.start();
    if (start) _executor.start();
  }
}