features:4月新绚多设备适配 & 修复一些已知bug

This commit is contained in:
一只会编程的狮子
2019-05-15 20:24:53 +08:00
parent 4b74588759
commit c586949438
59 changed files with 2912 additions and 130 deletions
@@ -67,6 +67,7 @@
#import "HaveHotCoolWenDuPicview.h"
#import "RuSunLightOrder.h"
#import "RuiMeiSetViewController.h"
#import "Xuanduo2SettingController.h"
//上部分视频封装 下部分分段控制器 封装 (下一步代码优化)
@interface IfishP2PMonitorController ()<HaveHotCoolWenDuPicviewDelegate>
@@ -87,7 +88,7 @@
BOOL _isStop;//是否暂停 用于区分是 暂停按钮 还是 连接失败按钮
dispatch_queue_t _xutoMainQueue;
BOOL _isPushNextView; //是否push下级界面
BOOL _isNewXuanduo; //是新绚多设备
}
@property(nonatomic,strong) SetTimeController*SetTimeVC;
@@ -113,6 +114,8 @@
@property (nonatomic,strong) UILabel *nameTitle;
@property (strong, nonatomic) UIView *shutterView;
@property(nonatomic,strong) HaveHotCoolWenDuPicview *xuanduoPicView;
@end
extern BOOL formLogIn;//连接页面是否来自登录界面
@@ -4316,6 +4319,16 @@
[self.navigationController pushViewController:connectVC animated:YES];
}
-(void)didselectXuanduo2SetttngWithData:(DeviceModel *)dmodel
andBackModel:(Xuanduo2Model *)backmodel {
Xuanduo2SettingController *setVC = [[Xuanduo2SettingController alloc] init];
setVC.currentdevice = dmodel;
setVC.dataModel = backmodel;
usleep(50*1000);
[self.navigationController pushViewController:setVC animated:YES];
}
//炫多
-(void)selectXuToAtIndex:(NSIndexPath*)index withbackModel:(XutoBackMsgModel *)backmodel{
@@ -4625,6 +4638,108 @@
}
-(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;
}
manulModel.crc16Str = @"0000";
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);
[_xuanduoPicView.sureBtn addTarget:self action:@selector(xuanduoSureBtnClick:) forControlEvents:UIControlEventTouchUpInside];
_isNewXuanduo = YES;
[self.view.window addSubview:_xuanduoPicView];
_xuanduoPicView.wenDuPicviewDelegate = self;
NSString *stateStr =nil;
if ([backModel.status isKindOfClass:[NSNull class]]||!backModel.status ) {
backModel.status = @"0000";
}
stateStr = [backModel.status substringWithRange:NSMakeRange(2, 2)];
[_xuanduoPicView initCateBtnSate:stateStr];
[self heatAction:backModel];
}
}
}
- (void)heatAction:(Xuanduo2Model*)model
{
UInt64 mac=[dataContorl hexToTen:model.heatingTemperature];
NSLog(@"%llu",mac);
float TPlabel=mac/10;
int temp= (int)(TPlabel+0.5);
NSString *stringFloat = [NSString stringWithFormat:@"%d",temp];
NSLog(@"%@",stringFloat);
NSArray*wenDuArr=[_xuanduoPicView.picArr objectAtIndex:0];
for (NSInteger i=0; i<wenDuArr.count; i++) {
NSString*picString=wenDuArr[i];
if ([picString isEqualToString:stringFloat ] ) {
[_xuanduoPicView.pic selectRow:i inComponent:0 animated:NO];
}
}
}
- (void)xuanduoSureBtnClick:(UIButton *)btn {
NSLog(@"%@******** _wenduPicview.picViewResultString",_wenduPicview.picViewResultString);
if (_xuanduoPicView.picViewResultString ==nil) {
[_xuanduoPicView removeFromSuperview];
}else{
JiaReWenDuModel *model=[[JiaReWenDuModel alloc] init];
model.resavemacId = [Socketsingleton sharedInstance].macAddress;
model.sendmacId =[Socketsingleton sharedInstance].macAddress;
int intlowString = [_xuanduoPicView.picViewResultString intValue];
int newIntlowString=intlowString*10;
NSLog(@"%d******** newIntlowString",newIntlowString);
// 转四位16进制
model.JiaReWenDu=[dataContorl tpIntStringToFourHex:newIntlowString];
model.crc16Code =@"0000";
NSString * hexstring=[NSString stringWithFormat:@"%@%@%@",model.description,model.JiaReWenDu,model.crc16Code];
NSData*data=[dataContorl stringToHexData:hexstring];
[ [Socketsingleton sharedInstance] soketWriteData:data];
}
[_xuanduoPicView removeFromSuperview];
_isNewXuanduo = NO;
}
-(void)songNuoBDMianQueue
{
@@ -4680,7 +4795,11 @@
NSString*switchString1=lightOrder.description;
lightOrder.switchBtn = hotCool;
lightOrder.crc16Str=@"0000";
lightOrder.lightNumber=@"05";
if (_isNewXuanduo) {
lightOrder.lightNumber=@"07";
}else{
lightOrder.lightNumber=@"05";
}
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightOrder.lightNumber,lightOrder.switchBtn,lightOrder.crc16Str];
NSData*manulData=[dataContorl stringToHexData:switchString2];