// Generated by json_to_model

@import Foundation;


#import "JDJSONModel.h"
#import "ItemModel.h"

#define ksDeviceTypeControllerPrimary @"CONTROLLER_PRIMARY"
#define ksDeviceTypeSlave @"SLAVE"

#define ksDeviceProfileIdUnknown @"20001"

@protocol CmdClsValueModel;
@protocol DeviceModel;
@interface DeviceModel : ItemSubModel

@property (copy, nonatomic) NSString *categoryName;
@property (copy, nonatomic) NSString *categoryCode;
@property (copy, nonatomic) NSString *deviceId;
@property (copy, nonatomic) NSString *deviceSn;
@property (copy, nonatomic) NSString *deviceName;
@property (copy, nonatomic) NSString *deviceProfileId;
@property (copy, nonatomic) NSString *profileName;
//@property (copy, nonatomic) NSString *imageFileName;
@property (copy, nonatomic) NSString *nodeId;
@property (copy, nonatomic) NSString *nodeName;
@property (copy, nonatomic) NSString *cmdclsName;
@property (copy, nonatomic) NSString *groupName;


@property (copy, nonatomic) NSString *createDatetime;
@property (copy, nonatomic) NSString *updateDatetime;

@property (copy, nonatomic) NSString *cmdclsCount;
@property (copy, nonatomic) NSString *cmdclsId;
@property (copy, nonatomic) NSString *contentValue;
@property (copy, nonatomic) NSString *contentValueMsg;
@property (copy, nonatomic) NSString *networkYn;
@property (copy, nonatomic) NSString *deviceType;
@property (copy, nonatomic) NSString *collectTime;

@property (copy, nonatomic) NSString *deviceOnline; //홈허브 네트워크(MQTT) 연결상태
@property (copy, nonatomic) NSString *deviceOnlineLastDatetime;
@property (copy, nonatomic) NSString *deviceConnLastDatetime;
@property (copy, nonatomic) NSString *contentLastDatetime;
@property (copy, nonatomic) NSString *deviceConn;  // 홈허브 동글 연결 상태

@property (copy, nonatomic) NSString *deviceclassTypeId;

@property (copy, nonatomic) NSString *totalCtrtCnt; //게이트웨이 별 전체 장치 개수
@property (copy, nonatomic) NSString *remainCtrtCnt;//추가가가능한 장치 개수

@property (assign, nonatomic, readonly) BOOL isDeviceOnlined; //홈허브 네트워크(MQTT) 연결상태
@property (assign, nonatomic, readonly) BOOL isDeviceConn;
@property (assign, nonatomic, readonly) BOOL isUpdateNeed; // 홈허브 동글 연결 상태
@property (assign, nonatomic, readonly) BOOL isUpdateSoftware;
@property (assign, nonatomic, readonly) BOOL isUpdateFirmware;


//detail
@property (copy, nonatomic) NSString *seq;
@property (copy, nonatomic) NSString *prdName;
@property (copy, nonatomic) NSString *prdUserName;
@property (copy, nonatomic) NSString *deviceModelId;
@property (copy, nonatomic) NSString *deviceMfId;
@property (copy, nonatomic) NSString *lastSoftwareVersion;
@property (copy, nonatomic) NSString *lastFirmwareVersion;
@property (copy, nonatomic) NSString *firmwareVersion;
@property (copy, nonatomic) NSString *softwareVersion;
@property (copy, nonatomic) NSString *deviceProtocolType;   //연결타입
@property (copy, nonatomic) NSString *removableYn;          //장치삭제 가능 여부
@property (copy, nonatomic) NSString *activationCode;       //장치 인증 코드



//camera
@property (copy, nonatomic) NSString *ip;
@property (copy, nonatomic) NSString *port;
@property (copy, nonatomic) NSString *cameraId;
@property (copy, nonatomic) NSString *cameraPassword;

//Command
@property (copy, nonatomic) NSString *commandId;
@property (copy, nonatomic) NSString *requestTime;

//Local temporary
@property (assign, nonatomic) BOOL enable;
@property (assign, nonatomic) BOOL isRequesting;


- (UIImage *)backgroundImageForMandatary:(NSString *)value;
- (UIImage *)imageForMandataryForState:(UIControlState)state;
- (NSString *)conditionForMandatary;

- (UIImage *)imgaeForAddDel;
- (NSString *)manufacturerName;
- (NSString *)getAddDelDescription;

- (instancetype)initWithSubItem:(ItemSubModel *)subItem;
- (instancetype)initWithDeviceModel:(DeviceModel *)deviceModel deviceName:(NSString*)deviceName
;
+ (NSString *)contentValueMsgByCmdClsCode:(NSString *)cmdclsCode cmdclsTypeId:(NSString *)cmdclsTypeId contentValue:(NSString *)contentValue;

@end

@interface DeviceListModel : JDJSONModel
@property (copy, nonatomic) NSMutableArray<DeviceModel> *list;
@end

@interface NodeListModel : JDJSONModel
@property (copy, nonatomic) NSString *ctrtCnt;
@property (copy, nonatomic) NSMutableArray<DeviceModel> *devices;
@property (copy, nonatomic) NSMutableArray<DeviceModel> *nodes;

-(BOOL)isCanReOrder;
-(BOOL)isCanAddNode;
-(BOOL)isCanDelNode;

@end

@protocol NodeModel;
@interface NodeModel : DeviceModel

@property (copy, nonatomic) NSString *cmdclsMandatoryYn;
@property (weak, nonatomic) DeviceModel *refDevice;
@property (assign, nonatomic, readonly) BOOL isDeviceOnline;


//@property (copy, nonatomic) NSString *deviceId;
//@property (copy, nonatomic) NSString *nodeId;
//@property (copy, nonatomic) NSString *nodeName;
//@property (copy, nonatomic) NSString *cmdclsTypeId;
//@property (copy, nonatomic) NSString *cmdclsTypeName;
//@property (copy, nonatomic) NSString *cmdclsTypeSystemName;
//@property (copy, nonatomic) NSString *createDatetime;
//@property (copy, nonatomic) NSString *cmdclsCode;
//
//@property (assign, nonatomic) CmdClsType cmdclsType;

@end

@interface DeviceDetailModel : DeviceModel

@property (copy, nonatomic) NSString *profileUpdateYn;
@property (copy, nonatomic) NSArray<NodeModel> *cmdclsList;
@property (copy, nonatomic) NSArray<DeviceModel> *relateDevice;

-(BOOL)isProfileUpdate;

@end


@protocol ItemModel;
@protocol PredefinedDeviceModel;
@interface PredefinedDeviceModel : DeviceModel

- (instancetype)initWithSubItem:(ItemSubModel *)subItem;
@end

@interface PredefinedDeviceListModel : JDJSONModel

@property (strong, nonatomic) NSArray<PredefinedDeviceModel> *list;

@end



@protocol DeviceIconModel;
@interface DeviceIconModel : JDJSONModel

@property (copy, nonatomic) NSString *imageSequence;
@property (copy, nonatomic) NSString *imageFileName;

@end

@interface DeviceIconListModel : JDJSONModel

@property (copy, nonatomic) NSArray<DeviceIconModel> *list;

@end
