Measurement class
A piece of collected data with the time it was measured.
A probe or task produces Data; the client wraps it in a Measurement with a timestamp and passes it on for storage and upload, e.g. in a DataStreamBatch. This is the unit of data collected in CARP. 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.
// Timestamp is now, in microseconds since epoch.
var measurement = Measurement.fromData(StepCount(steps: 12));
- Annotations
-
- @JsonSerializable.new(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
databased on thesensorStartTimeprovided by the sensor. IfsensorStartTimeis 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.
Set at runtime only; not serialized.
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