SmartphoneStudy class
A study that this phone takes part in, as seen by the SmartPhoneClientManager.
Identifies the study deployment and the device role this phone plays in it. The client manager creates one when you add a study (from a protocol or an invitation), then gets its SmartphoneDeployment and runs it.
Key points:
deploymentisnulluntil the study is deployed, see isDeployed.- samplingState is the saved runtime state of the study, so sampling can resume after an app restart.
- events streams SmartphoneStudyStatusEvents on status and sampling state changes.
See also SmartphoneStudyController, which controls a running study.
- Inheritance
-
- Object
- Study<
SmartphoneDeployment> - SmartphoneStudy
Constructors
- SmartphoneStudy({String? studyId, required String studyDeploymentId, required String deviceRoleName, String? participantId, String? participantRoleName, DateTime? createdOn, StudyDeploymentStatus? deploymentStatus, SmartphoneDeployment? deployment})
- Creates a SmartphoneStudy.
- SmartphoneStudy.fromInvitation(ActiveParticipationInvitation invitation)
-
Creates a SmartphoneStudy from an
invitationto a study. -
SmartphoneStudy.fromMap(Map<
String, Object?> map) -
Creates a SmartphoneStudy from a database row saved by the
PersistenceService.
factory
Properties
- createdOn → DateTime
-
The date and time when this study was created and added to the
ClientManager.no setterinherited - deployment → SmartphoneDeployment?
-
The deployment for this study; null until received from the deployment
service.
no setterinherited
- deploymentStatus → StudyDeploymentStatus?
-
The deployment status of this study; null until received from the
deployment service.
no setterinherited
- deviceRoleName → String
-
The role name of the primary device in the deployment this study runtime participates in.
no setterinherited
-
events
→ Stream<
SmartphoneStudyStatusEvent> -
Stream of study status events.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDeployed → bool
-
Whether the
deploymentis available.no setter - isSampling → bool
-
Whether the study is sampling data, i.e. its samplingState is resumed.
no setter
- participantId ↔ String?
-
The ID of the participant in this study, if known.
getter/setter pairinherited
- participantRoleName ↔ String?
-
The role of the participant in this study, if known.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- samplingState ↔ SmartphoneDeploymentExecutorSamplingState?
-
The sampling state of this study, or
nullif not yet sampled.getter/setter pair - status → StudyStatus
-
The status of this study, derived from
deploymentStatus.no setterinherited - studyDeploymentId → String
-
The ID of the deployed study for which to collect data.
no setterinherited
- studyId ↔ String?
-
The unique id of the study in the deployment service, if known.
getter/setter pairinherited
Methods
-
createEvent(
StudyStatusEvent< Study< event) → voidPrimaryDeviceDeployment> > -
Emits
eventon theeventsstream.inherited -
deploymentError(
[String? message]) → void -
The deployment is in an error state.
Print the optional
messageand emit a deployment error event.inherited -
deploymentStatusReceived(
[StudyDeploymentStatus? deploymentStatus]) → void -
An updated
deploymentStatushas been received.inherited -
deploymentUpdated(
[String? message]) → void -
Mark the
deploymentas updated. Print the optionalmessageand emit a deployment update event. Ifdeploymentis null, nothing happens.inherited -
deviceDeploymentReceived(
[PrimaryDeviceDeployment? deployment]) → void -
Also takes the plain
PrimaryDeviceDeploymentthat a deployment service like CAWS returns, and converts it to a SmartphoneDeployment.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited