TMDVehicle Class Reference

Inherits from NSObject
Declared in TMDVehicle.h

Overview

This class includes all information relating to a vehicle profile.

  tmdVehicleId

The unique id of the vehicle profile.

@property (nonatomic, strong) NSUUID *tmdVehicleId

Declared In

TMDVehicle.h

  modality

The name of the modality associated with the vehicle profile.

@property (nonatomic, strong) NSString *modality

Declared In

TMDVehicle.h

  engineType

The engine type of the vehicle.

@property (assign) TMDEngineType engineType

Declared In

TMDVehicle.h

  name

The name of the vehicle.

@property (nonatomic, strong) NSString *name

Declared In

TMDVehicle.h

  make

The make of the vehicle.

@property (nonatomic, strong) NSString *make

Declared In

TMDVehicle.h

  makeAlt

An alternative value for the make of the vehicle. This can be used for example if make comes from a predefined list, and makeAlt comes from user input.

@property (nonatomic, strong) NSString *makeAlt

Declared In

TMDVehicle.h

  model

The model of the vehicle.

@property (nonatomic, strong) NSString *model

Declared In

TMDVehicle.h

  modelAlt

An alternative value for the model of the vehicle. This can be used for example if model comes from a predefined list, and modelAlt comes from user input.

@property (nonatomic, strong) NSString *modelAlt

Declared In

TMDVehicle.h

  year

The manufacturing year of the vehicle.

@property (assign) int year

Declared In

TMDVehicle.h

  isForUserGarage

Boolean value indicating if the vehicle belongs to the user garage or not.

@property (assign) BOOL isForUserGarage

Declared In

TMDVehicle.h

  isDefaultVehicle

Boolean value indicating if the vehicle is the default vehicle used by the user for this modality.

@property (assign) BOOL isDefaultVehicle

Declared In

TMDVehicle.h

  isUserOwner

Boolean value indicating if the user owns the vehicle.

@property (assign) BOOL isUserOwner

Declared In

TMDVehicle.h

  syncedWithCloud

Indicates whether changes made locally on the vehicle have been synced with the cloud.

@property (assign) BOOL syncedWithCloud

Declared In

TMDVehicle.h

  timestampUpdate

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

@property (assign) long long timestampUpdate

Declared In

TMDVehicle.h

  timestampCreation

The UTC timestamp (in ms) of the creation of the TMD Vehicle

@property (assign) long long timestampCreation

Declared In

TMDVehicle.h

– initWithModality:engineType:name:make:makeAlt:model:modelAlt:year:isDefaultVehicle:isUserOwner:

- (instancetype)initWithModality:(NSString *)modality engineType:(TMDEngineType)engineType name:(NSString *)name make:(NSString *)make makeAlt:(NSString *)makeAlt model:(NSString *)model modelAlt:(NSString *)modelAlt year:(int)year isDefaultVehicle:(BOOL)isDefaultVehicle isUserOwner:(BOOL)isUserOwner

– initWithId:modality:engineType:name:make:makeAlt:model:modelAlt:year:isForUserGarage:isDefaultVehicle:isUserOwner:timestampCreation:timestampUpdate:synced:

- (instancetype)initWithId:(NSUUID *)tmdVehicleId modality:(NSString *)modality engineType:(TMDEngineType)engineType name:(NSString *)name make:(NSString *)make makeAlt:(NSString *)makeAlt model:(NSString *)model modelAlt:(NSString *)modelAlt year:(int)year isForUserGarage:(BOOL)isForUserGarage isDefaultVehicle:(BOOL)isDefaultVehicle isUserOwner:(BOOL)isUserOwner timestampCreation:(long long)timestampCreation timestampUpdate:(long long)timestampUpdate synced:(BOOL)syncedWithCloud

+ carbonEmissionsForEngineType:forModality:

Returns the carbon emission value, in g/km, for a modality with a given engine type.

+ (float)carbonEmissionsForEngineType:(TMDEngineType)engineType forModality:(NSString *)modalityName

Parameters

engineType

the engine type to compute carbon emissions for

modalityName

the name of the modality (or activity)

Return Value

The computed carbon emission value, in g/km.

Declared In

TMDVehicle.h

+ tmdEngineTypeToStringForEngineType:

Returns a string representation of a given engine type.

+ (NSString *)tmdEngineTypeToStringForEngineType:(TMDEngineType)engineType

Declared In

TMDVehicle.h

+ tmdEngineTypeFromString:

Returns a TMDEngineType value from a string.

+ (TMDEngineType)tmdEngineTypeFromString:(NSString *)engineTypeString

Declared In

TMDVehicle.h

– tmdEngineTypeString

Returns the string representation of the vehicle’s engine type.

- (NSString *)tmdEngineTypeString

Declared In

TMDVehicle.h

– vehicleMake

Returns the vehicle make or makeAlt when available.

- (NSString *)vehicleMake

Declared In

TMDVehicle.h

– vehicleModel

Returns the vehicle model or modelAlt when available.

- (NSString *)vehicleModel

Declared In

TMDVehicle.h

– toJson

Returns the vehicle profile as a JSON string..

- (NSString *)toJson

Declared In

TMDVehicle.h