TMDActivity Class Reference

Inherits from NSObject
Declared in TMDActivity.h

Overview

This class includes all information pertaining to the TMD activity collected from the Moprim Cloud.

  activityId

The unique id of the activity when stored in the local cache

@property (assign) long long activityId

Declared In

TMDActivity.h

  timestampDownload

The UTC timestamp (in ms) of the last download of the TMD activity

@property long long timestampDownload

Declared In

TMDActivity.h

  timestampStart

The UTC timestamp (in ms) of the start of the TMD activity

@property (assign) long long timestampStart

Declared In

TMDActivity.h

  timestampEnd

The UTC timestamp (in ms) of the end of the TMD activity

@property (assign) long long timestampEnd

Declared In

TMDActivity.h

  timestampUpdate

The UTC timestamp (in ms) of the last update of the TMD activity

@property (assign) long long timestampUpdate

Declared In

TMDActivity.h

  correctedActivity

The corrected label of the activity

@property (nonatomic, strong) NSString *correctedActivity

Declared In

TMDActivity.h

  originalActivity

The original label of the activity

@property (nonatomic, strong) NSString *originalActivity

Declared In

TMDActivity.h

  co2

The amount of CO2 (in grams) generated during the activity.

@property (assign) double co2

Declared In

TMDActivity.h

  distance

The distance in meters covered in the activity

@property (assign) double distance

Declared In

TMDActivity.h

  speed

The average speed (in kilometers per hours) during the activity

@property (assign) double speed

Declared In

TMDActivity.h

  polyline

The encoded polyline of the GPS locations during the activity

@property (nonatomic, strong) NSString *polyline

Declared In

TMDActivity.h

  origin

The origin of the activity, or the location for the stationary activity

@property (nonatomic, strong) NSString *origin

Declared In

TMDActivity.h

  destination

The destination of the activity, null for stationary

@property (nonatomic, strong) NSString *destination

Declared In

TMDActivity.h

  metadata

The metadata annotated to the TMD activity

@property (nonatomic, strong) NSString *metadata

Declared In

TMDActivity.h

  verifiedByUser

Indicates whether the activity was either validated or corrected by the user

@property BOOL verifiedByUser

Declared In

TMDActivity.h

  syncedWithCloud

Indicates whether change made manually on the activity have been synced with the cloud

@property BOOL syncedWithCloud

Declared In

TMDActivity.h

– initWithId:timestampDownload:timestampStart:timestampEnd:timestampUpdate:originalActivity:correctedActivity:co2:distance:speed:polyline:origin:destination:metadata:verifiedByUser:synced:

- (instancetype)initWithId:(long long)activityId timestampDownload:(long long)timestampDownload timestampStart:(long long)timestampStart timestampEnd:(long long)timestampEnd timestampUpdate:(long long)timestampUpdate originalActivity:(NSString *)originalActivity correctedActivity:(nullable NSString *)correctedActivity co2:(double)co2 distance:(double)distance speed:(double)speed polyline:(NSString *)polyline origin:(nullable NSString *)origin destination:(nullable NSString *)destination metadata:(nullable NSString *)metadata verifiedByUser:(BOOL)verifiedByUser synced:(BOOL)syncedWithCloud

– hasSameTimestampsThanActivity:

Returns TRUE if the activity has same start and stop timestamp than ‘other’

- (BOOL)hasSameTimestampsThanActivity:(TMDActivity *)other

Discussion

Activities are usually compared with their timestamps.

Declared In

TMDActivity.h

– hasSameDataThanActivity:

Compares 2 TMDActivity objects, ignoring activityId, timestampDownload, timestampUpdate and syncedWithCloud

- (BOOL)hasSameDataThanActivity:(TMDActivity *)other

Declared In

TMDActivity.h

– overlapsWithActivity:isInclusive:

Returns TRUE if the timestamps of both activities overlap

- (BOOL)overlapsWithActivity:(TMDActivity *)other isInclusive:(BOOL)isInclusive

Declared In

TMDActivity.h

– duration

The duration (in seconds) of the activity

- (NSTimeInterval)duration

Declared In

TMDActivity.h

– activity

The label of the activity

- (NSString *)activity

Declared In

TMDActivity.h

– isCheckedByUser

Returns TRUE if the corrected label has been set by the user

- (BOOL)isCheckedByUser

Declared In

TMDActivity.h

– isCorrect

Returns TRUE if the corrected activity and original activity are the same

- (BOOL)isCorrect

Discussion

This function is only used to validate the results of the TMD.

Declared In

TMDActivity.h