测试修改

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
@@ -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);