PrimaryDeviceDeployment
Everything a single primary device needs to run its part of a study.
Created by a StudyDeployment (via DeploymentService.getDeviceDeploymentFor) from the StudyProtocol. It holds the device's own configuration and registration, its connected devices, and the tasks, triggers and task controls it must run. A client stores it in Study.deployment and runs it.
Key points:
- Built by StudyDeployment.getDeviceDeploymentFor: holds the tasks of the primary device and of all devices connected to it in the protocol.
- expectedDataStreams is computed from the task controls on first access.
- Is a ChangeNotifier; call hasBeenUpdated after changing it to notify listeners (e.g., the Study).
CARP Mobile Sensing extends it as SmartphoneDeployment.
- Mixed-in types
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
PrimaryDeviceDeployment.fromJson
PrimaryDeviceDeployment
- required PrimaryDeviceConfiguration<
DeviceRegistration> deviceConfiguration, - required DeviceRegistration registration,
- Set<
DeviceConfiguration< connectedDevices = const {},DeviceRegistration> > - Map<
String, DeviceRegistration?> connectedDeviceRegistrations = const {}, - Set<
TaskConfiguration> tasks = const {}, - Map<
String, TriggerConfiguration> triggers = const {}, - Set<
TaskControl> taskControls = const {}, - Set<
ExpectedParticipantData> expectedParticipantData = const {},
Properties
applicationData
Application-specific data to be stored as part of a study deployment.
This can be used by infrastructures or concrete applications which require exchanging additional data between the protocols and clients subsystems, outside of scope or not yet supported by CARP core.
connectedDeviceRegistrations
Preregistration of connected devices, including information such as connection properties, stored per role name.
connectedDevices
The devices this device needs to connect to.
deviceConfiguration
The configuration for the primary device this deployment is intended for.
expectedDataStreams
The set of expected data streams from this device deployment.
Computed once from taskControls and cached.
expectedParticipantData
Expected data about participants in the deployment to be input by users.
lastUpdatedOn
The time when this device deployment was last updated. This corresponds to the most recent device registration as part of this device deployment.
registration
Registration for this primary device.
taskControls
The specification of tasks triggered and the devices they are sent to.
tasks
All tasks which should be able to be executed on this or connected devices.
triggers
All triggers originating from this device and connected devices, stored per assigned id unique within the study protocol.
Methods
getTaskByName
- String name
Get the task based on its task name in this deployment; null if not found.
hasBeenUpdated
Notify listeners that this deployment has been updated.
toJson
toString
A string representation of this object.
Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.
Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.