TMDTrip Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | TMDTrip.h |
Overview
This class includes all information pertaining to the TMD trip collected from the Moprim Cloud.
tripId
The unique id of the trip when stored in the local cache
@property (assign) long long tripIdDeclared In
TMDTrip.h
timestampDownload
The UTC timestamp (in ms) of the last download of the TMD trip
@property long long timestampDownloadDeclared In
TMDTrip.h
timestampModified
The UTC timestamp (in ms) of the last modification of the TMD trip
@property (assign) long long timestampModifiedDeclared In
TMDTrip.h
timestampStart
Returns the UTC timestamp (in ms) of the start of the TMD trip
@property long long timestampStartDeclared In
TMDTrip.h
timestampEnd
Returns the UTC timestamp (in ms) of the end of the TMD trip
@property long long timestampEndDeclared In
TMDTrip.h
distance
The distance of the trip in meters.
@property (assign) double distanceDeclared In
TMDTrip.h
co2
The co2 produced during this trip, in grams.
@property (assign) double co2Declared In
TMDTrip.h
origin
The name of the origin of the trip.
@property (nonatomic, strong) NSString *originDeclared In
TMDTrip.h
destination
The name of the destination of the trip.
@property (nonatomic, strong) NSString *destinationDeclared In
TMDTrip.h
purpose
The purpose for the trip.
@property (nonatomic, strong) NSString *purposeDeclared In
TMDTrip.h
reasons
The reasons for making the trip with these activities.
@property (nonatomic, strong) NSArray<NSString*> *reasonsDeclared In
TMDTrip.h
metadata
The metadata for the trip.
@property (nonatomic, strong) NSString *metadataDeclared In
TMDTrip.h
checksum
The checksum of the trip.
@property (nonatomic, strong) NSString *checksumDeclared In
TMDTrip.h
legs
The list of activities (legs) for this trip.
@property (nonatomic, strong) NSArray<TMDActivity*> *legsDeclared In
TMDTrip.h
mainMode
The main mode (activity) of the trip.
@property (nonatomic, strong) NSString *mainModeDeclared In
TMDTrip.h
isValidated
This field is important for reporting. Returns true if the trip has been validated by the user.
@property BOOL isValidatedDeclared In
TMDTrip.h
isCompleted
This fields tells if the trip is completed and thus, may not be modified without the user’s input. Returns true if the trip is completed.
@property BOOL isCompletedDeclared In
TMDTrip.h
syncedWithCloud
Indicates whether changes made manually on the trip have been synced with the cloud.
@property BOOL syncedWithCloudDeclared In
TMDTrip.h
– initWithId:timestampDownload:timestampStart:timestampEnd:timestampModified:legs:mainMode:co2:distance:origin:destination:purpose:reasons:metadata:checksum:isValidated:isCompleted:synced:
- (instancetype)initWithId:(long long)tripId timestampDownload:(long long)timestampDownload timestampStart:(long long)timestampStart timestampEnd:(long long)timestampEnd timestampModified:(long long)timestampModified legs:(NSArray<TMDActivity*> *)legs mainMode:(NSString *)mainMode co2:(double)co2 distance:(double)distance origin:(NSString *)origin destination:(NSString *)destination purpose:(NSString *)purpose reasons:(NSArray<NSString*> *)reasons metadata:(NSString *)metadata checksum:(NSString *)checksum isValidated:(BOOL)isValidated isCompleted:(BOOL)isCompleted synced:(BOOL)syncedWithCloud– getLegAt:
Returns a leg from the list of legs for this trip
- (TMDActivity *)getLegAt:(int)positionDeclared In
TMDTrip.h
– duration
Returns the duration in seconds of the trip
- (NSTimeInterval)durationDeclared In
TMDTrip.h
– hasLegs
Returns true if the trip has legs (activities), false otherwise.
- (bool)hasLegsDeclared In
TMDTrip.h
– size
The size of the trip. Returns the number of legs (activities) in the trip.
- (int)sizeDeclared In
TMDTrip.h
– hasSameTimestampsThanTrip:
Returns TRUE if the trip has same start and stop timestamp than ‘other’
- (BOOL)hasSameTimestampsThanTrip:(TMDTrip *)otherDiscussion
Trips are usually compared with their timestamps.
Declared In
TMDTrip.h
– overlapsWithTrip:isInclusive:
Returns TRUE if the timestamps of both trips overlap
- (BOOL)overlapsWithTrip:(TMDTrip *)other isInclusive:(BOOL)isInclusiveDeclared In
TMDTrip.h
– hasSameDataThanTrip:
Compares 2 TMDTrip objects, ignoring tripId, timestampDownload, timestampModified and syncedWithCloud
- (BOOL)hasSameDataThanTrip:(TMDTrip *)otherDeclared In
TMDTrip.h