杀菌倒计时,恒温温度设定修改

This commit is contained in:
kai60
2020-05-16 14:51:19 +08:00
parent b11f6aaced
commit 9b266aea7b
13 changed files with 125 additions and 64 deletions
@@ -128,6 +128,17 @@
// 杀菌
Xuanduo3fModel*backModel=model;
NSString *stateString1 = [backModel.uvLamp substringWithRange:NSMakeRange(2, 2)];
UInt64 mac1=[dataContorl hexToTen:backModel.vuPHstatus];
//float TPlabel=mac/10+(mac%10)*0.1;
NSString *lasttime = [NSString stringWithFormat:@"%lld",mac1];
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];
UIImage*uvsel=[UIImage imageNamed:@"杀菌开"];
uvsel=[uvsel imageWaterMarkWithString:lasttime rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:25]}];
[light1Btn setImage:uvsel forState:UIControlStateSelected];
if ([stateString1 isEqualToString:@"01"]) {
light1Btn.selected = YES;
}else{
@@ -148,7 +159,19 @@
waterLightBtn.selected = NO;
}
// 恒温
UInt64 mac=[dataContorl hexToTen:backModel.heatingTemperature];
//float TPlabel=mac/10+(mac%10)*0.1;
float temp = mac/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp];
UIImage*imageTempNomal=[UIImage imageNamed:@"恒温关"];
imageTempNomal=[imageTempNomal imageWaterMarkWithString:stringTemp rect:CGRectMake(130, 60, 80, 80) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:25]}];
[light2Btn setImage:imageTempNomal forState:UIControlStateNormal];
UIImage*imageTempsel=[UIImage imageNamed:@"恒温开"];
imageTempsel=[imageTempsel imageWaterMarkWithString:stringTemp rect:CGRectMake(130, 60, 80, 80) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:25]}];
[light2Btn setImage:imageTempsel forState:UIControlStateSelected];
NSString *stateString4 = [backModel.constTmep substringWithRange:NSMakeRange(2, 2)];
if ([stateString4 isEqualToString:@"01"]) {
light2Btn.selected = YES;
@@ -156,18 +179,6 @@
light2Btn.selected = NO;
}
UInt64 mac=[dataContorl hexToTen:backModel.heatingTemperature];
//float TPlabel=mac/10+(mac%10)*0.1;
float temp = mac/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp];
UIImage*imageTempNomal=[UIImage imageNamed:@"恒温关"];
imageTempNomal=[imageTempNomal imageWaterMarkWithString:stringTemp rect:CGRectMake(130, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}];
[light2Btn setImage:imageTempNomal forState:UIControlStateNormal];
UIImage*imageTempsel=[UIImage imageNamed:@"恒温开"];
imageTempsel=[imageTempNomal imageWaterMarkWithString:stringTemp rect:CGRectMake(130, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}];
[light2Btn setImage:imageTempsel forState:UIControlStateSelected];
@@ -1273,7 +1273,7 @@ static NSString *setTimerflag = @"SetTimerCell";
baseModel*tempModel=[[baseModel alloc]init];
tempModel.sendmacId =self.currentdevice.macAddress;
tempModel.resavemacId =self.currentdevice.macAddress;
tempModel.functionCode=@"14";
tempModel.functionCode=@"0e";
tempModel.massagelegth=@"13";
@@ -276,18 +276,18 @@
[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
@@ -875,8 +875,15 @@
[para setValue:priId forKey:@"priId.deviceId"];
[para setValue:userId forKey:@"priId.userId"];
NSString*string=[NSString stringWithFormat:@"%@/api/user/deleteDeviceUser.do",JIEKOUPORT];
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) {
string=[NSString stringWithFormat:@"%@/api/user/deletePetDeviceUser.do",JIEKOUPORT];
[para removeAllObjects];
para[@"userId"]=userId;
para[@"deviceId"]=priId;
}
// __weak typeof (self)weakSelf=self;
[mannager POST:kDeleteDeviceUser parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) {
[mannager POST:string parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) {
if (responseObject) {
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
NSLog(@"result:%@",resultDic[@"result"]);