initialize method
Future<void>
initialize(
- DataEndPoint dataEndPoint,
- MasterDeviceDeployment deployment,
- Stream<
DataPoint> data
override
Initialize the data manager by specifying the dataEndPoint
, study
deployment
, and the stream of data
events to handle.
Implementation
@override
Future<void> initialize(
DataEndPoint dataEndPoint,
MasterDeviceDeployment deployment,
Stream<DataPoint> data,
) async {
assert(dataEndPoint is FileDataEndPoint);
await super.initialize(dataEndPoint, deployment, data);
await Settings().getDeploymentBasePath(studyDeploymentId);
if (fileDataEndPoint.encrypt) {
assert(fileDataEndPoint.publicKey != null,
'A public key is required if files are to be encrypted.');
assert(fileDataEndPoint.publicKey!.isNotEmpty,
'A non-empty public key is required if files are to be encrypted.');
}
// Initializing the the local study directory and file
await path;
await file;
await sink;
info('Initializing FileDataManager...');
info('Data file path : $_path');
info('Buffer size : ${fileDataEndPoint.bufferSize.toString()} bytes');
}