Initial commit
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// KeLiAiBackMassage.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/23.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
//返回 72字节
|
||||
@interface KeLiAiBackMassage : NSObject
|
||||
|
||||
@property(nonatomic,copy) NSString *light1btn;
|
||||
@property(nonatomic,copy) NSString *light2btn;
|
||||
@property(nonatomic,copy) NSString *ultravioletRay;
|
||||
@property(nonatomic,copy) NSString *pumpBtn;
|
||||
@property(nonatomic,copy) NSString *timer1;
|
||||
@property(nonatomic,copy) NSString *timer2;
|
||||
@property(nonatomic,copy) NSString *timer3;
|
||||
@property(nonatomic,copy) NSString *timer4;
|
||||
@property(nonatomic,copy) NSString *timer5;
|
||||
@property(nonatomic,copy) NSString *timer6;
|
||||
@property(nonatomic,copy) NSString *heatStickState;
|
||||
@property(nonatomic,copy) NSString *wendu;
|
||||
// 加热温度
|
||||
@property(nonatomic,copy) NSString *heatTemperature;
|
||||
|
||||
@property(nonatomic,copy) NSString *baojingSwitch;
|
||||
|
||||
@property(nonatomic,copy) NSString *miniTp;
|
||||
|
||||
@property(nonatomic,copy) NSString *maxTp;
|
||||
|
||||
//预留参数00
|
||||
@property(nonatomic,copy)NSString *yuLiu;
|
||||
|
||||
@property(nonatomic,copy) NSString *funcCode;
|
||||
|
||||
@end
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// KeLiAiBackMassage.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/23.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KeLiAiBackMassage.h"
|
||||
|
||||
@implementation KeLiAiBackMassage
|
||||
-(void)encodeWithCoder:(NSCoder*)aCoder{
|
||||
|
||||
[aCoder encodeObject:self forKey:@"ultravioletRay"];
|
||||
[aCoder encodeObject:self forKey:@"light1"];
|
||||
[aCoder encodeObject:self forKey:@"light2"];
|
||||
[aCoder encodeObject:self forKey:@"pumpBtn"];
|
||||
|
||||
[aCoder encodeObject:self forKey:@"timer1"];
|
||||
[aCoder encodeObject:self forKey:@"timer2"];
|
||||
[aCoder encodeObject:self forKey:@"timer3"];
|
||||
[aCoder encodeObject:self forKey:@"timer4"];
|
||||
[aCoder encodeObject:self forKey:@"timer5"];
|
||||
[aCoder encodeObject:self forKey:@"timer6"];
|
||||
[aCoder encodeObject:self forKey:@"heatStickState"];
|
||||
[aCoder encodeObject:self forKey:@"wendu"];
|
||||
|
||||
[aCoder encodeObject:self forKey:@"heatTemperature"];
|
||||
[aCoder encodeObject:self forKey:@"baojingSwitch"];
|
||||
[aCoder encodeObject:self forKey:@"miniTp"];
|
||||
[aCoder encodeObject:self forKey:@"maxTp"];
|
||||
|
||||
[aCoder encodeObject:self forKey:@"yuLiu"];
|
||||
|
||||
[aCoder encodeObject:self forKey:@"funcCode"];
|
||||
}
|
||||
//解挡时调用
|
||||
-(id)initWithCoder:(NSCoder*)aDecoder{
|
||||
|
||||
|
||||
if (self=[super init]) {
|
||||
|
||||
self.light1btn =[aDecoder decodeObjectForKey:@"light1"];
|
||||
self.light2btn =[aDecoder decodeObjectForKey:@"light2"];
|
||||
self.ultravioletRay=[aDecoder decodeObjectForKey:@"ultravioletRay"];
|
||||
self.pumpBtn=[aDecoder decodeObjectForKey:@"pumpBtn"];
|
||||
|
||||
self.timer1 = [aDecoder decodeObjectForKey:@"timer1"];
|
||||
self.timer2 = [aDecoder decodeObjectForKey:@"timer2"];
|
||||
self.timer3 = [aDecoder decodeObjectForKey:@"timer3"];
|
||||
self.timer4 = [aDecoder decodeObjectForKey:@"timer4"];
|
||||
self.timer5 = [aDecoder decodeObjectForKey:@"timer5"];
|
||||
self.timer6 = [aDecoder decodeObjectForKey:@"timer6"];
|
||||
self.heatStickState = [aDecoder decodeObjectForKey:@"heatStickState"];
|
||||
self.wendu = [aDecoder decodeObjectForKey:@"wendu"];
|
||||
self.heatTemperature =[aDecoder decodeObjectForKey:@"heatTemperature"];
|
||||
|
||||
self.baojingSwitch=[aDecoder decodeObjectForKey:@"baojingSwitch"];
|
||||
self.miniTp=[aDecoder decodeObjectForKey:@"miniTp"];
|
||||
self.maxTp=[aDecoder decodeObjectForKey:@"maxTp"];
|
||||
|
||||
self.yuLiu = [aDecoder decodeObjectForKey:@"yuLiu"];
|
||||
|
||||
self.funcCode = [aDecoder decodeObjectForKey:@"funcCode"];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// KeLiAiBackmassageDataUnity.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/23.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "KeLiAiBackMassage.h"
|
||||
@interface KeLiAiBackmassageDataUnity : NSObject
|
||||
/**
|
||||
* save soket massage control
|
||||
*/
|
||||
+(void)readSoketDataWithBaackMassgModel:(KeLiAiBackMassage*)Xutomodel
|
||||
addWithBackData:(NSData*)data;
|
||||
|
||||
/**
|
||||
* setTemperaturelabel
|
||||
*/
|
||||
+(void)setTemperaturelabel:(UILabel*)temperaturelabel
|
||||
addbubleImge:(UIImageView*)bubleImg
|
||||
WithBackData:(NSData*)data
|
||||
addWithBackMassageModel:(KeLiAiBackMassage*)backModel
|
||||
addWithTableview:(UITableView*)tableview;
|
||||
|
||||
/**
|
||||
* light state
|
||||
*/
|
||||
|
||||
+(void)resetKeLiAiButtonState:(UIButton*)light1
|
||||
addlight2:(UIButton*)light2
|
||||
addultravioletRay:(UIButton*)ultravioletRay
|
||||
addWaterPump:(UIButton*)waterPump
|
||||
addJiaRe:(UIButton*)jiaReBang
|
||||
withBackModel:(KeLiAiBackMassage*)backModel;
|
||||
|
||||
/**
|
||||
* refresh setViewData
|
||||
*/
|
||||
+(NSArray*)refreshKeLiAiTimerAddTemperatureWithBackMassageModel:(KeLiAiBackMassage*)backModel;
|
||||
|
||||
@end
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
//
|
||||
// KeLiAiBackmassageDataUnity.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/23.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KeLiAiBackmassageDataUnity.h"
|
||||
|
||||
@implementation KeLiAiBackmassageDataUnity
|
||||
|
||||
+(void)readSoketDataWithBaackMassgModel:(KeLiAiBackMassage*)model addWithBackData:(NSData*)data{
|
||||
|
||||
NSString*totalString=[dataContorl dataToHexString:data];// 转十六进制
|
||||
|
||||
model.light1btn=[totalString substringWithRange:NSMakeRange(30, 4)];
|
||||
model.light2btn=[totalString substringWithRange:NSMakeRange(34, 4)];
|
||||
model.ultravioletRay=[totalString substringWithRange:NSMakeRange(38, 4)];
|
||||
model.pumpBtn=[totalString substringWithRange:NSMakeRange(42, 4)];
|
||||
|
||||
model.timer1=[totalString substringWithRange:NSMakeRange(46,12)];
|
||||
model.timer2=[totalString substringWithRange:NSMakeRange(58, 12)];
|
||||
model.timer3=[totalString substringWithRange:NSMakeRange(70, 12)];
|
||||
model.timer4=[totalString substringWithRange:NSMakeRange(82, 12)];
|
||||
model.timer5=[totalString substringWithRange:NSMakeRange(94, 12)];
|
||||
model.timer6=[totalString substringWithRange:NSMakeRange(106, 12)];
|
||||
model.heatStickState=[totalString substringWithRange:NSMakeRange(118, 2)];//16进制型
|
||||
model.wendu=[totalString substringWithRange:NSMakeRange(120, 4)];
|
||||
model.heatTemperature=[totalString substringWithRange:NSMakeRange(124, 4)];
|
||||
model.baojingSwitch=[totalString substringWithRange:NSMakeRange(128, 2)];
|
||||
model.miniTp=[totalString substringWithRange:NSMakeRange(130, 4)];
|
||||
model.maxTp=[totalString substringWithRange:NSMakeRange(134, 4)];
|
||||
model.yuLiu = [totalString substringWithRange:NSMakeRange(138, 2)];
|
||||
model.funcCode= [totalString substringWithRange:NSMakeRange(140, 4)];
|
||||
// //实施更新数据 保存
|
||||
[[DataCenter defaultDtacenter] setValue:model forKey:@"KeLiAiBackInfo"];
|
||||
|
||||
|
||||
}
|
||||
|
||||
+(void)setTemperaturelabel:(UILabel*)temperaturelabel addbubleImge:(UIImageView*)bubleImg WithBackData:(NSData*)data addWithBackMassageModel:(KeLiAiBackMassage*)backModel addWithTableview:(UITableView*)tableview
|
||||
{
|
||||
NSString*str=[dataContorl dataToHexString:data];
|
||||
|
||||
str=[str substringWithRange:NSMakeRange(120,4)];
|
||||
UInt64 mac=[dataContorl hexToTen:str];
|
||||
NSLog(@"%llu",mac);
|
||||
|
||||
//float TPlabel=mac/10+(mac%10)*0.1;
|
||||
float TPlabel=mac/10;
|
||||
int temp= (int)(TPlabel+0.5);
|
||||
|
||||
NSString *stringFloat = [NSString stringWithFormat:@"%d",temp];
|
||||
NSLog(@"%@",stringFloat);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (mac==0) {
|
||||
|
||||
temperaturelabel.text=@"0";
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
temperaturelabel.text=stringFloat;
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
+(void)resetKeLiAiButtonState:(UIButton*)light1 addlight2:(UIButton*)light2 addultravioletRay:(UIButton*)ultravioletRay addWaterPump:(UIButton*)waterPump addJiaRe:(UIButton*)jiaReBang withBackModel:(KeLiAiBackMassage*)backModel{
|
||||
|
||||
// 灯1
|
||||
|
||||
NSString*stateString1=[backModel.light1btn substringWithRange:NSMakeRange(2, 2)];
|
||||
|
||||
if ([stateString1 isEqualToString:@"01"]) {
|
||||
[light1 setImage:[UIImage imageNamed:@"PFLight1_on"] forState:UIControlStateNormal];
|
||||
light1.selected=YES;
|
||||
}else{
|
||||
[light1 setImage:[UIImage imageNamed:@"PFLight1_off"] forState:UIControlStateNormal];
|
||||
light1.selected=NO;
|
||||
|
||||
}
|
||||
// 灯2
|
||||
|
||||
NSString*stateString2=[backModel.light2btn substringWithRange:NSMakeRange(2, 2)];
|
||||
|
||||
if ([stateString2 isEqualToString:@"01"]) {
|
||||
[light2 setImage:[UIImage imageNamed:@"PFLight1_on"] forState:UIControlStateNormal];
|
||||
light2.selected=YES;
|
||||
}else{
|
||||
[light2 setImage:[UIImage imageNamed:@"PFLight1_off"] forState:UIControlStateNormal];
|
||||
light2.selected=NO;
|
||||
}
|
||||
|
||||
// 紫外灯
|
||||
|
||||
NSString*stateString3=[backModel.ultravioletRay substringWithRange:NSMakeRange(2, 2)];
|
||||
|
||||
if ([stateString3 isEqualToString:@"01"]) {
|
||||
[ultravioletRay setImage:[UIImage imageNamed:@"PFkilLlight_on"] forState:UIControlStateNormal];
|
||||
ultravioletRay.selected=YES;
|
||||
}else{
|
||||
[ultravioletRay setImage:[UIImage imageNamed:@"PFkilLlight_off"] forState:UIControlStateNormal];
|
||||
|
||||
ultravioletRay.selected=NO;
|
||||
}
|
||||
|
||||
// 水泵
|
||||
|
||||
NSString*stateString4=[backModel.pumpBtn substringWithRange:NSMakeRange(2, 2)];
|
||||
|
||||
|
||||
if ([stateString4 isEqualToString:@"01"]){
|
||||
|
||||
[waterPump setImage:[UIImage imageNamed:@"ChongLang_on"] forState:UIControlStateNormal];
|
||||
waterPump.selected=YES;
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
[waterPump setImage:[UIImage imageNamed:@"ChongLang_off"] forState:UIControlStateNormal];
|
||||
waterPump.selected=NO;
|
||||
|
||||
}
|
||||
|
||||
// 加热棒 状态 1字节
|
||||
NSString*stateString5=[backModel.heatStickState substringWithRange:NSMakeRange(0, 2)];
|
||||
|
||||
|
||||
if ([stateString5 isEqualToString:@"01"]){
|
||||
|
||||
[jiaReBang setImage:[UIImage imageNamed:@"JiaReBang_on"] forState:UIControlStateNormal];
|
||||
jiaReBang.selected=YES;
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
[jiaReBang setImage:[UIImage imageNamed:@"JiaReBang_off"] forState:UIControlStateNormal];
|
||||
jiaReBang.selected=NO;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+(NSArray*)refreshKeLiAiTimerAddTemperatureWithBackMassageModel:(KeLiAiBackMassage*)backModel{
|
||||
|
||||
NSArray*timerArr=[[NSArray alloc]init];
|
||||
NSString*low=backModel.miniTp;
|
||||
NSString*heigh=backModel.maxTp;
|
||||
UInt64 lowten=[dataContorl hexToTen:low];
|
||||
UInt64 heighten=[dataContorl hexToTen:heigh];
|
||||
float formatlow=lowten/10;
|
||||
float formatheigh=heighten/10;
|
||||
|
||||
NSString*wenduString=[NSString stringWithFormat:@"%.0f~%.0f°C",formatlow,formatheigh];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex1=[backModel.timer1 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex1=[backModel.timer1 substringWithRange:NSMakeRange(8, 4)];
|
||||
|
||||
|
||||
// 十进制
|
||||
NSString*startTimeTen1=[dataContorl hexStringToDateString:startTimeHex1];
|
||||
NSString*endTimeTen1=[dataContorl hexStringToDateString:endTimeHex1];
|
||||
NSString*setTim1=[NSString stringWithFormat:@"%@~%@",startTimeTen1,endTimeTen1];
|
||||
// 十六进制
|
||||
NSString*startTimeHex2=[backModel.timer2 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex2=[backModel.timer2 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen2=[dataContorl hexStringToDateString:startTimeHex2];
|
||||
NSString*endTimeTen2=[dataContorl hexStringToDateString:endTimeHex2];
|
||||
NSString*setTim2=[NSString stringWithFormat:@"%@~%@",startTimeTen2,endTimeTen2];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex3=[backModel.timer3 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex3=[backModel.timer3 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen3=[dataContorl hexStringToDateString:startTimeHex3];
|
||||
NSString*endTimeTen3=[dataContorl hexStringToDateString:endTimeHex3];
|
||||
NSString*setTim3=[NSString stringWithFormat:@"%@~%@",startTimeTen3,endTimeTen3];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex4=[backModel.timer4 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex4=[backModel.timer4 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen4=[dataContorl hexStringToDateString:startTimeHex4];
|
||||
NSString*endTimeTen4=[dataContorl hexStringToDateString:endTimeHex4];
|
||||
NSString*setTim4=[NSString stringWithFormat:@"%@~%@",startTimeTen4,endTimeTen4];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex5=[backModel.timer5 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex5=[backModel.timer5 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen5=[dataContorl hexStringToDateString:startTimeHex5];
|
||||
NSString*endTimeTen5=[dataContorl hexStringToDateString:endTimeHex5];
|
||||
NSString*setTim5=[NSString stringWithFormat:@"%@~%@",startTimeTen5,endTimeTen5];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex6=[backModel.timer6 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex6=[backModel.timer6 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen6=[dataContorl hexStringToDateString:startTimeHex6];
|
||||
NSString*endTimeTen6=[dataContorl hexStringToDateString:endTimeHex6];
|
||||
NSString*setTim6=[NSString stringWithFormat:@"%@~%@",startTimeTen6,endTimeTen6];
|
||||
|
||||
|
||||
timerArr=@[@[wenduString,@"设置时段"],@[setTim1,setTim2],@[setTim3,setTim4],@[setTim5,setTim6]];
|
||||
|
||||
return timerArr;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// KeLiAiCenterViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/17.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CenterViewController.h"
|
||||
|
||||
// 可丽爱 主控制界面
|
||||
|
||||
@interface KeLiAiCenterViewController : CenterViewController
|
||||
|
||||
@property(nonatomic,strong) UIButton *button;
|
||||
@property(nonatomic,strong) UILabel *buttonNameLabel;
|
||||
|
||||
// 灯1
|
||||
@property(nonatomic,strong) UIButton *keliaLight1Btn;
|
||||
//@property(nonatomic,strong) UILabel *keliaLight1NameLabel;
|
||||
|
||||
// 灯2
|
||||
@property(nonatomic,strong) UIButton *keliaLight2Btn;
|
||||
//@property(nonatomic,strong) UILabel *keliaLight2Label;
|
||||
// 水泵
|
||||
@property(nonatomic,strong) UIButton *keliaPumpBtn;
|
||||
//@property(nonatomic,strong) UILabel *keliaPumpLabel;
|
||||
//紫外线
|
||||
|
||||
@property(nonatomic,strong) UIButton *keliaUltravioletBtn;
|
||||
//@property(nonatomic,strong) UILabel *keliaUltravioletLabel;
|
||||
//加热管
|
||||
|
||||
@property(nonatomic,strong) UIButton *keliaJaReBtn;
|
||||
//@property(nonatomic,strong) UILabel *keliaJaReLabel;
|
||||
|
||||
@end
|
||||
+612
@@ -0,0 +1,612 @@
|
||||
//
|
||||
// KeLiAiCenterViewController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/17.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KeLiAiCenterViewController.h"
|
||||
#import "KeLiAiBackMassage.h"
|
||||
#import "KeLiAiBackmassageDataUnity.h"
|
||||
#import "KeLiAiSetViewController.h"
|
||||
#import "KeLiAiLightModel.h"
|
||||
#define KELIAI_ZIWAI 6000
|
||||
#define KELIAI_LIGHT1 6001
|
||||
#define KELIAI_LIGHT2 6002
|
||||
#define KELIAI_PUMP 6003
|
||||
#define KELIAI_JARE 6004
|
||||
#define kPlace ([UIScreen mainScreen].bounds.size.width - btnWid*2) /4
|
||||
#define btnWid 100
|
||||
#import "XuToWenDuPicview.h"
|
||||
|
||||
/**
|
||||
* 四控六定时器
|
||||
*/
|
||||
|
||||
@interface KeLiAiCenterViewController ()<UITableViewDelegate,UITableViewDataSource,UIAlertViewDelegate,MBProgressHUDDelegate>
|
||||
{
|
||||
dispatch_queue_t _keLiAiMainQueue;
|
||||
}
|
||||
|
||||
@property(nonatomic,strong) KeLiAiSetViewController *keLiaAiSetVC;
|
||||
@property(nonatomic,strong) KeLiAiBackMassage * keLiAiBackModel;
|
||||
@property(nonatomic,strong) XuToWenDuPicview *wenduPicview;
|
||||
|
||||
@end
|
||||
|
||||
@implementation KeLiAiCenterViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
_keLiAiBackModel=[[KeLiAiBackMassage alloc] init];
|
||||
[Socketsingleton sharedInstance].communiteDelegate=self;
|
||||
|
||||
_keLiAiMainQueue = dispatch_get_main_queue();
|
||||
|
||||
[self initKeLiAiUI];
|
||||
[self creatFishAnimation];
|
||||
[self.setbackBtn addTarget:self action:@selector(KeLiAiSetBtnAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
UITapGestureRecognizer*tapgestureRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(keLiSetBtnAction:)];
|
||||
[self.setImag addGestureRecognizer:tapgestureRecognizer];
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
-(void)KeLiAiSetBtnAction:(UIButton *)btn{
|
||||
|
||||
KeLiAiBackMassage*backmodel=[[DataCenter defaultDtacenter]valueForKey:@"KeLiAiBackInfo"];
|
||||
if (self.binddeviceArr.count ==0) {
|
||||
|
||||
[self.view makeToast:@"暂未绑定设备"];
|
||||
|
||||
}else{
|
||||
|
||||
if (backmodel) {
|
||||
|
||||
[self pushFourSetvc];
|
||||
|
||||
}else{
|
||||
[self.indicatorView stopAnimating];
|
||||
[self showLableAction:@"设备已离线"];
|
||||
|
||||
//[self.XuTohud hidmyHud];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 设置图片点击事件
|
||||
|
||||
-(void)keLiSetBtnAction:(UIGestureRecognizer *)sender{
|
||||
|
||||
NSLog(@"keliai*******keLiSetBtnAction");
|
||||
|
||||
if (self.binddeviceArr.count ==0) {
|
||||
[self.view makeToast:@"暂未绑定设备"];
|
||||
}else{
|
||||
|
||||
|
||||
// BackmassegeModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:@"FourControlMassgeInfo"];
|
||||
// if (backmodel) {
|
||||
[self pushFourSetvc];
|
||||
// }else{
|
||||
// [self showLableAction:@"设备已离线"];
|
||||
// [self deviceNotOnlineState];
|
||||
// [self.indicatorView stopAnimating];
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)pushFourSetvc{
|
||||
|
||||
_keLiaAiSetVC=[[KeLiAiSetViewController alloc]init];
|
||||
_keLiaAiSetVC.currentdevice=self.currentDevice;
|
||||
[self.navigationController pushViewController:_keLiaAiSetVC animated:YES];
|
||||
//self.navigationBarHidden=NO;
|
||||
|
||||
}
|
||||
|
||||
-(void)creatFishAnimation{
|
||||
|
||||
NSLog(@"keliai*******");
|
||||
|
||||
}
|
||||
|
||||
#pragma mark-初始化按钮
|
||||
|
||||
-(void)initKeLiAiUI{
|
||||
|
||||
NSArray *nameArr=@[ @"PFkilLlight_off",@"PFLight1_off",@"PFLight1_off",@"ChongLang_off",@"JiaReBang_off"];
|
||||
CGFloat btnControlWith = 70;
|
||||
CGFloat btnControlPlace = (kScreenSize.width - 3*btnControlWith )/4;
|
||||
|
||||
for (int i = 0; i < 3; i ++) {
|
||||
|
||||
self.button = [[UIButton alloc] init] ;
|
||||
self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -10 , btnControlWith, btnControlWith +11);
|
||||
|
||||
[self.button setImage:[UIImage imageNamed:nameArr[i]] forState:UIControlStateNormal];
|
||||
//self.button.backgroundColor = [UIColor redColor];
|
||||
self.button.tag=6000+i;
|
||||
[self.button addTarget:self action:@selector(keLiAiBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
|
||||
UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -20 + btnControlWith , btnControlWith, btnControlPlace - 5)];
|
||||
//textLbl.backgroundColor = [UIColor blackColor];
|
||||
textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1];
|
||||
textLbl.textAlignment = NSTextAlignmentCenter;
|
||||
NSArray *arr = @[@"紫外线",@"灯1",@"灯2"];
|
||||
textLbl.text = arr[i];
|
||||
|
||||
textLbl.font = [UIFont boldSystemFontOfSize:14];
|
||||
|
||||
|
||||
|
||||
[self.tableView addSubview:textLbl];
|
||||
[self.tableView addSubview:self.button];
|
||||
|
||||
if (i==0) {
|
||||
|
||||
self.keliaUltravioletBtn = self.button;
|
||||
|
||||
}else if (i==1){
|
||||
|
||||
self.keliaLight1Btn = self.button;
|
||||
|
||||
}else if (i==2){
|
||||
self.keliaLight2Btn = self.button;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CGFloat btnControlPlace1 = (kScreenSize.width - 2*btnControlWith )/3;
|
||||
|
||||
for (int i = 0; i < 2; i ++) {
|
||||
self.button = [[UIButton alloc] init] ;
|
||||
self.button.frame = CGRectMake(btnControlPlace1 +i*(btnControlPlace1 + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -25 , btnControlWith, btnControlWith + 11);
|
||||
|
||||
|
||||
[self.button setImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal];
|
||||
//self.button.backgroundColor = [UIColor blueColor];
|
||||
|
||||
|
||||
self.button.tag= 6003+i;
|
||||
[self.button addTarget:self action:@selector(keLiAiBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace1 +i*(btnControlPlace1 + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -35 + btnControlWith, btnControlWith, btnControlPlace - 5)];
|
||||
//textLbl.backgroundColor = [UIColor blackColor];
|
||||
textLbl.textAlignment = NSTextAlignmentCenter;
|
||||
textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1];
|
||||
NSArray *arr = @[@"水泵",@"加热棒"];
|
||||
textLbl.font = [UIFont boldSystemFontOfSize:14];
|
||||
textLbl.text = arr[i];
|
||||
|
||||
[self.tableView addSubview:textLbl];
|
||||
[self.tableView addSubview:self.button];
|
||||
|
||||
if (i==0) {
|
||||
|
||||
self.keliaPumpBtn = self.button;
|
||||
|
||||
}else if (i==1){
|
||||
|
||||
self.keliaJaReBtn = self.button;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//重置 self.bubble 的 frame
|
||||
CGFloat animViewHeight= kScreenSize.width/4;
|
||||
if (kScreenSize.height==480) {
|
||||
|
||||
self.bubble.frame = CGRectMake((kScreenSize.width -(kScreenSize.width - 2 * kPlace)*2/3)/2, kPlace + 60 , (kScreenSize.width - 2 * kPlace)*2/3, (kScreenSize.width - 2 * kPlace)*2/3);
|
||||
|
||||
|
||||
self.temperature.frame = CGRectMake(30, 70, (kScreenSize.width - 2 * kPlace - 100)*2/3, (kScreenSize.width - 2 * kPlace - 200)*2/3);
|
||||
self.temperature.font = [UIFont fontWithName:@"Avenir Next Condensed" size:46];
|
||||
|
||||
self.dulabel.frame = CGRectMake( (kScreenSize.width - 2 * kPlace - 100)*2/3,74,50, kScreenSize.width - 2 * kPlace - 210);
|
||||
|
||||
|
||||
self.dulabel.font = [UIFont fontWithName:@"Avenir Next Condensed" size:20];
|
||||
|
||||
self.animView.frame= CGRectMake(0, kPlace + 80 + (kScreenSize.width - 2 * kPlace) -animViewHeight/2 - 15-80, kScreenSize.width, animViewHeight);
|
||||
|
||||
self.notOnLineLabel.frame = CGRectMake(40, 60, kScreenSize.width - 2 * kPlace - 100, kScreenSize.width - 2 * kPlace - 200);
|
||||
self.notOnLineLabel .font = [UIFont fontWithName:@"Avenir Next Condensed" size:15];
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
self.temperature.frame = CGRectMake(10, 80, kScreenSize.width - 2 * kPlace - 100, kScreenSize.width - 2 * kPlace - 200);
|
||||
self.temperature.font = [UIFont fontWithName:@"Avenir Next Condensed" size:70];
|
||||
|
||||
|
||||
self.bubble.frame = CGRectMake((kScreenSize.width -(kScreenSize.width - 3 * kPlace ))/2, kPlace + 80 , kScreenSize.width - 3 * kPlace, kScreenSize.width - 3 * kPlace);
|
||||
|
||||
|
||||
self.dulabel.frame = CGRectMake((kScreenSize.width - 2 * kPlace)/3*2 -30 , 90 ,50, kScreenSize.width - 2 * kPlace - 210);
|
||||
self.dulabel.font = [UIFont fontWithName:@"Avenir Next Condensed" size:40];
|
||||
self.animView.frame= CGRectMake(0, kPlace + 40 + (kScreenSize.width - 2 * kPlace) -animViewHeight/2 - 15, kScreenSize.width, animViewHeight);
|
||||
|
||||
CGFloat bubH=kScreenSize.width - 3 * kPlace;
|
||||
|
||||
self.notOnLineLabel.frame = CGRectMake(0,bubH/2-15, bubH, 30);
|
||||
self.notOnLineLabel .font = [UIFont fontWithName:@"Avenir Next Condensed" size:20];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -按钮点击事件
|
||||
|
||||
-(void)keLiAiBtnClick:(UIButton*)btn{
|
||||
|
||||
KeLiAiBackMassage*backmodel=[[DataCenter defaultDtacenter]valueForKey:@"KeLiAiBackInfo"];
|
||||
if (backmodel) {
|
||||
|
||||
}else{
|
||||
[self showLableAction:@"设备已离线"];
|
||||
}
|
||||
|
||||
|
||||
KeLiAiLightModel * lightModel=[[KeLiAiLightModel alloc] init];
|
||||
lightModel.sendmacId =self.currentDevice.macAddress;
|
||||
lightModel.resavemacId = self.currentDevice.macAddress;
|
||||
|
||||
NSString*switchString1=lightModel.description;
|
||||
|
||||
if (btn.selected) {//开
|
||||
lightModel.switchBtn=@"00";
|
||||
btn.selected=NO;
|
||||
|
||||
}else {// 关
|
||||
lightModel.switchBtn=@"01";
|
||||
btn.selected=YES;
|
||||
}
|
||||
lightModel.crc16Str=@"0000";// CRC16验证码
|
||||
switch (btn.tag) {
|
||||
|
||||
case KELIAI_ZIWAI:
|
||||
{
|
||||
|
||||
|
||||
btn.userInteractionEnabled=YES;
|
||||
[btn setImage:[UIImage imageNamed:@"PFkilLlight_on.png"] forState:UIControlStateSelected];
|
||||
lightModel.lightNumber =@"03";
|
||||
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightModel.lightNumber,lightModel.switchBtn,lightModel.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
if ([Socketsingleton sharedInstance].clientSocket.isConnected) {
|
||||
//soket 未断开时显示
|
||||
[self creatkeliindicaterView];
|
||||
[self.myhud myhudstart];
|
||||
|
||||
}
|
||||
|
||||
if ([lightModel.switchBtn isEqualToString:@"00"]) {
|
||||
btn.selected=YES;
|
||||
}else{
|
||||
btn.selected=NO;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case KELIAI_LIGHT1:
|
||||
{
|
||||
|
||||
btn.userInteractionEnabled=YES;
|
||||
[btn setImage:[UIImage imageNamed:@"PFLight1_on.png"] forState:UIControlStateSelected];
|
||||
lightModel.lightNumber =@"01";// 01 --灯1
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightModel.lightNumber,lightModel.switchBtn,lightModel.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[ [Socketsingleton sharedInstance].clientSocket writeData:manulData withTimeout:-1 tag:0];
|
||||
[[Socketsingleton sharedInstance].clientSocket readDataWithTimeout:-1 tag:0];
|
||||
|
||||
if ([Socketsingleton sharedInstance].clientSocket.isConnected) {
|
||||
//soket 未断开时显示
|
||||
[self creatkeliindicaterView];
|
||||
[self.myhud myhudstart];
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ([lightModel.switchBtn isEqualToString:@"00"]) {
|
||||
btn.selected=YES;
|
||||
}else{
|
||||
btn.selected=NO;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case KELIAI_LIGHT2:
|
||||
|
||||
{
|
||||
|
||||
btn.userInteractionEnabled=YES;
|
||||
[btn setImage:[UIImage imageNamed:@"PFLight1_on.png"] forState:UIControlStateSelected];
|
||||
lightModel.lightNumber=@"02";//
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightModel.lightNumber,lightModel.switchBtn,lightModel.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
|
||||
if ([Socketsingleton sharedInstance].clientSocket.isConnected) {
|
||||
//soket 未断开时显示
|
||||
[self creatkeliindicaterView];
|
||||
[self.myhud myhudstart];
|
||||
|
||||
}
|
||||
|
||||
if ([lightModel.switchBtn isEqualToString:@"00"]) {
|
||||
btn.selected=YES;
|
||||
}else{
|
||||
btn.selected=NO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case KELIAI_PUMP:
|
||||
{
|
||||
|
||||
btn.userInteractionEnabled=YES;
|
||||
[btn setImage:[UIImage imageNamed:@"ChongLang_on.png"] forState:UIControlStateNormal];
|
||||
lightModel.lightNumber=@"04";//
|
||||
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightModel.lightNumber,lightModel.switchBtn,lightModel.crc16Str];
|
||||
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
if ([Socketsingleton sharedInstance].clientSocket.isConnected) {
|
||||
//soket 未断开时显示
|
||||
[self creatkeliindicaterView];
|
||||
[self.myhud myhudstart];
|
||||
|
||||
}
|
||||
if ([lightModel.switchBtn isEqualToString:@"00"]) {
|
||||
btn.selected=YES;
|
||||
}else{
|
||||
btn.selected=NO;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case KELIAI_JARE:
|
||||
|
||||
{
|
||||
|
||||
if (backmodel) {
|
||||
_wenduPicview=[[XuToWenDuPicview alloc] init];
|
||||
_wenduPicview.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height);
|
||||
[_wenduPicview.sureBtn addTarget:self action:@selector(sureBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view.window addSubview:_wenduPicview];
|
||||
|
||||
[self keLiAiJiaReMianQue];
|
||||
}else{
|
||||
|
||||
[self showLableAction:@"设备已离线"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//加热温度选择
|
||||
-(void)sureBtnClick:(UIButton *)btn{
|
||||
|
||||
NSLog(@"%@******** _wenduPicview.picViewResultString",_wenduPicview.picViewResultString);
|
||||
if (_wenduPicview.picViewResultString ==nil) {
|
||||
|
||||
[_wenduPicview removeFromSuperview];
|
||||
|
||||
}else{
|
||||
|
||||
JiaReWenDuModel *model=[[JiaReWenDuModel alloc] init];
|
||||
model.resavemacId = self.currentDevice.macAddress;
|
||||
model.sendmacId = self.currentDevice.macAddress;
|
||||
|
||||
int intlowString = [_wenduPicview.picViewResultString intValue];
|
||||
|
||||
int newIntlowString=intlowString*10;
|
||||
|
||||
NSLog(@"%d******** newIntlowString",newIntlowString);
|
||||
// 转四位16进制
|
||||
model.JiaReWenDu=[dataContorl tpIntStringToFourHex:newIntlowString];
|
||||
|
||||
model.crc16Code =@"0000";
|
||||
|
||||
|
||||
NSString * hexstring=[NSString stringWithFormat:@"%@%@%@",model.description,model.JiaReWenDu,model.crc16Code];
|
||||
NSData*data=[dataContorl stringToHexData:hexstring];
|
||||
|
||||
[ [Socketsingleton sharedInstance] soketWriteData:data];
|
||||
|
||||
}
|
||||
|
||||
[_wenduPicview removeFromSuperview];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)keLiAiJiaReMianQue{
|
||||
|
||||
KeLiAiBackMassage*backmodel=[[DataCenter defaultDtacenter]valueForKey:@"KeLiAiBackInfo"];
|
||||
UInt64 mac=[dataContorl hexToTen:backmodel.heatTemperature];
|
||||
NSLog(@"%llu",mac);
|
||||
|
||||
//float TPlabel=mac/10+(mac%10)*0.1;
|
||||
float TPlabel=mac/10;
|
||||
int temp= (int)(TPlabel+0.5);
|
||||
|
||||
NSString *stringFloat = [NSString stringWithFormat:@"%d",temp];
|
||||
NSLog(@"%@",stringFloat);
|
||||
|
||||
|
||||
NSArray*wenDuArr=[_wenduPicview.picArr objectAtIndex:0];
|
||||
|
||||
dispatch_async(_keLiAiMainQueue, ^{
|
||||
for (NSInteger i=0; i<wenDuArr.count; i++) {
|
||||
|
||||
|
||||
NSString*picString=wenDuArr[i];
|
||||
|
||||
if ([picString isEqualToString:stringFloat ] ) {
|
||||
|
||||
[_wenduPicview.pic selectRow:i inComponent:0 animated:NO];
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 登陆成功后收到服务端的回执之后,调用的代理方法
|
||||
-(void)socketDidGetBackmsgData:(NSData *)data onsoket:(AsyncSocket *)sock{
|
||||
|
||||
|
||||
//NSString*string1=[dataContorl dataToHexString:data];
|
||||
|
||||
[self.indicatorView stopAnimating];
|
||||
self.temperature.hidden=NO;
|
||||
//设备在线显示与设备离线相对应
|
||||
self.dulabel.hidden=NO;
|
||||
//设备在线显示与设备离线相对应 收到返回数据改变显示状态
|
||||
self.notOnLineLabel.hidden = YES;
|
||||
self.temperaturebackImg.hidden=NO;
|
||||
[self.myhud hidmyHud];
|
||||
if (_keLiaAiSetVC.indicatorView) {
|
||||
[_keLiaAiSetVC.indicatorView stopAnimating];
|
||||
}
|
||||
|
||||
|
||||
//存储
|
||||
|
||||
[KeLiAiBackmassageDataUnity readSoketDataWithBaackMassgModel:_keLiAiBackModel addWithBackData:data];
|
||||
|
||||
// 温度 等状态
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[KeLiAiBackmassageDataUnity setTemperaturelabel:self.temperature addbubleImge:self.bubble WithBackData:data addWithBackMassageModel:_keLiAiBackModel addWithTableview:self.tableView];
|
||||
[KeLiAiBackmassageDataUnity resetKeLiAiButtonState:_keliaLight1Btn addlight2:_keliaLight2Btn addultravioletRay:_keliaUltravioletBtn addWaterPump:_keliaPumpBtn addJiaRe:_keliaJaReBtn withBackModel:_keLiAiBackModel];
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 刷新设置界面
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
_keLiaAiSetVC.timeArr= [KeLiAiBackmassageDataUnity refreshKeLiAiTimerAddTemperatureWithBackMassageModel:_keLiAiBackModel];
|
||||
[_keLiaAiSetVC.tableView reloadData];
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
|
||||
static NSString *CELL =@"cell";
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CELL];
|
||||
if (cell == nil) {
|
||||
|
||||
cell = [[UITableViewCell alloc ]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CELL];
|
||||
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(void)creatkeliindicaterView{
|
||||
// _HUD=[MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
// _HUD.delegate=self;
|
||||
|
||||
// //
|
||||
// _HUD.dimBackground=YES;
|
||||
// _HUD.backgroundColor=[UIColor clearColor];
|
||||
// [_HUD hide:YES afterDelay:10.0];
|
||||
|
||||
self.myhud=[[MyHud alloc]init];
|
||||
|
||||
self.myhud.frame=CGRectMake(0, kScreenSize.height/3, kScreenSize.width,kScreenSize.height*2/3 );
|
||||
|
||||
[self.myhud myhudtimeOut];
|
||||
//self.XuTohud.backgroundColor=[UIColor redColor];
|
||||
|
||||
[self.view addSubview:self.myhud];
|
||||
|
||||
NSLog(@"**********可丽爱加载***********");
|
||||
|
||||
}
|
||||
|
||||
//设备登陆成功
|
||||
|
||||
-(void)ifishDeviceLogInSuccees{
|
||||
self.isconnect=YES;
|
||||
NSLog(@"app登录成功");
|
||||
|
||||
}
|
||||
-(void)ifishDeviceLogInFail{
|
||||
|
||||
[self endRefreshing];
|
||||
[self.indicatorView stopAnimating];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self deviceNotOnlineState];//设备离线
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// KeLiAiLightModel.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/23.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "baseModel.h"
|
||||
|
||||
@interface KeLiAiLightModel : baseModel
|
||||
@property(nonatomic,copy)NSString*lightNumber;
|
||||
@property(nonatomic,copy)NSString*switchBtn;
|
||||
@property(nonatomic,copy)NSString*crc16Str;
|
||||
@end
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// KeLiAiLightModel.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/23.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KeLiAiLightModel.h"
|
||||
|
||||
@implementation KeLiAiLightModel
|
||||
- (NSString *)description
|
||||
{
|
||||
self.messagetype=@"00";
|
||||
self.massagelegth=@"13";
|
||||
self.functionCode=@"03";
|
||||
|
||||
return [NSString stringWithFormat:@"%@%@%@%@%@", self.messagetype,self.functionCode,self.sendmacId,self.resavemacId,self.massagelegth];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// KeLiAiSetViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/5/23.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FatherController.h"
|
||||
#import "Socketsingleton.h"
|
||||
@interface KeLiAiSetViewController : FatherController
|
||||
{
|
||||
BOOL _isHidden;
|
||||
BOOL mySwitchIsOn;
|
||||
|
||||
}
|
||||
|
||||
@property(nonatomic,strong)NSArray*timeArr;
|
||||
@property(nonatomic,strong)NSArray*titleArr;
|
||||
@property(nonatomic)BOOL isAuto;// 自动模式
|
||||
|
||||
@property(nonatomic)UIActivityIndicatorView*indicatorView;
|
||||
//-(void)addAlertView;
|
||||
@property(nonatomic)int percent;
|
||||
@property(nonatomic,strong) DeviceModel* currentdevice;
|
||||
|
||||
|
||||
@end
|
||||
+1183
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user