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 tripId

Declared In

TMDTrip.h

  timestampDownload

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

@property long long timestampDownload

Declared In

TMDTrip.h

  timestampModified

The UTC timestamp (in ms) of the last modification of the TMD trip

@property (assign) long long timestampModified

Declared In

TMDTrip.h

  timestampStart

Returns the UTC timestamp (in ms) of the start of the TMD trip

@property long long timestampStart

Declared In

TMDTrip.h

  timestampEnd

Returns the UTC timestamp (in ms) of the end of the TMD trip

@property long long timestampEnd

Declared In

TMDTrip.h

  distance

The distance of the trip in meters.

@property (assign) double distance

Declared In

TMDTrip.h

  co2

The co2 produced during this trip, in grams.

@property (assign) double co2

Declared In

TMDTrip.h

  origin

The name of the origin of the trip.

@property (nonatomic, strong) NSString *origin

Declared In

TMDTrip.h

  destination

The name of the destination of the trip.

@property (nonatomic, strong) NSString *destination

Declared In

TMDTrip.h

  purpose

The purpose for the trip.

@property (nonatomic, strong) NSString *purpose

Declared In

TMDTrip.h

  reasons

The reasons for making the trip with these activities.

@property (nonatomic, strong) NSArray<NSString*> *reasons

Declared In

TMDTrip.h

  metadata

The metadata for the trip.

@property (nonatomic, strong) NSString *metadata

Declared In

TMDTrip.h

  checksum

The checksum of the trip.

@property (nonatomic, strong) NSString *checksum

Declared In

TMDTrip.h

  legs

The list of activities (legs) for this trip.

@property (nonatomic, strong) NSArray<TMDActivity*> *legs

Declared In

TMDTrip.h

  mainMode

The main mode (activity) of the trip.

@property (nonatomic, strong) NSString *mainMode

Declared In

TMDTrip.h

  isValidated

This field is important for reporting. Returns true if the trip has been validated by the user.

@property BOOL isValidated

Declared 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 isCompleted

Declared In

TMDTrip.h

  syncedWithCloud

Indicates whether changes made manually on the trip have been synced with the cloud.

@property BOOL syncedWithCloud

Declared 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)position

Declared In

TMDTrip.h

– duration

Returns the duration in seconds of the trip

- (NSTimeInterval)duration

Declared In

TMDTrip.h

– hasLegs

Returns true if the trip has legs (activities), false otherwise.

- (bool)hasLegs

Declared In

TMDTrip.h

– size

The size of the trip. Returns the number of legs (activities) in the trip.

- (int)size

Declared In

TMDTrip.h

– hasSameTimestampsThanTrip:

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

- (BOOL)hasSameTimestampsThanTrip:(TMDTrip *)other

Discussion

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)isInclusive

Declared In

TMDTrip.h

– hasSameDataThanTrip:

Compares 2 TMDTrip objects, ignoring tripId, timestampDownload, timestampModified and syncedWithCloud

- (BOOL)hasSameDataThanTrip:(TMDTrip *)other

Declared In

TMDTrip.h