摄像头绑定页面

This commit is contained in:
xuemh 2018-04-23 22:17:32 +08:00
parent f7734fc71e
commit 81f87eac1a
7 changed files with 257 additions and 3 deletions

View File

@ -66,6 +66,8 @@
#import "RunSun84CHSetViewController.h"
#import "HaveHotCoolWenDuPicview.h"
#import "RuSunLightOrder.h"
#import "RuiMeiSetViewController.h"
//
@interface IfishP2PMonitorController ()<HaveHotCoolWenDuPicviewDelegate>
{
@ -103,6 +105,7 @@
@property(nonatomic,strong) KeLiAiSetViewController *keLiAiSetVc;
@property(nonatomic,strong) RusunHaveHeateSetViewController *rusunSet;
@property(nonatomic,strong) RunSun84CHSetViewController *rusun84Set;
@property (nonatomic, strong) RuiMeiSetViewController *ruimeiSet;
@property(nonatomic,strong) DXPopover *popover;
@property(nonatomic,strong) UIButton *rightPopButton;
@property (nonatomic,strong) SetNameTextViewController *setNameVC;
@ -468,7 +471,7 @@
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"blackbar.png"] forBarMetrics:UIBarMetricsDefault];
UIButton*leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
leftBtn.frame = CGRectMake(0, 0, 47,44);
[leftBtn setBackgroundImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[leftBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[leftBtn addTarget: self action: @selector(btnClickToBack:) forControlEvents: UIControlEventTouchUpInside];
UIBarButtonItem * lbbItem=[[UIBarButtonItem alloc]initWithCustomView:leftBtn];
self.navigationItem.leftBarButtonItem=lbbItem;
@ -4002,6 +4005,19 @@
[self.navigationController pushViewController:_rusun84Set animated:YES];
}else if ([dmodel.type isEqualToString:DECICE_TYPE_RUIMEI]){
_ruimeiSet = [[RuiMeiSetViewController alloc] init];
_ruimeiSet.currentdevice = dmodel;
NSString*stateString=[self.fishControlView.ruiMeiBack.customModel substringWithRange:NSMakeRange(2, 2)];
if ([stateString isEqualToString:@"01"]) {
_ruimeiSet.customModeOn=YES;
}else{
_ruimeiSet.customModeOn=NO;
}
usleep(50*1000);
[self.navigationController pushViewController:_ruimeiSet animated:YES];
}else if ([dmodel.type isEqualToString:DECICE_TYPE_JUNENGCC]){
@ -4149,6 +4165,19 @@
[_rusun84Set.tableView reloadData];
}else if ([dmodel.type isEqualToString:DECICE_TYPE_RUIMEI]){
_ruimeiSet.timeArr = timerArr;
[_ruimeiSet.indicatorView stopAnimating];
NSString*stateString=[self.fishControlView.ruiMeiBack.customModel substringWithRange:NSMakeRange(2, 2)];
if ([stateString isEqualToString:@"01"]) {
_ruimeiSet.customModeOn=YES;
}else{
_ruimeiSet.customModeOn=NO;
}
[_ruimeiSet.tableView reloadData];
}else if ([dmodel.type isEqualToString:DECICE_TYPE_JUNENGCC]){
@ -4571,7 +4600,13 @@
[self setHotCoolMianQueueWithUint64:mac];
}
#pragma mark -
-(void)selectRuiMeiIndex:(NSIndexPath *)index withbackModle:(RunSun84Protocol *)backModel {
RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey];
UInt64 mac=[dataContorl hexToTen:backmodel.heatTemperature];
[self setHotCoolMianQueueWithUint64:mac];
}
#pragma mark - BD
-(void)selectSongNuoBDIndex:(NSIndexPath *)index withBackModel:(SongNuoBDProtocol *)backModel{

View File

@ -18,6 +18,8 @@
#import "RuSunProtocol.h"
#import "SongNuoBDProtocol.h"
#import "RunSun84Protocol.h"
#import "RuiMeiProtocolModel.h"
@interface BootomViewSoketBackMasgConreol : NSObject
//获取温度
+(NSString*)getTempWithSoketData:(NSData *)data;
@ -59,5 +61,7 @@ indexPath;
+(void)SongnuoBDCommandSelectorWithBackMode86:(SongNuoBDProtocol *)model atindexPath:(NSIndexPath *)indexPath;
//瑞美
+(void)RuiMeiCommandSelectorWithBackMode168:(RuiMeiProtocolModel *)model atindexPath:(NSIndexPath *)indexPath;
@end

View File

@ -84,6 +84,10 @@
// 86
str=[str substringWithRange:NSMakeRange(148,IFISH_TEMPERATURE_BYTE2)];
}else if ([type isEqualToString:DECICE_TYPE_RUIMEI]){
//
str=[str substringWithRange:NSMakeRange(148,IFISH_TEMPERATURE_BYTE2)];
}
UInt64 mac=[dataContorl hexToTen:str];
@ -762,6 +766,81 @@ indexPath{
}
+(void)RuiMeiCommandSelectorWithBackMode168:(RuiMeiProtocolModel *)model atindexPath:(NSIndexPath *)indexPath
{
NSInteger index= indexPath.row - 3;
manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init];
[[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel];
NSString*switchString=manulModel.description;
if (index == 0) {
manulModel.lightNumber = @"01";
if([[model.ch1 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
{
manulModel.switchBtn = @"01";
}else{
manulModel.switchBtn = @"00";
}
}else if (index == 1){
manulModel.lightNumber = @"02";
if([[model.ch2 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
{
manulModel.switchBtn = @"01";
}else{
manulModel.switchBtn = @"00";
}
}else if (index == 2){
manulModel.lightNumber = @"03";
if([[model.ch3 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
{
manulModel.switchBtn = @"01";
}else{
manulModel.switchBtn = @"00";
}
}else if (index == 3){
manulModel.lightNumber = @"04";
if([[model.ch4 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
{
manulModel.switchBtn = @"01";
}else{
manulModel.switchBtn = @"00";
}
}else if (index == 4){
//
return;
}
manulModel.crc16Str = @"0000";
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str];
NSData*manulData=[dataContorl stringToHexData:switchString2];
[[Socketsingleton sharedInstance] soketWriteData:manulData];
}
+(void)SongnuoBDCommandSelectorWithBackMode86:(SongNuoBDProtocol *)model atindexPath:(NSIndexPath *)indexPath
{
NSInteger index= indexPath.row - 3;

View File

@ -30,6 +30,9 @@
#import "SongNuoBDProtocol.h"
#import "RunSun84Protocol.h"
#import "RuSun84BackMsgUtils.h"
#import "RuiMeiProtocolModel.h"
#import "RuiMeiBackMsgUtils.h"
@protocol MonitorBottomCollcetionSelectDelegate <NSObject>
@optional
@ -67,6 +70,8 @@
-(void)selectRuSunIndex:(NSIndexPath*)index withbackModle:(RuSunProtocol *)backModel;
-(void)selectRuSun84Index:(NSIndexPath*)index withbackModle:(RunSun84Protocol *)backModel;
//瑞美
-(void)selectRuiMeiIndex:(NSIndexPath*)index withbackModle:(RunSun84Protocol *)backModel;
//松诺 BD
@ -141,6 +146,7 @@
@property(nonatomic,strong) RuSunProtocol *ruSunBack;
@property(nonatomic,strong) RunSun84Protocol *ruSun84Back;
@property (nonatomic, strong) RuiMeiProtocolModel *ruiMeiBack;
@property(nonatomic,strong) SongNuoBDProtocol *songNuoBDBack;
-(void)setTabViewWithFrame:(CGRect)frame;

View File

@ -27,6 +27,9 @@
#import "ThreeControlName.h"
#import "FourControlName.h"
#import "XuToControlName.h"
#import "RuiMeiCHNameCustom.h"
#import "RuiMeiCHControl.h"
@implementation MonitorBootmView
-(id)initWithFrame:(CGRect)frame
@ -605,7 +608,9 @@
return 3 + self.device.controlAmount.integerValue +1;
}else{
} else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]) {
return 3 + 5;
} else {
if (self.device.controlAmount.integerValue ==5) {
@ -659,6 +664,17 @@
withData:self.device
addMassglength:self.dataLength];
}else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){
if (!_ruiMeiBack) {
[self makeToast:@"暂未连接"];
return;
}
[self.MonitorBottomDelegate didselectCollectionIex:indexPath
withData:self.device
addMassglength:self.dataLength];
}else if ([self.device.type isEqualToString:DECICE_TYPE_JUNENGCC]){
@ -843,6 +859,23 @@
}
}else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){
if (!_ruiMeiBack) {
[self makeToast:@"暂未连接"];
return;
}
if (indexPath.row == 7) {
//
[self.MonitorBottomDelegate selectRuiMeiIndex:indexPath withbackModle:_ruSun84Back];
}else{
[BootomViewSoketBackMasgConreol RuiMeiCommandSelectorWithBackMode168:_ruiMeiBack atindexPath:indexPath];
[self makeToastActivity];
}
}else if ([self.device.type isEqualToString:DECICE_TYPE_JUNENGCC]){
@ -1124,6 +1157,14 @@
[cell setRusuan84ControlBtnImg:self.btnImgArr addArr:self.btnOnImgArr atIndex:indexPath addBackModel:_ruSun84Back];
}else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){
if (!_ruiMeiBack) {
cell.controBtnImg.image = self.btnImgArr[indexPath.row - 3];
[self makeToast:@"连接设备中..."];
}
[cell setRuiMeiControlBtnImg:self.btnImgArr addArr:self.btnOnImgArr atIndex:indexPath addBackModel:_ruiMeiBack];
}else if ([self.device.type isEqualToString:DECICE_TYPE_JUNENGCC]){
@ -1337,7 +1378,24 @@
LXImageWithImageName(@"bootview_022_on"),
LXImageWithImageName(@"bootview_heat_on")];
}else{
} else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){
//self.btnNameArr = @[@"灯1",@"灯2",@"水泵",@"氧泵",@"加热棒"];
RuiMeiCHControl* songNuo = [UserExtendataArchaver unArchiverRuiMeiDeviceCHInfo:self.device.macAddress];
self.btnNameArr = @[songNuo.ch1name,songNuo.ch2name,songNuo.ch3name,songNuo.ch4name,songNuo.jiaRe];
self.btnImgArr = @[LXImageWithImageName(@"bootview_light_off"),
LXImageWithImageName(@"bootview_light_off"),
LXImageWithImageName(@"bootview_shajun_off"),
LXImageWithImageName(@"bootview_co2_off"),
LXImageWithImageName(@"bootview_heat_off")];
self.btnOnImgArr = @[LXImageWithImageName(@"bootview_light_on"),
LXImageWithImageName(@"bootview_light_on"),
LXImageWithImageName(@"bootview_shajun_on"),
LXImageWithImageName(@"bootview_co2_on"),
LXImageWithImageName(@"bootview_heat_on")];
} else{
int controlAmount=[self.device.controlAmount intValue];
@ -1608,6 +1666,26 @@
addMassglength:string1.length];
}else if ([self.device.type isEqualToString:DECICE_TYPE_RUIMEI]){
//
if (!_ruiMeiBack) {
_ruiMeiBack = [[RuiMeiProtocolModel alloc] init];
}
[RuiMeiBackMsgUtils readSoketDataWithBaackMassgModel:_ruiMeiBack addWithBackData:data];
self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_RUIMEI];
[self.collectionView reloadData];
NSArray *timerArr=[RuiMeiBackMsgUtils refreshRuSunTimerAddTemperatureWithBackMassageModel:_ruiMeiBack];
[self.MonitorBottomDelegate setTimeVCReloadDatawithTimerArr:timerArr
withData:self.device
addMassglength:string1.length];
}else if ([self.device.type isEqualToString:DECICE_TYPE_JUNENGCC]){
//

View File

@ -16,6 +16,8 @@
#import "RuSunProtocol.h"
#import "SongNuoBDProtocol.h"
#import "RunSun84Protocol.h"
#import "RuiMeiProtocolModel.h"
@interface FishControlFourthCell : UICollectionViewCell
@property(nonatomic,strong) UIImageView *controBtnImg;
@ -80,4 +82,10 @@
atIndex:(NSIndexPath *)indexPath
addBackModel:(SongNuoBDProtocol*)model;
// 瑞美
-(void)setRuiMeiControlBtnImg:(NSArray *)imgOffArr
addArr:(NSArray *)imgOnArr
atIndex:(NSIndexPath *)indexPath
addBackModel:(RuiMeiProtocolModel*)model;
@end

View File

@ -397,6 +397,50 @@
}
}
-(void)setRuiMeiControlBtnImg:(NSArray *)imgOffArr
addArr:(NSArray *)imgOnArr
atIndex:(NSIndexPath *)indexPath
addBackModel:(RuiMeiProtocolModel*)model
{
NSInteger index = indexPath.row - 3;
if (index == 0) {
NSString*stateString=[model.ch1 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}else if (index == 1){
NSString*stateString=[model.ch2 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}else if (index == 2){
NSString*stateString=[model.ch3 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}else if (index == 3){
NSString*stateString=[model.ch4 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}else if (index == 4){
//
//
//00 01
//model.heatStickState
NSString*stateString=[model.heatStickState substringWithRange:NSMakeRange(0, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}
}
-(void)setSongNuoBDControBtnImg:(NSArray *)imgOffArr