addStudy method
Add a study which needs to be executed on this client. This involves registering this device for the specified study deployment.
studyDeploymentId
- The ID of a study which has been deployed already and for which to collect data.deviceRoleName
- The role which the client device this runtime is intended for plays as part of the deployment identified bystudyDeploymentId
.
Returns the added study.
Implementation
@override
Future<Study> addStudy(
String studyDeploymentId,
String deviceRoleName,
) async {
Study study = await super.addStudy(
studyDeploymentId,
deviceRoleName,
);
// Always create a new controller
final controller =
SmartphoneDeploymentController(deploymentService!, deviceController);
repository[study] = controller;
_group.add(controller.measurements);
await controller.addStudy(
study,
registration!,
);
info('$runtimeType - Added study: $study');
return study;
}