Measurement class
The result of a measurement of data of a given dataType at a specific point or interval in time. When sensorEndTime is set, the data pertains to an interval in time; otherwise, a point in time.
The unit of sensorStartTime and sensorEndTime is either determined by the sensor that collected the data, or, in case the sensor does not provide this information, by the phone. For example, the timestamps could be a simple clock increment since the device powered up. Note that in CARP we prefer microseconds over milliseconds for higher precision.
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
- Measurement({required int sensorStartTime, int? sensorEndTime, required Data data})
-
Create a new measurement based on
data
. - Measurement.fromData(Data data, [int? sensorStartTime])
-
Create a measurement from
data
based on thesensorStartTime
provided by the sensor. IfsensorStartTime
is not specified, the phones current time stamp as microseconds since epoch is used.factory -
Measurement.fromJson(Map<
String, dynamic> json) -
factory
Properties
- data ↔ Data
-
The Data collected in this measurement.
getter/setter pair
- dataType → DataType
-
The type of the data.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sensorEndTime ↔ int?
-
End time as set by the sensor, if available.
getter/setter pair
- sensorStartTime ↔ int
-
Start time as set by the sensor.
getter/setter pair
- taskControl ↔ TaskControl?
-
The TaskControl which triggered the collection of this measurement.
getter/setter pair
Methods
-
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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited