diff options
author | NicoleYarroch <nicole@livio.io> | 2017-08-03 16:25:58 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2017-08-03 16:25:58 -0400 |
commit | 4a4ba38718e1282aaf2b469e03b515abf6706aa5 (patch) | |
tree | 201b2fca6a8d5bd9e1b15a20b035db7d2478d2b4 | |
parent | c988e502a7bf21524976315eff95629660f7d97f (diff) | |
download | sdl_ios-4a4ba38718e1282aaf2b469e03b515abf6706aa5.tar.gz |
SDLSpatialStruct meets v5.0 specs
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r-- | SmartDeviceLink/SDLNames.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNames.m | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSpatialStruct.h | 3 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSpatialStruct.m | 114 |
4 files changed, 53 insertions, 66 deletions
diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h index c1f69f9ce..3bddd9e41 100644 --- a/SmartDeviceLink/SDLNames.h +++ b/SmartDeviceLink/SDLNames.h @@ -143,6 +143,7 @@ extern SDLName const SDLNameHashId; extern SDLName const SDLNameHDOP; extern SDLName const SDLNameHeading; extern SDLName const SDLNameHeadLampStatus; +extern SDLName const SDLNameHeight; extern SDLName const SDLNameHelpPrompt; extern SDLName const SDLNameHighBeamsOn; extern SDLName const SDLNameHMIDisplayLanguage; diff --git a/SmartDeviceLink/SDLNames.m b/SmartDeviceLink/SDLNames.m index 1962fd4d6..16de86756 100644 --- a/SmartDeviceLink/SDLNames.m +++ b/SmartDeviceLink/SDLNames.m @@ -140,6 +140,7 @@ SDLName const SDLNameHashId = @"hashID"; SDLName const SDLNameHDOP = @"hdop"; SDLName const SDLNameHeading = @"heading"; SDLName const SDLNameHeadLampStatus = @"headLampStatus"; +SDLName const SDLNameHeight = @"height"; SDLName const SDLNameHelpPrompt = @"helpPrompt"; SDLName const SDLNameHighBeamsOn = @"highBeamsOn"; SDLName const SDLNameHMIDisplayLanguage = @"hmiDisplayLanguage"; diff --git a/SmartDeviceLink/SDLSpatialStruct.h b/SmartDeviceLink/SDLSpatialStruct.h index e8a41d677..e32e25da8 100644 --- a/SmartDeviceLink/SDLSpatialStruct.h +++ b/SmartDeviceLink/SDLSpatialStruct.h @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSpatialStruct : SDLRPCStruct -- (instancetype)initWithId:(UInt32)id x:(NSN) +- (instancetype)initWithId:(UInt32)id x:(NSNumber *)x y:(NSNumber *)y width:(NSNumber *)width height:(NSNumber *)height; + /** * A user control spatial identifier * Required, Integer, 0 - 2,000,000,000 diff --git a/SmartDeviceLink/SDLSpatialStruct.m b/SmartDeviceLink/SDLSpatialStruct.m index 6b6cf8bcb..c83d1d123 100644 --- a/SmartDeviceLink/SDLSpatialStruct.m +++ b/SmartDeviceLink/SDLSpatialStruct.m @@ -6,81 +6,65 @@ // Copyright © 2017 smartdevicelink. All rights reserved. // +#import "NSMutableDictionary+Store.h" #import "SDLSpatialStruct.h" #import "SDLNames.h" @implementation SDLSpatialStruct -- (instancetype)init { - if (self = [super init]) { +- (instancetype)initWithId:(UInt32)id x:(NSNumber *)x y:(NSNumber *)y width:(NSNumber *)width height:(NSNumber *)height { + self = [self init]; + if (!self) { + return nil; } + + self.id = @(id); + self.x = x; + self.y = y; + self.width = width; + self.height = height; + return self; } -- (instancetype)initWithDictionary:(NSMutableDictionary *)dict { - if (self = [super initWithDictionary:dict]) { - } - return self; +- (void)setId:(NSNumber<SDLInt> *)id { + [store sdl_setObject:id forName:SDLNameId]; } -//- (void)setId:(NSNumber *)id { -// if (id != nil) { -// [store setObject:id forKey:NAMES_id]; -// } else { -// [store removeObjectForKey:NAMES_id]; -// } -//} -// -//- (NSNumber *)id { -// return [store objectForKey:NAMES_id]; -//} -// -//- (void)setX:(NSNumber *)x { -// if (x != nil) { -// [store setObject:x forKey:NAMES_x]; -// } else { -// [store removeObjectForKey:NAMES_x]; -// } -//} -// -//- (NSNumber *)x { -// return [store objectForKey:NAMES_x]; -//} -// -//- (void)setY:(NSNumber *)y { -// if (y != nil) { -// [store setObject:y forKey:NAMES_y]; -// } else { -// [store removeObjectForKey:NAMES_y]; -// } -//} -// -//- (NSNumber *)y { -// return [store objectForKey:NAMES_y]; -//} -// -//- (void)setWidth:(NSNumber *)width { -// if (width != nil) { -// [store setObject:width forKey:NAMES_width]; -// } else { -// [store removeObjectForKey:NAMES_width]; -// } -//} -// -//- (NSNumber *)width { -// return [store objectForKey:NAMES_width]; -//} -// -//- (void)setHeight:(NSNumber *)height { -// if (height != nil) { -// [store setObject:height forKey:NAMES_height]; -// } else { -// [store removeObjectForKey:NAMES_height]; -// } -//} -// -//- (NSNumber *)height { -// return [store objectForKey:NAMES_height]; -//} +- (NSNumber<SDLInt> *)id { + return [store sdl_objectForName:SDLNameId]; +} + +- (void)setX:(NSNumber<SDLFloat> *)x { + [store sdl_setObject:x forName:SDLNameX]; +} + +- (NSNumber<SDLFloat> *)x { + return [store sdl_objectForName:SDLNameX]; +} + +- (void)setY:(NSNumber<SDLFloat> *)y { + [store sdl_setObject:y forName:SDLNameY]; +} + +- (NSNumber<SDLFloat> *)y { + return [store sdl_objectForName:SDLNameY]; +} + +- (void)setWidth:(NSNumber<SDLFloat> *)width { + [store sdl_setObject:width forName:SDLNameWidth]; +} + +- (NSNumber<SDLFloat> *)width { + return [store sdl_objectForName:SDLNameWidth]; +} + +- (void)setHeight:(NSNumber<SDLFloat> *)height { + [store sdl_setObject:height forName:SDLNameHeight]; +} + +- (NSNumber<SDLFloat> *)height { + return [store sdl_objectForName:SDLNameHeight]; +} @end |