From ee657760c445e87ea3a70f59315350f7423ca2ee Mon Sep 17 00:00:00 2001 From: kai60 Date: Sat, 6 Jun 2020 17:47:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=80=E8=8F=8C=E5=80=92=E8=AE=A1=E6=97=B6?= =?UTF-8?q?=E5=92=8C=E6=91=84=E5=83=8F=E5=A4=B4=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 10244 -> 10244 bytes .../XuTo/Xuanduo2DataUtility.m | 4 + .../XuTo/Xuanduo2SettingController.m | 4 +- .../XuTo/Xuanduo2fController.m | 73 ++++++++++++++---- .../设备/IfishDeviceViewController.m | 10 ++- .../YooseeNextConnectViewController.mm | 7 +- .../controllers/erweima/ScanViewController.m | 2 +- 7 files changed, 79 insertions(+), 21 deletions(-) diff --git a/.DS_Store b/.DS_Store index 1dcd696731aa1cf1419143bedd41bdb384028a35..a8fdbcbdd909750f6c6380e65b99a7ce79e6a4e8 100644 GIT binary patch delta 27 jcmZn(XbIR*Bf_kby>s$L5v9qRLcC0>4x2ZKga`uwhgb;C delta 27 jcmZn(XbIR*Bf_k-V%g-4B1)4rg?O2i8#Zqc2@wVWi>nDV diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.m index 076d384..e235583 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.m @@ -132,6 +132,10 @@ //float TPlabel=mac/10+(mac%10)*0.1; NSString *lasttime = [NSString stringWithFormat:@"%lld",mac1]; + if (mac1==0) + { + lasttime=@""; + } UIImage*uvNomal=[UIImage imageNamed:@"杀菌关"]; uvNomal=[uvNomal imageWaterMarkWithString:lasttime rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:25]}]; [light1Btn setImage:uvNomal forState:UIControlStateNormal]; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m index a5eabb6..f23d97a 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m @@ -1319,8 +1319,8 @@ static NSString *setTimerflag = @"SetTimerCell"; int intString = [str intValue]; - - NSString*temp =[dataContorl tpIntStringToFourHex:intString]; + NSString*hex=[dataContorl ToHex:intString]; + NSString*temp =[dataContorl leftAddZero:4 andStr:hex]; _cycleModel.lastTime=temp; NSString*minString=[NSString stringWithFormat:@"%@%@%@%@%@%@",tempModel.description,_cycleModel.lightNumber,_cycleModel.lastTime,_cycleModel.gapTime,_cycleModel.status,@"0000"]; NSLog(@"minstring = %@",minString); diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m index 3eac111..6880a05 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m @@ -67,6 +67,9 @@ @property (weak, nonatomic) IBOutlet UIView *contentView; @property (weak, nonatomic) IBOutlet UIImageView *imageView; @property(nonatomic,strong) XuanduoCycleModel *cycleModel; +@property(nonatomic,assign) NSInteger heartCount; + + @end @@ -77,6 +80,14 @@ [super viewWillAppear:animated]; [Socketsingleton sharedInstance].communiteDelegate = self; self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName :[UIColor blackColor]}; + if ([[Socketsingleton sharedInstance].clientSocket isConnected]&&[self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + + [self readCycleWithNumber:@"03"]; + self.heartCount=0; + + + } } - (void)viewDidLoad { @@ -158,7 +169,8 @@ self.huliLabel.hidden=YES; self.heatLight.hidden=YES; self.jiareLabel.hidden=YES; - + self.heartCount=0; + } } @@ -294,24 +306,52 @@ [Xuanduo2DataUtility readCycleSocketDataWithBackMsgModel:_cycleModel addWithBackStr:string1 type:self.currentDevice.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]}]; -// [self.light1 setImage:uvNomal forState:UIControlStateNormal]; -// -// UIImage*uvsel=[UIImage imageNamed:@"杀菌开"]; -// uvsel=[uvsel imageWaterMarkWithString:stringTemp rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}]; -// [self.light1 setImage:uvsel forState:UIControlStateSelected]; + 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]}]; + [self.light1 setImage:uvNomal forState:UIControlStateNormal]; + + UIImage*uvsel=[UIImage imageNamed:@"杀菌开"]; + uvsel=[uvsel imageWaterMarkWithString:stringTemp rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}]; + [self.light1 setImage:uvsel forState:UIControlStateSelected]; + } } else { [Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentDevice.type]; [self setTemperature]; + if (self.dataModel) + { + self.heartCount++; + } + // + if (self.dataModel&&[self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { + + + Xuanduo3fModel*model=(Xuanduo3fModel*)_dataModel; + NSString *stateString1 = [model.uvLamp substringWithRange:NSMakeRange(2, 2)]; + //关闭或者首次时杀菌取设置的值,之后才是心跳的 + if ([stateString1 isEqualToString:@"00"]||self.heartCount<2) + { + if (_cycleModel.lastTime.length) + { + model.vuPHstatus=_cycleModel.lastTime; + + } + else //未收到设置值不显示 + { + model.vuPHstatus=@"0000"; + + } + } + + + } } @@ -349,7 +389,12 @@ -(void)ifishDeviceLogInSuccees{ - [self readCycleWithNumber:@"03"]; + if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + [self readCycleWithNumber:@"03"]; + self.heartCount=0; + + } } -(void)ifishSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket{ diff --git a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m index f7f07f3..446c299 100644 --- a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m +++ b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m @@ -266,7 +266,11 @@ Assign BOOL isPush; } NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [weakSelf.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone]; - } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + weakSelf.tableView.backgroundColor = RGB(10, 18, 177); + + }); + } [weakSelf endRefreshing]; } failure:^(NSError *err) { [weakSelf endRefreshing]; @@ -459,6 +463,7 @@ Assign BOOL isPush; [weakSelf refreshUI]; + }else{ [weakSelf.view makeToast:@"户数据获取失败"]; @@ -844,6 +849,7 @@ Assign BOOL isPush; [self.tableView reloadData]; [self getUsernameAddImg]; + } -(void)getTotalDeviceArrWith:(NSArray *)deivceArr addCameraArr:(NSArray *)cameraArr; @@ -1668,7 +1674,7 @@ Assign BOOL isPush; //rect.size.height = - offsetY; //self.tabDowloadHoldView.frame = rect; - self.tableView.backgroundColor = RGB(10, 18, 177); + } } diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm index f27493b..1d8bbfc 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm @@ -510,7 +510,7 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 { // if (self.deviceID.length&&![self.linkDict[self.deviceID] boolValue]) {//90秒之后还未连接上,连接超时 - + [[GWP2PDeviceLinker shareInstance] p2pStopSmartLink]; [[GWP2PDeviceLinker shareInstance] p2pStopAPLink]; [self connectNormalView]; if ([[[CommonUtils getSSIDInfo] objectForKey:@"SSID"] isEqualToString:self.wifiName]) @@ -526,6 +526,9 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 else if(!self.deviceID.length) { [self.view makeToast:@"获取设备ID失败"]; + [[GWP2PDeviceLinker shareInstance] p2pStopSmartLink]; + [[GWP2PDeviceLinker shareInstance] p2pStopAPLink]; + [self connectNormalView]; } } -(void)apLinkConnect @@ -546,7 +549,7 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像 { weakSelf.deviceID=deviceId; - // [weakSelf.view makeToast:[NSString stringWithFormat:@"设备即将连接网络,请将手机重新连接到%@",weakSelf.wifiName]]; + [weakSelf.view makeToast:[NSString stringWithFormat:@"设备即将连接网络,请将手机自动重新连接到%@",weakSelf.wifiName]]; } diff --git a/Ifish/controllers/erweima/ScanViewController.m b/Ifish/controllers/erweima/ScanViewController.m index 00eb927..f3ee838 100644 --- a/Ifish/controllers/erweima/ScanViewController.m +++ b/Ifish/controllers/erweima/ScanViewController.m @@ -358,7 +358,7 @@ { url=[NSString stringWithFormat:@"%@/api/user/shareCameraByQrCode.do",JIEKOUPORT]; para=@{ - @"deviceId":deviceId,@"userId":userID + @"cameraId":deviceId,@"userId":userID }; } [AFHttpTool requestWihtMethod:RequestMethodTypePost url:url params:para success:^(id response) {