SmartphoneStudyProtocol class Null safety
A description of how a study is to be executed on a smartphone.
A SmartphoneStudyProtocol defining the master device (MasterDeviceDescriptor) responsible for aggregating data (typically this phone), the optional devices (DeviceDescriptor) connected to the master device, and the Trigger's which lead to data collection on said devices.
- Inheritance
-
- Object
- StudyProtocol
- SmartphoneStudyProtocol
- Annotations
-
- @JsonSerializable(fieldRename: FieldRename.none, includeIfNull: false)
Constructors
- SmartphoneStudyProtocol({required String ownerId, required String name, StudyDescription? protocolDescription, SamplingSchemaType samplingStrategy = SamplingSchemaType.normal, DataEndPoint? dataEndPoint})
- Create a new SmartphoneStudyProtocol.
-
SmartphoneStudyProtocol.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
connectedDevices
↔ List<
DeviceDescriptor> -
The devices this device needs to connect to.
read / write, inherited
-
connections
↔ List<
DeviceConnection> -
read / write, inherited
- creationDate ↔ DateTime
-
The timestamp of the creation of this protocol in Zulu time.
read / write, inherited
- dataEndPoint ↔ DataEndPoint?
-
Specifies where and how to stored or upload the data collected from this
deployment. If
null
, the sensed data is not stored, but may still be used in the app.read / write - description ↔ String
-
The description for the study protocol.
read / write, inherited-setter, override-getter
-
expectedParticipantData
↔ List<
Map< ?String, dynamic> > -
read / write, inherited
- hashCode → int
-
The hash code for this object.
read-only, inherited
- masterDevice → MasterDeviceDescriptor
-
The first of all the masterDevices. This is a convinient method used when
there is only one master device, which is most of the cases in Flutter where
the master device is typically the phone.
read-only, inherited
-
masterDevices
↔ List<
MasterDeviceDescriptor> -
The master devices involved in this protocol.
read / write, inherited
- name ↔ String
-
A unique descriptive name for the protocol.
read / write, inherited
- ownerId ↔ String
-
The owner id of this study protocol.
read / write, inherited
- protocolDescription ↔ StudyDescription?
-
The description of this study protocol containing the title, description,
purpose, and the responsible researcher for this study.
read / write
- responsible → StudyResponsible?
-
The PI responsible for this protocol.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- samplingStrategy ↔ SamplingSchemaType
-
The sampling strategy used in this study based on the standard
SamplingSchemaType types.
read / write
-
tasks
↔ Set<
TaskDescriptor> -
The set of tasks which can be triggered as part of this protocol.
read / write, inherited
-
triggeredTasks
↔ List<
TriggeredTask> -
The tasks (and the devices they are triggered to) for the specified
trigger
.read / write, inherited -
triggers
↔ Map<
String, Trigger> -
The set of
Trigger
s which can trigger TaskDescriptors in this study protocol.read / write, inherited
Methods
-
addConnectedDevice(
DeviceDescriptor device) → void -
Add a
device
which is connected to this masterDevice. Its role name should be unique in the protocol.inherited -
addMasterDevice(
MasterDeviceDescriptor masterDevice) → void -
Add a
masterDevice
which is responsible for aggregating and synchronizing incoming data. Its role name should be unique in the protocol.inherited -
addTask(
TaskDescriptor task) → void -
Add the
task
to this protocol.inherited -
addTrigger(
Trigger trigger) → void -
Add the
trigger
to this protocol.inherited -
addTriggeredTask(
Trigger trigger, TaskDescriptor task, DeviceDescriptor targetDevice) → void -
Add a
task
to be sent to atargetDevice
once atrigger
within this protocol is initiated.inherited -
addTriggeredTasks(
Trigger trigger, List< TaskDescriptor> tasks, DeviceDescriptor targetDevice) → void -
Add a set of
tasks
to be sent to atargetDevice
once atrigger
within this protocol is initiated. In case thetrigger
ortasks
are not yet included in this study protocol, they will be added. ThetargetDevice
needs to be added prior to this call since it needs to be set up as either a master device or connected device.inherited -
getTasksForDevice(
DeviceDescriptor device) → Set< TaskDescriptor?> -
Gets all the tasks triggered for the specified
device
. Thedevice
must be part of either masterDevices or connectedDevices.inherited -
getTasksForDeviceRoleName(
String? deviceRoleName) → Set< TaskDescriptor> -
Gets all the tasks triggered for the specified
deviceRoleName
.inherited -
getTriggeredTasks(
Trigger trigger) → Set< TriggeredTask> -
Gets all the tasks (and the devices they are triggered to) for the
specified
trigger
.inherited -
hasMasterDevice(
String rolename) → bool -
Does this protocol have a master device with role name
rolename
?inherited -
indexOfTrigger(
Trigger trigger) → int -
Returns the index of the
trigger
in the triggers. Returns-1
if not found.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
removeTask(
TaskDescriptor task) → void -
Remove the
task
currently present in this configuration including removing it from any Trigger's which initiate it.inherited -
toJson(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited