杀菌倒计时和摄像头分享
This commit is contained in:
parent
22e170a66f
commit
ee657760c4
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]];
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue