PrimaryDeviceDeployment class
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.
- Call hasBeenUpdated after changing it. This calls onUpdated, which the Study holding this deployment sets.
CARP Mobile Sensing extends it as SmartphoneDeployment.
- Annotations
-
- @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
Constructors
-
PrimaryDeviceDeployment({required PrimaryDeviceConfiguration<
DeviceRegistration> deviceConfiguration, required DeviceRegistration registration, Set<DeviceConfiguration< connectedDevices = const {}, Map<DeviceRegistration> >String, DeviceRegistration?> connectedDeviceRegistrations = const {}, Set<TaskConfiguration> tasks = const {}, Map<String, TriggerConfiguration> triggers = const {}, Set<TaskControl> taskControls = const {}, Set<ExpectedParticipantData> expectedParticipantData = const {}}) -
PrimaryDeviceDeployment.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
applicationData
↔ Map<
String, dynamic> ? -
Application-specific data to be stored as part of a study deployment.
getter/setter pair
-
connectedDeviceRegistrations
↔ Map<
String, DeviceRegistration?> -
Preregistration of connected devices, including information such as
connection properties, stored per role name.
getter/setter pair
-
connectedDevices
↔ Set<
DeviceConfiguration< DeviceRegistration> > -
The devices this device needs to connect to.
getter/setter pair
-
deviceConfiguration
↔ PrimaryDeviceConfiguration<
DeviceRegistration> -
The configuration for the primary device this deployment is intended for.
getter/setter pair
-
expectedDataStreams
→ Set<
ExpectedDataStream> -
The set of expected data streams from this device deployment.
no setter
-
expectedParticipantData
↔ Set<
ExpectedParticipantData> -
Expected data about participants in the deployment to be input by users.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastUpdatedOn → DateTime
-
The time when this device deployment was last updated.
This corresponds to the most recent device registration as part of this
device deployment.
no setter
- onUpdated ↔ void Function()?
-
Called by hasBeenUpdated. Set by the Study holding this deployment.
getter/setter pair
- registration ↔ DeviceRegistration
-
Registration for this primary device.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
taskControls
↔ Set<
TaskControl> -
The specification of tasks triggered and the devices they are sent to.
getter/setter pair
-
tasks
↔ Set<
TaskConfiguration> -
All tasks which should be able to be executed on this or connected devices.
getter/setter pair
-
triggers
↔ Map<
String, TriggerConfiguration> -
All triggers originating from this device and connected devices, stored
per assigned id unique within the study protocol.
getter/setter pair
Methods
-
getTaskByName(
String name) → TaskConfiguration? - Get the task based on its task name in this deployment; null if not found.
-
hasBeenUpdated(
) → void - Tell the Study holding this deployment that it has been updated.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited