From 196f47005e28866027beeb0d7b5bfe7053630e16 Mon Sep 17 00:00:00 2001 From: kai60 Date: Sun, 28 Jun 2020 18:07:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E7=B3=BB=E6=88=91=E4=BB=AC=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E4=BF=AE=E6=94=B9=E5=92=8C=E5=85=B3=E8=81=94=E5=AE=A0?= =?UTF-8?q?=E7=89=A9=E7=AC=BC=E7=9A=84=E8=AE=BE=E7=BD=AE=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 10244 -> 10244 bytes Ifish.xcodeproj/project.pbxproj | 4 +- .../IfishConnectUsViewController.m | 28 +++- .../BootomViewSoketBackMasgConreol.m | 139 +++++++++--------- .../yooseFishTankView/MonitorBootmView.m | 76 +++++++++- .../FishControlFourthCell.h | 1 + .../FishControlFourthCell.m | 12 ++ 7 files changed, 178 insertions(+), 82 deletions(-) diff --git a/.DS_Store b/.DS_Store index 038f18114958011b92137c07304efddab7205f87..945d18fa03b0e6a761eda68b704e6f179bdc04ae 100644 GIT binary patch delta 45 mcmZn(XbIRLEXwppaI(9o(qv5`UMAHCo83gu@?!|?V*&t9410) + { + fontSize=18; + } + else if (self.view.frame.size.width>370) + { + fontSize=15; + } + else + { + fontSize=12; + } + [attributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:fontSize] range:NSMakeRange(0, attributedString.length)]; + [attributedString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:fontSize] range:[[attributedString string] rangeOfString:@"http://u.eqxiu.com/s/KmmVl87l"]]; [attributedString addAttribute:NSLinkAttributeName value:@"tel://18667812003" range:[[attributedString string] rangeOfString:@"18667812003"]]; @@ -87,7 +107,7 @@ _textView.delegate=self; _textView.editable=NO; -_textView.scrollEnabled = NO; +_textView.scrollEnabled = YES; } - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange { diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.m index 5e33a69..6b0a4ed 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/BootomViewSoketBackMasgConreol.m @@ -31,7 +31,7 @@ }else if (str.length == IFISH_BACKMASGTYAP57){ //两空四定时器 返回57 字节时 - str=[str substringWithRange:NSMakeRange(88,IFISH_TEMPERATURE_BYTE2)]; + str=[str substringWithRange:NSMakeRange(88,IFISH_TEMPERATURE_BYTE2)]; }else if (str.length == IFISH_BACKMASGTYAP57){ //零控 @@ -85,7 +85,7 @@ }else if ([type isEqualToString:DECICE_TYPE_RUSUN2A]){ //睿芯 86 字节 str=[str substringWithRange:NSMakeRange(148,IFISH_TEMPERATURE_BYTE2)]; - + }else if ([type isEqualToString:DECICE_TYPE_RUIMEI]){ //瑞美 str=[str substringWithRange:NSMakeRange(148,IFISH_TEMPERATURE_BYTE2)]; @@ -202,7 +202,7 @@ NSData*manulData=[dataContorl stringToHexData:switchString2]; [[Socketsingleton sharedInstance] soketWriteData:manulData]; - + } +(void)TwoControlCommandSelectorWithBackModel57:(TwoControlBackmsgmodel *)model @@ -250,10 +250,10 @@ +(void)XuToControlCommandSelectorWithBackModel73:(XutoBackMsgModel *)model atindexPath:(NSIndexPath *) indexPath{ - NSInteger index= indexPath.row - 3; - manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init]; - [[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel]; - NSString*switchString=manulModel.description; + NSInteger index= indexPath.row - 3; + manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init]; + [[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel]; + NSString*switchString=manulModel.description; if (index == 0) { @@ -311,37 +311,37 @@ indexPath{ }else if (index == 4){ //水泵加热绷 设置代理 在p2p 视频界面实现 -// manulModel.lightNumber = @"05"; -// -// if([[model.waterpump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) -// { -// manulModel.switchBtn = @"01"; -// -// }else{ -// -// manulModel.switchBtn = @"00"; -// } + // manulModel.lightNumber = @"05"; + // + // if([[model.waterpump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) + // { + // manulModel.switchBtn = @"01"; + // + // }else{ + // + // manulModel.switchBtn = @"00"; + // } }else if (index == 5){ -// manulModel.lightNumber = @"06"; -// //只显示不可操控 -// if([[model.heatStickState substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) -// { -// manulModel.switchBtn = @"01"; -// -// }else{ -// -// manulModel.switchBtn = @"00"; -// } + // manulModel.lightNumber = @"06"; + // //只显示不可操控 + // if([[model.heatStickState substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) + // { + // manulModel.switchBtn = @"01"; + // + // }else{ + // + // manulModel.switchBtn = @"00"; + // } return; } - + manulModel.crc16Str = @"0000"; NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str]; NSData*manulData=[dataContorl stringToHexData:switchString2]; @@ -521,22 +521,22 @@ indexPath{ }else if (index == 7){ //加热棒 -// if([[model.jiaReBtn substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) -// { -// manulModel.switchBtn = @"01"; -// -// }else{ -// -// manulModel.switchBtn = @"00"; -// } -// -// manulModel.lightNumber = @"08"; + // if([[model.jiaReBtn substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) + // { + // manulModel.switchBtn = @"01"; + // + // }else{ + // + // manulModel.switchBtn = @"00"; + // } + // + // manulModel.lightNumber = @"08"; return; } - - + + manulModel.crc16Str = @"0000"; NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str]; NSData*manulData=[dataContorl stringToHexData:switchString2]; @@ -674,7 +674,7 @@ indexPath{ NSData*manulData=[dataContorl stringToHexData:switchString2]; [[Socketsingleton sharedInstance] soketWriteData:manulData]; - + } +(void)RusunCommandSelectorWithBackMode168:(RunSun84Protocol *)model atindexPath:(NSIndexPath *)indexPath @@ -722,7 +722,7 @@ indexPath{ manulModel.switchBtn = @"00"; } - + }else if (index == 3){ @@ -752,7 +752,7 @@ indexPath{ guidengModel.onOff= @"00"; } - + NSString* guidengOrder=[NSString stringWithFormat:@"%@%@%@",guidengModel.description,guidengModel.onOff,guidengModel.crc16Str]; NSData*guidengData=[dataContorl stringToHexData:guidengOrder]; [[Socketsingleton sharedInstance] soketWriteData:guidengData]; @@ -901,7 +901,7 @@ indexPath{ manulModel.switchBtn = @"01"; }else{ - + manulModel.switchBtn = @"00"; } @@ -933,13 +933,14 @@ indexPath { NSString*state; - if ([model isKindOfClass:[Xuanduo3fModel class]]) - { - state=model.gasPump; - manulModel.lightNumber=@"01"; - } - else{ - state= model.waterPump; + if ([model isKindOfClass:[Xuanduo3fModel class]]) + { + Xuanduo3fModel*xuan3Model=(Xuanduo3fModel*)model; + state=xuan3Model.light; + manulModel.lightNumber=@"01"; + } + else{ + state= model.waterPump; } if([[state substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) { @@ -957,7 +958,7 @@ indexPath { { manulModel.lightNumber=@"02"; } - + if([[model.gasPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) { @@ -973,14 +974,14 @@ indexPath { manulModel.lightNumber = @"02"; NSString*state; - if ([model isKindOfClass:[Xuanduo3fModel class]]) - { - state=model.uvLamp; - manulModel.lightNumber=@"03"; - } - else{ - state= model.light1; - } + if ([model isKindOfClass:[Xuanduo3fModel class]]) + { + state=model.uvLamp; + manulModel.lightNumber=@"03"; + } + else{ + state= model.light1; + } if([[state substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) { manulModel.switchBtn = @"01"; @@ -996,15 +997,15 @@ indexPath { manulModel.lightNumber = @"03"; NSString*state; - if ([model isKindOfClass:[Xuanduo3fModel class]]) - { - state=((Xuanduo3fModel*)model).constTmep; - manulModel.lightNumber=@"04"; - } - else{ - state= model.light2; - } - + if ([model isKindOfClass:[Xuanduo3fModel class]]) + { + state=((Xuanduo3fModel*)model).constTmep; + manulModel.lightNumber=@"04"; + } + else{ + state= model.light2; + } + if([[state substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) { manulModel.switchBtn = @"01"; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m index 5a0b2d6..6834d53 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m @@ -31,11 +31,13 @@ #import "RuiMeiCHControl.h" #import "Xuanduo2DataUtility.h" #import "NSString+Add.h" +#import "Xuanduo2TimerModel.h" #define ktempTag 600 @implementation MonitorBootmView { NSTimer *_switchTimer; + XuanduoCycleModel * _cycleModel; } -(id)initWithFrame:(CGRect)frame @@ -960,7 +962,7 @@ [self makeToast:@"暂未连接"]; return; } - if (indexPath.row == 10 || indexPath.row == 3) { + if (indexPath.row == 10 || (indexPath.row == 3&&[self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F])) { //点击加热棒 [self.MonitorBottomDelegate selectXuanduo2Index:indexPath withBackModel:_xuanduoBack]; }else{ @@ -1736,7 +1738,12 @@ -(void)ifishDeviceLogInSuccees{ - + if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + [self readCycleWithNumber:@"03"]; + + + } } @@ -1750,7 +1757,20 @@ } +-(void)readCycleWithNumber:(NSString*)num +{ + baseModel*readModel=[[baseModel alloc]init]; + readModel.sendmacId =self.device.macAddress; + readModel.resavemacId =self.device.macAddress; + readModel.functionCode=@"19"; + readModel.massagelegth=@"12"; + NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,num,@"0000"]; + + NSData*readData=[dataContorl stringToHexData:readString]; + [[Socketsingleton sharedInstance] soketWriteData:readData]; + +} -(void)judgeBackamsgTaypeWith:(DeviceModel *)devicemoel addData:(NSData *)data{ [self hideToastActivity]; @@ -1854,12 +1874,54 @@ [self.collectionView reloadData]; }else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){ // 新绚多 - if (!_xuanduoBack) { - _xuanduoBack = [[Xuanduo3fModel alloc] init]; + NSString*string1=[dataContorl dataToHexString:data]; + + NSString *readTimer = [string1 substringToIndex:4]; + + + + + + + + if ([readTimer isEqualToString:@"0119"]) + { + + _cycleModel=[[XuanduoCycleModel alloc]init]; + [Xuanduo2DataUtility readCycleSocketDataWithBackMsgModel:_cycleModel addWithBackStr:string1 type:self.device.type]; + if (_cycleModel.lastTime.length) + { + UInt64 mac1=[dataContorl hexToTen:_cycleModel.lastTime]; + + //float TPlabel=mac/10+(mac%10)*0.1; + float temp1 = mac1; + NSString *stringTemp = [NSString stringWithFormat:@"%f℃",temp1]; + UIImage*uvNomal=[UIImage imageNamed:@"杀菌关"]; + uvNomal=[uvNomal imageWaterMarkWithString:stringTemp rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}]; + + + UIImage*uvsel=[UIImage imageNamed:@"杀菌开"]; + uvsel=[uvsel imageWaterMarkWithString:stringTemp rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}]; + + + } } - [Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:self.device.type]; - self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO3F]; - [self.collectionView reloadData]; + else + { + if (!_xuanduoBack) { + _xuanduoBack = [[Xuanduo3fModel alloc] init]; + } + [Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:self.device.type]; + self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO3F]; + Xuanduo3fModel*model=_xuanduoBack; + //没开的时候取设置的时间 + if ([model.vuPHstatus isEqualToString:@"0000"]&&_cycleModel.lastTime) + { + model.vuPHstatus=_cycleModel.lastTime; + } + [self.collectionView reloadData]; + } + } else{ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.h index 225f2aa..c457ece 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.h @@ -18,6 +18,7 @@ #import "RunSun84Protocol.h" #import "RuiMeiProtocolModel.h" #import "Xuanduo2Model.h" +#import "UIImage+WaterMark.h" @interface FishControlFourthCell : UICollectionViewCell diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.m index e769328..fc7e3cd 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/YseeCollectionCell/FishControlFourthCell.m @@ -334,12 +334,24 @@ NSString*stateString=[xuan3fmodel.uvLamp substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)]; [self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr addOffArr:imgOffArr]; + UInt64 mac1=[dataContorl hexToTen:xuan3fmodel.vuPHstatus]; + + //float TPlabel=mac/10+(mac%10)*0.1; + NSString *lasttime = [NSString stringWithFormat:@"%lld",mac1]; + self.controBtnImg.image=[self.controBtnImg.image imageWaterMarkWithString:lasttime rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:25]}]; }else if (index == 3){ NSString*stateString=[xuan3fmodel.constTmep substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)]; [self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr addOffArr:imgOffArr]; + UInt64 mac=[dataContorl hexToTen:xuan3fmodel.heatingTemperature]; + + //float TPlabel=mac/10+(mac%10)*0.1; + float temp = mac/10.0; + NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp]; + + self.controBtnImg.image=[ self.controBtnImg.image imageWaterMarkWithString:stringTemp rect:CGRectMake(130, 60, 80, 80) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:25]}]; }else {