测试修改

This commit is contained in:
kai60
2020-05-03 21:05:25 +08:00
parent 53f06fcf43
commit 8d0003b9cd
34 changed files with 862 additions and 170 deletions
@@ -237,14 +237,14 @@
UIButton *notbindBtn=[UIButton buttonWithType:UIButtonTypeCustom];
NSString *title=@"您暂无可用的水族箱,前往绑定。";
NSString *title=@"您暂无可用的水族箱或宠物笼,前往绑定。";
[notbindBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:title];
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:8];
[paragraphStyle setLineSpacing:12];
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [title length])];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:0 green:170.0/255.0 blue:218.0/255.0 alpha:1] range:NSMakeRange(9,5)];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:0 green:170.0/255.0 blue:218.0/255.0 alpha:1] range:NSMakeRange(13,5)];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(0,10)];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange([title length]-1,1)];
[notbindBtn setAttributedTitle:attributedString forState:UIControlStateNormal];
@@ -307,7 +307,7 @@
//[headerView setBackgroundColor:XBGAlpha];
[headerView setBackgroundColor:RGB(242, 242, 242)];
UILabel *readLabel=[[UILabel alloc] init ];
readLabel.text = @"请选择一个水族箱,和摄像头建立关系";
readLabel.text = @"请选择一个水族箱或宠物笼,和摄像头建立关系";
NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:readLabel.text ];
@@ -618,7 +618,11 @@
return 3 + 5;
} else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]){
return 3 + self.device.controlAmount.integerValue + 1;
}else {
}
else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
return 3 + self.device.controlAmount.integerValue + 1;
}
else {
if (self.device.controlAmount.integerValue ==5) {
@@ -708,7 +712,32 @@
if (!cell || [cell.templabel.text containsString:@"kwh"]) {
return;
}
UInt64 mac = [dataContorl hexToTen:_xuanduoBack.electricity];
Xuanduo2Model*model=_xuanduoBack;
UInt64 mac = [dataContorl hexToTen:model.electricity];
NSString *stringTemp = [NSString stringWithFormat:@"%llukwh",mac/10.0];
cell.templabel.font = [UIFont systemFontOfSize:37];
cell.templabel.textColor = RGB(253, 188, 63);
[cell.templabel setAttributedText:[NSString ls_changeFontAndColor:[UIFont systemFontOfSize:17] Color:nil TotalString:stringTemp SubStringArray:@[@"kwh"]]];
if (!_switchTimer) {
_switchTimer = [NSTimer timerWithTimeInterval:3.0 target:self selector:@selector(changeTemp) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_switchTimer forMode:NSRunLoopCommonModes];
}
}else if(indexPath.row == 2) {
[self.MonitorBottomDelegate didselectXuanduo2SetttngWithData:self.device andBackModel:_xuanduoBack];
}
}
else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
if (!_xuanduoBack) {
[self makeToast:@"暂未连接"];
return;
}
if (indexPath.row == 1) {
FishControlSecondCell *cell = [self.collectionView viewWithTag:ktempTag];
if (!cell || [cell.templabel.text containsString:@"kwh"]) {
return;
}
Xuanduo3fModel*model=_xuanduoBack;
UInt64 mac = [dataContorl hexToTen:model.temperature];
NSString *stringTemp = [NSString stringWithFormat:@"%llukwh",mac/10.0];
cell.templabel.font = [UIFont systemFontOfSize:37];
cell.templabel.textColor = RGB(253, 188, 63);
@@ -925,7 +954,7 @@
}
[self makeToastActivity:CSToastPositionCenter];
}else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]){
}else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]||[self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
// 新绚多
if (!_xuanduoBack) {
[self makeToast:@"暂未连接"];
@@ -1118,10 +1147,17 @@
if (!cell) {
return;
}
UInt64 mac = [dataContorl hexToTen:_xuanduoBack.waterTemperature];
NSLog(@"%llu",mac);
//float TPlabel=mac/10+(mac%10)*0.1;
float temp = mac/10.0;
UInt64 mac = 0;
NSLog(@"%llu",mac);
if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
Xuanduo2Model*model=(Xuanduo2Model*)_xuanduoBack;
mac=[dataContorl hexToTen:model.waterTemperature];
}
else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
Xuanduo3fModel*model=(Xuanduo3fModel*)_xuanduoBack;
mac=[dataContorl hexToTen:model.temperature];
} float temp = mac/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f",temp];
[cell setTemWith:stringTemp];
}
@@ -1243,7 +1279,7 @@
[cell setSongNuoBDControBtnImg:self.btnImgArr addArr:self.btnOnImgArr atIndex:indexPath addBackModel:_songNuoBDBack];
}else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]){
}else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]||[self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
if (!_xuanduoBack) {
cell.controBtnImg.image = self.btnImgArr[indexPath.row - 3];
[self makeToast:@"连接设备中..."];
@@ -1487,7 +1523,21 @@
[UIImage imageNamed:@"shajun_selected"],
[UIImage imageNamed:@"huli_selected"],
[UIImage imageNamed:@"jiare_selected"]];
}else{
}
else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
self.btnNameArr = @[@"照明",@"换气",@"杀菌",@"恒温"];
self.btnImgArr = @[[UIImage imageNamed:@"照明关"],
[UIImage imageNamed:@"换气关"],
[UIImage imageNamed:@"杀菌关"],
[UIImage imageNamed:@"恒温关"]];
self.btnOnImgArr = @[[UIImage imageNamed:@"照明开"],
[UIImage imageNamed:@"换气开"],
[UIImage imageNamed:@"杀菌开"],
[UIImage imageNamed:@"恒温开"]];
}
else{
int controlAmount=[self.device.controlAmount intValue];
@@ -1802,7 +1852,16 @@
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:DECICE_TYPE_XUANDUO2F];
self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO2F];
[self.collectionView reloadData];
}else{
}else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
// 新绚多
if (!_xuanduoBack) {
_xuanduoBack = [[Xuanduo3fModel alloc] init];
}
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:self.device.type];
self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO3F];
[self.collectionView reloadData];
}
else{
int controlAmount=[devicemoel.controlAmount intValue];