测试修改
This commit is contained in:
+115
-34
@@ -64,6 +64,7 @@
|
||||
#import "RuiMeiSetViewController.h"
|
||||
#import "Xuanduo2SettingController.h"
|
||||
#import "MessageAlertView.h"
|
||||
#import "CreatErWeiMaController.h"
|
||||
//上部分视频封装 下部分分段控制器 封装 (下一步代码优化)
|
||||
@interface IfishP2PMonitorController ()<HaveHotCoolWenDuPicviewDelegate,GWP2PVideoPlayerProtocol>
|
||||
{
|
||||
@@ -347,12 +348,13 @@ Strong UIImage *screenShotImage;//截图
|
||||
});
|
||||
|
||||
} ready:^{
|
||||
[self.view makeToast:@"连接成功"];
|
||||
|
||||
//呼叫成功操作
|
||||
NSLog(@"连接摄像头成功 当前所在线程为%@",[NSThread currentThread]);
|
||||
//隐藏呼叫中的UI
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
//隐藏旋转按钮
|
||||
[self.view makeToast:@"连接成功"];
|
||||
[weakSelf hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO];
|
||||
//
|
||||
[weakSelf didHiddenMonitorUIWith:YES];
|
||||
@@ -583,7 +585,47 @@ Strong UIImage *screenShotImage;//截图
|
||||
CGFloat controlSegY= CGRectGetMaxY(self.canvasView.frame);
|
||||
IifshSegmentView *seg = [[IifshSegmentView alloc] initWithFrame:CGRectMake(0.0, controlSegY,kScreenSize.width, segMentH)];
|
||||
seg.segDelegate = self;
|
||||
[seg initleftTitle:@"摄像头" addRightTitle:@"水族箱" isSelectStyle:YES];
|
||||
NSString*title=@"水族箱";
|
||||
NSArray*devicearray=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
|
||||
|
||||
BOOL contain3F=NO;
|
||||
BOOL contain2F=NO;
|
||||
|
||||
for (DeviceModel*model in devicearray)
|
||||
{
|
||||
if ([model.type isEqualToString:DECICE_TYPE_XUANDUO2F])
|
||||
{
|
||||
contain2F=YES;
|
||||
}
|
||||
if ([model.type isEqualToString:DECICE_TYPE_XUANDUO3F])
|
||||
{
|
||||
contain3F=YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (contain2F)
|
||||
{
|
||||
if (contain3F)
|
||||
{
|
||||
title=@"设备";
|
||||
}
|
||||
else
|
||||
{
|
||||
title=@"水族箱";
|
||||
}
|
||||
}
|
||||
else if(contain3F)
|
||||
{
|
||||
title=@"宠物笼";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
title=@"水族城";
|
||||
}
|
||||
|
||||
[seg initleftTitle:@"摄像头" addRightTitle:title isSelectStyle:YES];
|
||||
self.segControl = seg;
|
||||
[self.view addSubview:seg];
|
||||
|
||||
@@ -629,6 +671,11 @@ Strong UIImage *screenShotImage;//截图
|
||||
[weakSelf delectCamera];
|
||||
|
||||
}else if (tag == 2){
|
||||
//删除摄像头
|
||||
[weakSelf fenXiangSheBei];
|
||||
|
||||
}
|
||||
else if (tag == 3){
|
||||
//检查设备更新
|
||||
|
||||
if ([weakSelf.player isPlaying]) {
|
||||
@@ -665,8 +712,8 @@ Strong UIImage *screenShotImage;//截图
|
||||
[self.view addSubview:self.popView];
|
||||
NSArray *titleImgs =nil;
|
||||
NSArray *titles=nil;
|
||||
titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate"];
|
||||
titles=@[@"修改名称",@"删除设备",@"设备升级"];
|
||||
titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"Ifish_share_device",@"equipment_icon_equipmentupdate"];
|
||||
titles=@[@"修改名称",@"删除设备",@"分享设备",@"设备升级"];
|
||||
[self.popView loadInfoWithTitle:titles Icons:titleImgs];
|
||||
}
|
||||
|
||||
@@ -747,6 +794,15 @@ Strong UIImage *screenShotImage;//截图
|
||||
|
||||
[self presentViewController:ac2 animated:YES completion:nil];
|
||||
}
|
||||
-(void)fenXiangSheBei{
|
||||
|
||||
CreatErWeiMaController*vc=[[CreatErWeiMaController alloc]init];
|
||||
vc.isNewdevice = YES;
|
||||
vc.deviceid=self.contact.cameraId;
|
||||
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
|
||||
}
|
||||
|
||||
-(void)deleteCameraAtRequset{
|
||||
|
||||
@@ -998,14 +1054,14 @@ Strong UIImage *screenShotImage;//截图
|
||||
}else{
|
||||
|
||||
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,4)];
|
||||
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(0,9)];
|
||||
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(0,13)];
|
||||
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange([title length]-1,1)];
|
||||
[notbindBtn setAttributedTitle:attributedString forState:UIControlStateNormal];
|
||||
[notbindBtn sizeToFit];
|
||||
@@ -4216,35 +4272,60 @@ GWP2PCallErrorNotSupport,
|
||||
|
||||
-(void)selectXuanduo2Index:(NSIndexPath *)index withBackModel:(Xuanduo2Model *)backModel{
|
||||
if (backModel) {
|
||||
if (index.row == 3) {
|
||||
//循环泵
|
||||
manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init];
|
||||
[[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel];
|
||||
NSString*switchString=manulModel.description;
|
||||
manulModel.lightNumber = @"04";
|
||||
if([[backModel.waterPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
|
||||
{
|
||||
manulModel.switchBtn = @"01";
|
||||
}else{
|
||||
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"确认关闭循环泵?" preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
|
||||
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||
manulModel.switchBtn = @"00";
|
||||
manulModel.crc16Str = @"0000";
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
}];
|
||||
[alertController addAction:cancelAction];
|
||||
[alertController addAction:sureAction];
|
||||
[self.navigationController presentViewController:alertController animated:YES completion:nil];
|
||||
return;
|
||||
}
|
||||
if (index.row == 3)
|
||||
{
|
||||
if ([backModel isKindOfClass:[Xuanduo2Model class]]) {
|
||||
//循环泵
|
||||
manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init];
|
||||
[[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel];
|
||||
NSString*switchString=manulModel.description;
|
||||
manulModel.lightNumber = @"04";
|
||||
if([[backModel.waterPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
|
||||
{
|
||||
manulModel.switchBtn = @"01";
|
||||
}else{
|
||||
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"确认关闭循环泵?" preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
|
||||
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||
manulModel.switchBtn = @"00";
|
||||
manulModel.crc16Str = @"0000";
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
}];
|
||||
[alertController addAction:cancelAction];
|
||||
[alertController addAction:sureAction];
|
||||
[self.navigationController presentViewController:alertController animated:YES completion:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
manulModel.crc16Str = @"0000";
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
}
|
||||
else
|
||||
{
|
||||
//循环泵
|
||||
Xuanduo3fModel*backModel=backModel; manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init];
|
||||
[[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel];
|
||||
NSString*switchString=manulModel.description;
|
||||
manulModel.lightNumber = @"01";
|
||||
if([[backModel.light substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
|
||||
{
|
||||
manulModel.switchBtn = @"01";
|
||||
}else
|
||||
{
|
||||
manulModel.switchBtn = @"00";
|
||||
}
|
||||
|
||||
|
||||
manulModel.crc16Str = @"0000";
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
|
||||
}
|
||||
}else {
|
||||
_xuanduoPicView=[[HaveHotCoolWenDuPicview alloc] init];
|
||||
_xuanduoPicView.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height);
|
||||
|
||||
+10
-2
@@ -473,10 +473,17 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像
|
||||
[[GWP2PClient sharedClient] setDeviceInitialPassword:self.lastSetPassword withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
NSLog(@"success:%i %@",success,dataDictionary);
|
||||
[self resetPassWord];//初始化密码
|
||||
[self bindCameraDevice];
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self bindCameraDevice];
|
||||
|
||||
});
|
||||
}];
|
||||
}else{//如果已经设置过初始密码,则直接使用
|
||||
[self bindCameraDevice];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self bindCameraDevice];
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -574,6 +581,7 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔,复位摄像
|
||||
contact.contactType = CONTACT_TYPE_UNKNOWN;
|
||||
[[FListManager sharedFList] insert:contact];
|
||||
//设置密码成功后爱鱼奇用户绑定摄像头
|
||||
|
||||
[self ifishUserBindcameraIdBy:self.deviceID];
|
||||
}
|
||||
|
||||
|
||||
+41
-3
@@ -10,6 +10,7 @@
|
||||
#import "IfishDeviceInfo.h"
|
||||
#import "RuSunGuiDeng.h"
|
||||
#import "XuanduoHuliModel.h"
|
||||
#import "xuanduo3fModel.h"
|
||||
@implementation BootomViewSoketBackMasgConreol
|
||||
|
||||
|
||||
@@ -92,6 +93,9 @@
|
||||
}else if ([type isEqualToString:DECICE_TYPE_XUANDUO2F]){
|
||||
str=[str substringWithRange:NSMakeRange(60,IFISH_TEMPERATURE_BYTE2)];
|
||||
}
|
||||
else if ([type isEqualToString:DECICE_TYPE_XUANDUO3F]){
|
||||
str=[str substringWithRange:NSMakeRange(46,IFISH_TEMPERATURE_BYTE2)];
|
||||
}
|
||||
|
||||
UInt64 mac=[dataContorl hexToTen:str];
|
||||
NSLog(@"%llu",mac);
|
||||
@@ -927,7 +931,17 @@ indexPath {
|
||||
if (index == 0) { //循环
|
||||
manulModel.lightNumber = @"04";
|
||||
|
||||
if([[model.waterPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
|
||||
|
||||
NSString*state;
|
||||
if ([model isKindOfClass:[Xuanduo3fModel class]])
|
||||
{
|
||||
state=model.gasPump;
|
||||
manulModel.lightNumber=@"01";
|
||||
}
|
||||
else{
|
||||
state= model.waterPump;
|
||||
}
|
||||
if([[state substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
|
||||
{
|
||||
manulModel.switchBtn = @"01";
|
||||
|
||||
@@ -939,6 +953,11 @@ indexPath {
|
||||
}else if (index == 1){ //增氧
|
||||
|
||||
manulModel.lightNumber = @"01";
|
||||
if ([model isKindOfClass:[Xuanduo3fModel class]])
|
||||
{
|
||||
manulModel.lightNumber=@"02";
|
||||
}
|
||||
|
||||
|
||||
if([[model.gasPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
|
||||
{
|
||||
@@ -953,7 +972,16 @@ indexPath {
|
||||
|
||||
manulModel.lightNumber = @"02";
|
||||
|
||||
if([[model.light1 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
|
||||
NSString*state;
|
||||
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";
|
||||
|
||||
@@ -967,7 +995,17 @@ indexPath {
|
||||
|
||||
manulModel.lightNumber = @"03";
|
||||
|
||||
if([[model.light2 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
|
||||
NSString*state;
|
||||
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";
|
||||
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@
|
||||
@property(nonatomic,strong) RunSun84Protocol *ruSun84Back;
|
||||
@property (nonatomic, strong) RuiMeiProtocolModel *ruiMeiBack;
|
||||
@property(nonatomic,strong) SongNuoBDProtocol *songNuoBDBack;
|
||||
@property(nonatomic,strong) Xuanduo2Model *xuanduoBack;
|
||||
@property(nonatomic,strong) id xuanduoBack;
|
||||
|
||||
|
||||
-(void)setTabViewWithFrame:(CGRect)frame;
|
||||
|
||||
+73
-14
@@ -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];
|
||||
|
||||
|
||||
+10
-2
@@ -29,6 +29,8 @@
|
||||
UIView *hengLine=[[UIView alloc] initWithFrame:CGRectMake(0,self.frame.size.height -1,self.frame.size.width, 1)];
|
||||
hengLine.backgroundColor = shuLine.backgroundColor = JWUIColorFromRGB(0xdddddd);
|
||||
[self addSubview:hengLine];
|
||||
[self bringSubviewToFront:self.factoryIcon];
|
||||
self.factoryIcon.hidden=NO;
|
||||
|
||||
}
|
||||
|
||||
@@ -38,12 +40,18 @@
|
||||
|
||||
-(void)intiFactoryImgWith:(DeviceModel *)devicemodel{
|
||||
|
||||
[self.factoryIcon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetLogUrl,devicemodel.logo]] placeholderImage:[UIImage imageNamed:@""]];
|
||||
|
||||
if (!self.factoryIcon.image) {
|
||||
self.factoryIcon.image = [UIImage imageNamed:@"brandLogo_hold"];
|
||||
}
|
||||
[self.factoryIcon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetLogUrl,devicemodel.logo]] placeholderImage:[UIImage imageNamed:@"brandLogo_hold"]];
|
||||
if (!self.factoryIcon) {
|
||||
self.factoryIcon.image = [UIImage imageNamed:@"greenbtn_big"];
|
||||
}
|
||||
|
||||
|
||||
[self bringSubviewToFront:self.factoryIcon];
|
||||
self.factoryIcon.hidden=NO;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+39
-1
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
#import "FishControlFourthCell.h"
|
||||
#import "xuanduo3fModel.h"
|
||||
|
||||
@implementation FishControlFourthCell
|
||||
- (instancetype)initWithFrame:(CGRect)frame{
|
||||
@@ -258,6 +259,10 @@
|
||||
atIndex:(NSIndexPath *)indexPath
|
||||
addBackModel:(Xuanduo2Model*)model {
|
||||
|
||||
if ([model isKindOfClass:[Xuanduo2Model class]])
|
||||
{
|
||||
|
||||
|
||||
NSInteger index = indexPath.row - 3;
|
||||
if (index == 0) {
|
||||
|
||||
@@ -307,7 +312,40 @@
|
||||
addOffArr:imgOffArr];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if ([model isKindOfClass:[Xuanduo3fModel class]])
|
||||
{
|
||||
|
||||
Xuanduo3fModel*xuan3fmodel=model;
|
||||
NSInteger index = indexPath.row - 3;
|
||||
if (index == 0) {
|
||||
|
||||
NSString*stateString=[xuan3fmodel.light substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
|
||||
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
|
||||
addOffArr:imgOffArr];
|
||||
}else if (index == 1){
|
||||
|
||||
NSString*stateString=[xuan3fmodel.gasPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
|
||||
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
|
||||
addOffArr:imgOffArr];
|
||||
|
||||
}else if (index == 2){
|
||||
|
||||
NSString*stateString=[xuan3fmodel.uvLamp substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
|
||||
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
|
||||
addOffArr:imgOffArr];
|
||||
|
||||
}else if (index == 3){
|
||||
|
||||
NSString*stateString=[xuan3fmodel.constTmep substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
|
||||
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
|
||||
addOffArr:imgOffArr];
|
||||
|
||||
}else
|
||||
{
|
||||
NSLog(@"index=%ld",indexPath.row);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@
|
||||
withdeviceName:(NSString *)nameStr{
|
||||
|
||||
|
||||
self.deviceNameLabel.text = [NSString stringWithFormat:@"水族箱:%@",nameStr];
|
||||
self.deviceNameLabel.text = nameStr;
|
||||
self.deviceNameLabel.textColor = [UIColor blackColor];
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user