| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- // Generated by json_to_model
- #import "JDObject.h"
- #import "DeviceModel.h"
- #import "CustomRadioGroup.h"
- #import "CustomCheckBox.h"
- @implementation DeviceModel
- //FIRMWARE_VERSION
- //SWITCH_BINARY
- //SWITCH_MULTILEVEL
- //SWITCH_COLOR
- //SENSOR_BINARY
- //SENSOR_MULTILEVEL
- //THERMOSTAT_MODE
- //THERMOSTAT_FAN_MODE
- //THERMOSTAT_SETPOINT
- //LOCK
- //METER
- //AV_CONTROL_PLAYBACK
- //HOME_MODE
- #define ksCmdClassTypeFirmwareVersion @"FIRMWARE_VERSION"
- #define ksCmdClassTypeSwitchBinary @"SWITCH_BINARY"
- #define ksCmdClassTypeSwitchMultiLevel @"SWITCH_MULTILEVEL"
- #define ksCmdClassTypeSwitchColor @"SWITCH_COLOR"
- #define ksCmdClassTypeSensorBinary @"SENSOR_BINARY"
- #define ksCmdClassTypeSensorMultiLevel @"SENSOR_MULTILEVEL"
- #define ksCmdClassTypeThermostatMode @"THERMOSTAT_MODE"
- #define ksCmdClassTypeThermostatFanMode @"THERMOSTAT_FAN_MODE"
- #define ksCmdClassTypeThermostatSetPoint @"THERMOSTAT_SETPOINT"
- #define ksCmdClassTypeLock @"LOCK"
- #define ksCmdClassTypeMeterCurrent @"METER_CURRENT"
- #define ksCmdClassTypeMeterTotal @"METER_TOTAL"
- #define ksCmdClassTypeAVControlPlayback @"AV_CONTROL_PLAYBACK"
- #define ksCmdClassTypeHomeMode @"HOME_MODE"
- #define ksCmdClassTypeCameraStream @"CAMERA_STREAM"
- #define ksCmdClassTypeCameraPT @"CAMERA_PT"
- #define ksCmdClassTypeSpeedControl @"SPEED_CONTROL"
- //+ (JSONKeyMapper *)keyMapper {
- //
- // NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init];
- //
- // //self
- // [dictionary setValue:@"cmdclsTypeSystemName" forKey:@"cmdcls_type_system_name"];
- // [dictionary setValue:@"cmdclsTypeId" forKey:@"cmdcls_type_id"];
- // [dictionary setValue:@"cmdclsCode" forKey:@"cmdcls_code"];
- // [dictionary setValue:@"deviceProfileId" forKey:@"device_profile_id"];
- // [dictionary setValue:@"createDatetime" forKey:@"create_datetime"];
- // [dictionary setValue:@"cmdclsTypeName" forKey:@"cmdcls_type_name"];
- // [dictionary setValue:@"deviceName" forKey:@"device_name"];
- // [dictionary setValue:@"profileName" forKey:@"profile_name"];
- // [dictionary setValue:@"imageFileName" forKey:@"image_file_name"];
- // [dictionary setValue:@"contentValue" forKey:@"content_value"];
- // [dictionary setValue:@"nodeName" forKey:@"node_name"];
- // [dictionary setValue:@"cmdclsCount" forKey:@"cmdcls_count"];
- // [dictionary setValue:@"nodeId" forKey:@"node_id"];
- // [dictionary setValue:@"deviceId" forKey:@"device_id"];
- //
- // return [[JSONKeyMapper alloc] initWithDictionary:dictionary];
- //}
- + (CmdClsType)cmdclsTypeForCode:(NSString *)code {
- CmdClsType type = -1;
- if ([code isEqualToString:ksCmdClassTypeFirmwareVersion]) {
- type = CmdClsTypeFirmwareVersion;
- } else if ([code isEqualToString:ksCmdClassTypeSwitchBinary]) {
- type = CmdClsTypeSwitchBinary;
- } else if ([code isEqualToString:ksCmdClassTypeSwitchMultiLevel]) {
- type = CmdClsTypeSwitchMultiLevel;
- } else if ([code isEqualToString:ksCmdClassTypeSwitchColor]) {
- type = CmdClsTypeSwitchColor;
- } else if ([code isEqualToString:ksCmdClassTypeSensorBinary]) {
- type = CmdClsTypeSensorBinary;
- } else if ([code isEqualToString:ksCmdClassTypeSensorMultiLevel]) {
- type = CmdClsTypeSensorMultiLevel;
- } else if ([code isEqualToString:ksCmdClassTypeThermostatMode]) {
- type = CmdClsTypeThermostatMode;
- } else if ([code isEqualToString:ksCmdClassTypeThermostatFanMode]) {
- type = CmdClsTypeThermostatFanMode;
- } else if ([code isEqualToString:ksCmdClassTypeThermostatSetPoint]) {
- type = CmdClsTypeThermostatSetPoint;
- } else if ([code isEqualToString:ksCmdClassTypeLock]) {
- type = CmdClsTypeLock;
- } else if ([code isEqualToString:ksCmdClassTypeMeterCurrent]) {
- type = CmdClsTypeMeterCurrent;
- } else if ([code isEqualToString:ksCmdClassTypeMeterTotal]) {
- type = CmdClsTypeMeterTotal;
- } else if ([code isEqualToString:ksCmdClassTypeAVControlPlayback]) {
- type = CmdClsTypeAVControlPlayback;
- } else if ([code isEqualToString:ksCmdClassTypeHomeMode]) {
- type = CmdClsTypeHomeMode;
- } else if ([code isEqualToString:ksCmdClassTypeCameraStream]) {
- type = CmdClsTypeCameraStream;
- } else if ([code isEqualToString:ksCmdClassTypeCameraPT]) {
- type = CmdClsTypeCameraPT;
- } else if ([code isEqualToString:ksCmdClassTypeSpeedControl]) {
- type = CmdClsTypeSpeedControl;
- }
- return type;
- }
- - (CmdClsType)cmdclsType {
- return [DeviceModel cmdclsTypeForCode:_cmdclsCode];
- }
- - (NSInteger)cmdclsValueMsgLength {
- NSInteger length = 0;
- NSArray<CmdClsValueModel> *array = nil;
- switch ([self cmdclsType]) {
- case CmdClsTypeLock:
- array = [self cmdclsValueListOfLock];
- break;
- default:
- break;
- }
- for (CmdClsValueModel *tmpCmdclsValue in array) {
- if (tmpCmdclsValue.cmdclsValueMsg.length > length) {
- length = tmpCmdclsValue.cmdclsValueMsg.length;
- }
- }
- return length;
- }
- - (NSString *)cmdclsValueMsgLongest {
- NSString *hstring = nil;
- NSArray<CmdClsValueModel> *array = nil;
- switch ([self cmdclsType]) {
- case CmdClsTypeSwitchBinary:
- array = [self cmdclsValueListOfSwitchBinary];
- break;
- case CmdClsTypeLock:
- array = [self cmdclsValueListOfLock];
- break;
- default:
- break;
- }
- NSUInteger highest = 0;
- for (CmdClsValueModel *tmpCmdclsValue in array) {
- if (tmpCmdclsValue.cmdclsValueMsg.length > highest) {
- highest = tmpCmdclsValue.cmdclsValueMsg.length;
- hstring = tmpCmdclsValue.cmdclsValueMsg;
- }
- }
- return hstring;
- }
- - (NSString *)cmdclsValueMsg {
- switch ([self cmdclsType]) {
- case CmdClsTypeSensorBinary:
- _cmdclsValueMsg = [self cmdclsValueMsgOfSensorBinary];
- break;
- case CmdClsTypeThermostatMode:
- _cmdclsValueMsg = [self cmdclsValueMsgOfThermostatMode];
- break;
- case CmdClsTypeLock:
- _cmdclsValueMsg = [self cmdclsValueMsgOfLock];
- break;
- case CmdClsTypeSwitchBinary:
- _cmdclsValueMsg = [self cmdclsValueMsgOfSwitchBinary];
- break;
- case CmdClsTypeSpeedControl:
- _cmdclsValueMsg = [self cmdclsValueMsgOfSpeedControl];
- break;
- case CmdClsTypeAVControlPlayback:
- _cmdclsValueMsg = [self cmdclsValueMsgOfAVPlayback];
- break;
- default:
- break;
- }
- return _cmdclsValueMsg;
- }
- - (NSArray<CmdClsValueModel> *)cmdclsValueList {
- switch ([self cmdclsType]) {
- case CmdClsTypeThermostatMode:
- _cmdclsValueList = [self cmdclsValueListOfThermostatMode];
- break;
- case CmdClsTypeLock:
- _cmdclsValueList = [self cmdclsValueListOfLock];
- break;
- case CmdClsTypeSpeedControl:
- _cmdclsValueList = [self cmdclsValueListOfSpeedControl];
- break;
- default:
- break;
- }
- return _cmdclsValueList;
- }
- - (NSArray<CmdClsValueModel> *)cmdclsValueListOfThermostatMode {
- NSMutableArray<CmdClsValueModel> *array = [(NSMutableArray<CmdClsValueModel> *)[NSMutableArray alloc] init];
- NSInteger typeId = [_cmdclsTypeId integerValue];
- switch (typeId) {
- case 13001: {
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"OFF",
- @"cmdcls_value_msg": NSLocalizedString(@"꺼짐", @"꺼짐")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"COOL",
- @"cmdcls_value_msg": NSLocalizedString(@"냉방", @"냉방")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"HEAT",
- @"cmdcls_value_msg": NSLocalizedString(@"난방", @"난방")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"AUTO",
- @"cmdcls_value_msg": NSLocalizedString(@"자동", @"자동")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"FAN_ONLY",
- @"cmdcls_value_msg": NSLocalizedString(@"환기", @"환기")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"DRY_AIR",
- @"cmdcls_value_msg": NSLocalizedString(@"제습", @"제습")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"AWAY",
- @"cmdcls_value_msg": NSLocalizedString(@"외출", @"외출")} error:nil]];
- }
- break;
- case 13002: {
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"OFF",
- @"cmdcls_value_msg": NSLocalizedString(@"꺼짐", @"꺼짐")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"COOL",
- @"cmdcls_value_msg": NSLocalizedString(@"냉방", @"냉방")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"HEAT",
- @"cmdcls_value_msg": NSLocalizedString(@"난방", @"난방")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"AUTO",
- @"cmdcls_value_msg": NSLocalizedString(@"자동", @"자동")} error:nil]];
- }
- break;
- case 13003: {
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"OFF",
- @"cmdcls_value_msg": NSLocalizedString(@"꺼짐", @"꺼짐")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"HEAT",
- @"cmdcls_value_msg": NSLocalizedString(@"난방", @"난방")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"AWAY",
- @"cmdcls_value_msg": NSLocalizedString(@"외출", @"외출")} error:nil]];
- }
- break;
- case 13004: {
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"OFF",
- @"cmdcls_value_msg": NSLocalizedString(@"꺼짐", @"꺼짐")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"COOL",
- @"cmdcls_value_msg": NSLocalizedString(@"냉방", @"냉방")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"FAN_ONLY",
- @"cmdcls_value_msg": NSLocalizedString(@"환기", @"환기")} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"DRY_AIR",
- @"cmdcls_value_msg": NSLocalizedString(@"제습", @"제습")} error:nil]];
- }
- break;
- }
- return array;
- }
- - (NSArray<CmdClsValueModel> *)cmdclsValueListOfSwitchBinary {
- NSMutableArray<CmdClsValueModel> *array = [(NSMutableArray<CmdClsValueModel> *)[NSMutableArray alloc] init];
- NSInteger typeId = [_cmdclsTypeId integerValue];
- switch (typeId) {
- case 17001: {
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"ON",
- @"cmdcls_value_msg": @"켜짐"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"OFF",
- @"cmdcls_value_msg": @"꺼짐"} error:nil]];
- break;
- }
- }
- return array;
- }
- - (NSArray<CmdClsValueModel> *)cmdclsValueListOfLock {
- NSMutableArray<CmdClsValueModel> *array = [(NSMutableArray<CmdClsValueModel> *)[NSMutableArray alloc] init];
- NSInteger typeId = [_cmdclsTypeId integerValue];
- switch (typeId) {
- case 14001: {
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"LOCKED",
- @"cmdcls_value_msg": @"잠김"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"UNCLOCKED",
- @"cmdcls_value_msg": @"열림"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"JAMMED",
- @"cmdcls_value_msg": @"걸림"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"FORCED_OPEN",
- @"cmdcls_value_msg": @"수동"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"UNSPECIFIED",
- @"cmdcls_value_msg": @"오류"} error:nil]];
- }
- break;
- case 14002:
- case 14003:
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"LOCKED",
- @"cmdcls_value_msg": @"잠김"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"UNCLOCKED",
- @"cmdcls_value_msg": @"열림"} error:nil]];
- break;
- }
- return array;
- }
- - (NSArray<CmdClsValueModel> *)cmdclsValueListOfSpeedControl {
- NSMutableArray<CmdClsValueModel> *array = [(NSMutableArray<CmdClsValueModel> *)[NSMutableArray alloc] init];
- NSInteger typeId = [_cmdclsTypeId integerValue];
- switch (typeId) {
- case 20001: {
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"OFF",
- @"cmdcls_value_msg": @"꺼짐"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"LOW",
- @"cmdcls_value_msg": @"약"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"MEDIUM",
- @"cmdcls_value_msg": @"중"} error:nil]];
- [array addObject:[[CmdClsValueModel alloc] initWithDictionary:@{@"cmdcls_value":@"HIGH",
- @"cmdcls_value_msg": @"강"} error:nil]];
- }
- break;
- }
- return array;
- }
- - (NSString *)cmdclsValueMsgOfSensorBinary {
- NSInteger typeId = [_cmdclsTypeId integerValue];
- NSString *msg = ksEmptyString;
- switch (typeId) {
- case 11001:
- case 11002:
- case 11003:
- case 11004:
- case 11005:
- case 11006:
- case 11007:
- case 11008:
- case 11009:
- case 11010:
- case 11012:
- case 11013:
- case 11014:
- case 11016:
- if ([self.contentValue isEqualToString:@"TRUE"]) {
- msg = NSLocalizedString(@"감지됨", @"감지됨");
- } else if ([self.contentValue isEqualToString:@"FALSE"]) {
- msg = NSLocalizedString(@"정상", @"정상");
- } else {
- msg = @"-";
- }
- break;
- case 11011:
- if ([self.contentValue isEqualToString:@"TRUE"]) {
- msg = NSLocalizedString(@"열림", @"열림");
- } else if ([self.contentValue isEqualToString:@"FALSE"]) {
- msg = NSLocalizedString(@"닫힘", @"닫힘");
- } else {
- msg = @"-";
- }
- case 11015:
- if ([self.contentValue isEqualToString:@"TRUE"]) {
- msg = NSLocalizedString(@"들어옴", @"들어옴");
- } else if ([self.contentValue isEqualToString:@"FALSE"]) {
- msg = NSLocalizedString(@"나감", @"나감");
- } else {
- msg = @"-";
- }
- break;
- }
- return msg;
- }
- - (NSString *)cmdclsValueMsgOfThermostatMode {
- NSInteger typeId = [_cmdclsTypeId integerValue];
- NSString *msg = ksEmptyString;
- switch (typeId) {
- case 13001:
- case 13002:
- case 13003:
- case 13004:
- if ([self.contentValue isEqualToString:@"OFF"]) {
- msg = NSLocalizedString(@"꺼짐", @"꺼짐");
- } else if ([self.contentValue isEqualToString:@"COOL"]) {
- msg = NSLocalizedString(@"냉방", @"냉방");
- } else if ([self.contentValue isEqualToString:@"HEAT"]) {
- msg = NSLocalizedString(@"난방", @"난방");
- } else if ([self.contentValue isEqualToString:@"AUTO"]) {
- msg = NSLocalizedString(@"자동", @"자동");
- } else if ([self.contentValue isEqualToString:@"FAN_ONLY"]) {
- msg = NSLocalizedString(@"환기", @"환기");
- } else if ([self.contentValue isEqualToString:@"DRY_AIR"]) {
- msg = NSLocalizedString(@"제습", @"제습");
- } else if ([self.contentValue isEqualToString:@"AWAY"]) {
- msg = NSLocalizedString(@"외출", @"외출");
- } else {
- msg = @"-";
- }
- break;
- }
- return msg;
- }
- - (NSString *)cmdclsValueMsgOfLock {
- NSInteger typeId = [_cmdclsTypeId integerValue];
- NSString *msg = ksEmptyString;
- switch (typeId) {
- case 14001:
- if ([self.contentValue isEqualToString:@"LOCKED"]) {
- msg = NSLocalizedString(@"잠김", @"잠김");
- } else if ([self.contentValue isEqualToString:@"UNLOCKED"]) {
- msg = NSLocalizedString(@"열림", @"열림");
- } else if ([self.contentValue isEqualToString:@"JAMMED"]) {
- msg = NSLocalizedString(@"걸림", @"걸림");
- } else if ([self.contentValue isEqualToString:@"FORCED_OPEN"]) {
- msg = NSLocalizedString(@"수동", @"수동");
- } else if ([self.contentValue isEqualToString:@"UNSPECIFIED"]) {
- msg = NSLocalizedString(@"오류", @"오류");
- } else {
- msg = @"-";
- }
- break;
- case 14002:
- case 14003:
- if ([self.contentValue isEqualToString:@"LOCKED"]) {
- msg = @"잠김";
- } else if ([self.contentValue isEqualToString:@"UNLOCKED"]) {
- msg = @"열림";
- } else {
- msg = @"-";
- }
- break;
- }
- return msg;
- }
- - (NSString *)cmdclsValueMsgOfSwitchBinary {
- NSInteger typeId = [_cmdclsTypeId integerValue];
- NSString *msg = ksEmptyString;
- switch (typeId) {
- case 17001:
- if ([self.contentValue isEqualToString:@"ON"]) {
- msg = NSLocalizedString(@"켜짐", @"켜짐");
- } else if ([self.contentValue isEqualToString:@"OFF"]) {
- msg = NSLocalizedString(@"꺼짐", @"꺼짐");
- } else {
- msg = @"-";
- }
- break;
- }
- return msg;
- }
- - (NSString *)cmdclsValueMsgOfSpeedControl {
- NSInteger typeId = [_cmdclsTypeId integerValue];
- NSString *msg = ksEmptyString;
- switch (typeId) {
- case 20001:
- if ([self.contentValue isEqualToString:@"OFF"]) {
- msg = NSLocalizedString(@"꺼짐", @"꺼짐");
- } else if ([self.contentValue isEqualToString:@"LOW"]) {
- msg = NSLocalizedString(@"약", @"약");
- } else if ([self.contentValue isEqualToString:@"MEDIUM"]) {
- msg = NSLocalizedString(@"중", @"중");
- } else if ([self.contentValue isEqualToString:@"HIGH"]) {
- msg = NSLocalizedString(@"강", @"강");
- } else {
- msg = @"-";
- }
- break;
- }
- return msg;
- }
- - (NSString *)cmdclsValueMsgOfAVPlayback {
- NSInteger typeId = [_cmdclsTypeId integerValue];
- NSString *msg = ksEmptyString;
- switch (typeId) {
- case 21001:
- if ([self.contentValue isEqualToString:@"PLAYING"]) {
- msg = NSLocalizedString(@"재생 중", @"재생 중");
- } else if ([self.contentValue isEqualToString:@"PAUSED"]) {
- msg = NSLocalizedString(@"정지 됨", @"정지 됨");
- } else {
- msg = @"-";
- }
- break;
- }
- return msg;
- }
- - (instancetype)initWithSubItem:(ItemSubModel *)subItem {//mobile devices.
- if (self = [super init]) {
- self.deviceId = subItem.sourceId;
- self.deviceName = subItem.sourceName;
- self.nodeId = subItem.sourceSubId;
- self.nodeName = subItem.sourceSubName;
- self.conditionTypeCode = subItem.conditionTypeCode;
- self.dataTypeCode = subItem.dataTypeCode;
- self.cmdclsValue = subItem.cmdclsValue;
- self.nickname = subItem.nickname;
- self.deleteYn = subItem.deleteYn;
- // objc_setAssociatedObject(self, @"CHECK_STATUS", @YES, OBJC_ASSOCIATION_COPY_NONATOMIC); //for checkbox
- [[JDFacade facade] setRadioButtonStatus:@YES object:self]; //for radio box
- }
- return self;
- }
- - (NSString *)unit {
- if ([_unit isEqualToString:@"\\"]) {
- _unit = @"₩";
- }
- return _unit;
- }
- @end
- @implementation DeviceListModel
- @end
- @implementation NodeModel
- //- (CmdClsType)cmdclsType {
- // return [DeviceModel cmdclsTypeForCode:_cmdclsCode];
- //}
- @end
- @implementation DeviceDetailModel
- @end
- @implementation PredefinedDeviceModel
- //+ (JSONKeyMapper *)keyMapper {
- //
- // NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init];
- //
- // //self
- // [dictionary setValue:@"cmdclsTypeSystemName" forKey:@"cmdcls_type_system_name"];
- // [dictionary setValue:@"cmdclsTypeId" forKey:@"cmdcls_type_id"];
- // [dictionary setValue:@"cmdclsCode" forKey:@"cmdcls_code"];
- // [dictionary setValue:@"deviceProfileId" forKey:@"device_profile_id"];
- // [dictionary setValue:@"createDatetime" forKey:@"create_datetime"];
- // [dictionary setValue:@"cmdclsTypeName" forKey:@"cmdcls_type_name"];
- // [dictionary setValue:@"deviceName" forKey:@"device_name"];
- // [dictionary setValue:@"profileName" forKey:@"profile_name"];
- // [dictionary setValue:@"imageFileName" forKey:@"image_file_name"];
- // [dictionary setValue:@"contentValue" forKey:@"content_value"];
- // [dictionary setValue:@"nodeName" forKey:@"node_name"];
- // [dictionary setValue:@"cmdclsCount" forKey:@"cmdcls_count"];
- // [dictionary setValue:@"nodeId" forKey:@"node_id"];
- // [dictionary setValue:@"deviceId" forKey:@"device_id"];
- // [dictionary setValue:@"cmdclsValue" forKey:@"cmdcls_value"];
- // [dictionary setValue:@"conditionTypeCode" forKey:@"condition_type_code"];
- // [dictionary setValue:@"dataTypeCode" forKey:@"data_type_code"];
- //
- // return [[JSONKeyMapper alloc] initWithDictionary:dictionary];
- //}
- - (instancetype)initWithSubItem:(ItemSubModel *)subItem {
- if (self = [super init]) {
- self.deviceId = subItem.sourceId;
- self.deviceName = subItem.sourceName;
- self.nodeId = subItem.sourceSubId;
- self.nodeName = subItem.sourceSubName;
- self.conditionTypeCode = subItem.conditionTypeCode;
- self.dataTypeCode = subItem.dataTypeCode;
- self.cmdclsValue = subItem.cmdclsValue;
- self.predCmdclsValue = subItem.predCmdclsValue;
- self.deleteYn = subItem.deleteYn;
- [[JDFacade facade] setCheckBoxStatus:@YES object:self]; //for check box
- [[JDFacade facade] setRadioButtonStatus:@YES object:self]; //for radio box
- }
- return self;
- }
- @end
- @implementation PredefinedDeviceListModel
- @end
- @implementation GroupsModel
- @end
- @implementation GroupsListModel
- @end
- @implementation CmdClsValueModel
- @end
- @implementation DeviceIconModel
- @end
- @implementation DeviceIconListModel
- @end
|