空置页面和设置页面调试通过
This commit is contained in:
parent
4dd95da147
commit
df311d475c
|
|
@ -2453,11 +2453,19 @@
|
|||
88F5EFF01D48D08100CC7CAF /* split.c in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF8E1D48D08100CC7CAF /* split.c */; };
|
||||
88F5EFF11D48D08100CC7CAF /* libzbar.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 88F5EFA81D48D08100CC7CAF /* libzbar.a */; };
|
||||
88F740C01ECC28E800876AED /* ShopAddGoodsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */; };
|
||||
E51D7D4B208CD528001FF053 /* RuiMeiCHNameCustom.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D4A208CD528001FF053 /* RuiMeiCHNameCustom.m */; };
|
||||
E51D7D4E208CD5C8001FF053 /* RuiMeiCHControl.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D4D208CD5C8001FF053 /* RuiMeiCHControl.m */; };
|
||||
E51D7D51208CDB5B001FF053 /* RuiMeiSetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D50208CDB5B001FF053 /* RuiMeiSetViewController.m */; };
|
||||
E51D7D55208CE08D001FF053 /* CustomModeSetCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D53208CE08D001FF053 /* CustomModeSetCell.m */; };
|
||||
E51D7D58208CE121001FF053 /* CustomModeSetCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E51D7D57208CE120001FF053 /* CustomModeSetCell.xib */; };
|
||||
E547870B20728F390060C2C2 /* back_btn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E547870A20728F380060C2C2 /* back_btn@2x.png */; };
|
||||
E547870F2073192E0060C2C2 /* introlImage_iphonex_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E547870C2073192D0060C2C2 /* introlImage_iphonex_1.jpg */; };
|
||||
E54787102073192E0060C2C2 /* introlImage_iphonex_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E547870D2073192D0060C2C2 /* introlImage_iphonex_2.jpg */; };
|
||||
E54787112073192E0060C2C2 /* introlImage_iphonex_3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E547870E2073192E0060C2C2 /* introlImage_iphonex_3.jpg */; };
|
||||
E58C9980208189780004C42B /* back_btn_1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E58C997F208189780004C42B /* back_btn_1@2x.png */; };
|
||||
E58C9984208195640004C42B /* RuiMeiViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E58C9983208195640004C42B /* RuiMeiViewController.m */; };
|
||||
E58C99872081A3BA0004C42B /* RuiMeiProtocolModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E58C99862081A3BA0004C42B /* RuiMeiProtocolModel.m */; };
|
||||
E58C998A2081A6930004C42B /* RuiMeiBackMsgUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E58C99892081A6930004C42B /* RuiMeiBackMsgUtils.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
|
@ -6217,11 +6225,26 @@
|
|||
88F5EFA81D48D08100CC7CAF /* libzbar.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libzbar.a; sourceTree = "<group>"; };
|
||||
88F740BE1ECC28E800876AED /* ShopAddGoodsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopAddGoodsViewController.h; sourceTree = "<group>"; };
|
||||
88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopAddGoodsViewController.m; sourceTree = "<group>"; };
|
||||
E51D7D49208CD528001FF053 /* RuiMeiCHNameCustom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiCHNameCustom.h; sourceTree = "<group>"; };
|
||||
E51D7D4A208CD528001FF053 /* RuiMeiCHNameCustom.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiCHNameCustom.m; sourceTree = "<group>"; };
|
||||
E51D7D4C208CD5C8001FF053 /* RuiMeiCHControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiCHControl.h; sourceTree = "<group>"; };
|
||||
E51D7D4D208CD5C8001FF053 /* RuiMeiCHControl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiCHControl.m; sourceTree = "<group>"; };
|
||||
E51D7D4F208CDB5B001FF053 /* RuiMeiSetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiSetViewController.h; sourceTree = "<group>"; };
|
||||
E51D7D50208CDB5B001FF053 /* RuiMeiSetViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiSetViewController.m; sourceTree = "<group>"; };
|
||||
E51D7D52208CE08D001FF053 /* CustomModeSetCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomModeSetCell.h; sourceTree = "<group>"; };
|
||||
E51D7D53208CE08D001FF053 /* CustomModeSetCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomModeSetCell.m; sourceTree = "<group>"; };
|
||||
E51D7D57208CE120001FF053 /* CustomModeSetCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomModeSetCell.xib; sourceTree = "<group>"; };
|
||||
E547870A20728F380060C2C2 /* back_btn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "back_btn@2x.png"; sourceTree = "<group>"; };
|
||||
E547870C2073192D0060C2C2 /* introlImage_iphonex_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = introlImage_iphonex_1.jpg; sourceTree = "<group>"; };
|
||||
E547870D2073192D0060C2C2 /* introlImage_iphonex_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = introlImage_iphonex_2.jpg; sourceTree = "<group>"; };
|
||||
E547870E2073192E0060C2C2 /* introlImage_iphonex_3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = introlImage_iphonex_3.jpg; sourceTree = "<group>"; };
|
||||
E58C997F208189780004C42B /* back_btn_1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "back_btn_1@2x.png"; sourceTree = "<group>"; };
|
||||
E58C9982208195640004C42B /* RuiMeiViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiViewController.h; sourceTree = "<group>"; };
|
||||
E58C9983208195640004C42B /* RuiMeiViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiViewController.m; sourceTree = "<group>"; };
|
||||
E58C99852081A3BA0004C42B /* RuiMeiProtocolModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiProtocolModel.h; sourceTree = "<group>"; };
|
||||
E58C99862081A3BA0004C42B /* RuiMeiProtocolModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiProtocolModel.m; sourceTree = "<group>"; };
|
||||
E58C99882081A6930004C42B /* RuiMeiBackMsgUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiBackMsgUtils.h; sourceTree = "<group>"; };
|
||||
E58C99892081A6930004C42B /* RuiMeiBackMsgUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiBackMsgUtils.m; sourceTree = "<group>"; };
|
||||
E5C644C0206BBD7100C558D5 /* CommonMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommonMacros.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
|
|
@ -8894,6 +8917,7 @@
|
|||
883E76621D48A5E50030E075 /* CenterontrolControllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E58C9981208195350004C42B /* RuiMei */,
|
||||
881B12411E1CCC5E004C074B /* JuNeng */,
|
||||
889C25E31E1B7CD9004F745D /* RuSunTemp */,
|
||||
883E76631D48A5E50030E075 /* FourControl */,
|
||||
|
|
@ -9893,6 +9917,9 @@
|
|||
883E799C1D48B0280030E075 /* TemperatureSetCell.h */,
|
||||
883E799D1D48B0280030E075 /* TemperatureSetCell.m */,
|
||||
883E799E1D48B0280030E075 /* TemperatureSetCell.xib */,
|
||||
E51D7D52208CE08D001FF053 /* CustomModeSetCell.h */,
|
||||
E51D7D53208CE08D001FF053 /* CustomModeSetCell.m */,
|
||||
E51D7D57208CE120001FF053 /* CustomModeSetCell.xib */,
|
||||
);
|
||||
path = setViewCell;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -13733,6 +13760,25 @@
|
|||
path = zbar;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E58C9981208195350004C42B /* RuiMei */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E58C99852081A3BA0004C42B /* RuiMeiProtocolModel.h */,
|
||||
E58C99862081A3BA0004C42B /* RuiMeiProtocolModel.m */,
|
||||
E58C99882081A6930004C42B /* RuiMeiBackMsgUtils.h */,
|
||||
E58C99892081A6930004C42B /* RuiMeiBackMsgUtils.m */,
|
||||
E58C9982208195640004C42B /* RuiMeiViewController.h */,
|
||||
E58C9983208195640004C42B /* RuiMeiViewController.m */,
|
||||
E51D7D49208CD528001FF053 /* RuiMeiCHNameCustom.h */,
|
||||
E51D7D4A208CD528001FF053 /* RuiMeiCHNameCustom.m */,
|
||||
E51D7D4C208CD5C8001FF053 /* RuiMeiCHControl.h */,
|
||||
E51D7D4D208CD5C8001FF053 /* RuiMeiCHControl.m */,
|
||||
E51D7D4F208CDB5B001FF053 /* RuiMeiSetViewController.h */,
|
||||
E51D7D50208CDB5B001FF053 /* RuiMeiSetViewController.m */,
|
||||
);
|
||||
path = RuiMei;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E5C644BF206BBD5F00C558D5 /* Common */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
|
@ -14630,6 +14676,7 @@
|
|||
88742C2F1D63F9AB0074F1F8 /* CertifyListViewFirstCell.xib in Resources */,
|
||||
883E783C1D48A5E50030E075 /* StoreViewController.xib in Resources */,
|
||||
880708041DE812B30076F65A /* live_sharechat_iocn@2x.png in Resources */,
|
||||
E51D7D58208CE121001FF053 /* CustomModeSetCell.xib in Resources */,
|
||||
882956A61DBDA3A200E9DDD7 /* community_left@2x.png in Resources */,
|
||||
883E79181D48A74F0030E075 /* scanscanBg.png in Resources */,
|
||||
8871C4981E6D507B000AA49F /* signin_condition_await@3x.png in Resources */,
|
||||
|
|
@ -15361,6 +15408,7 @@
|
|||
8815D1321DFAADC300BEA2DA /* IfishCameraRecordThirdCell.m in Sources */,
|
||||
887001CF1D794D7B00668C8C /* KanHuViewLastCell.m in Sources */,
|
||||
886D15831E605EEF0085F7D6 /* CustomeLabel.m in Sources */,
|
||||
E51D7D55208CE08D001FF053 /* CustomModeSetCell.m in Sources */,
|
||||
8860286E1E10BB1100F3DB5D /* NSBundle+CTAssetsPickerController.m in Sources */,
|
||||
883E78531D48A5E50030E075 /* TwoControlNinetyninebiteViewController.m in Sources */,
|
||||
88F5EFDA1D48D08100CC7CAF /* Reachability.m in Sources */,
|
||||
|
|
@ -15560,6 +15608,7 @@
|
|||
883E76311D4897570030E075 /* ShopModel.m in Sources */,
|
||||
88613F711E5C1E86008D2C69 /* IfishFeedListData.m in Sources */,
|
||||
883E76221D4897570030E075 /* ChatViewModel.m in Sources */,
|
||||
E51D7D4B208CD528001FF053 /* RuiMeiCHNameCustom.m in Sources */,
|
||||
88602F711E12002600F3DB5D /* NTESSessionJankenponContentView.m in Sources */,
|
||||
88602F821E12002600F3DB5D /* NTESNotificationCenter.m in Sources */,
|
||||
882A760C1EBB27BE00AD1D15 /* ShopCerPart1InfoViewCell.m in Sources */,
|
||||
|
|
@ -15660,6 +15709,7 @@
|
|||
881671A51EA5DE2B00BEBF23 /* UMComLikeListDataController.m in Sources */,
|
||||
88597AC21E56BAF1003D0E5C /* WFTailoringViewController.m in Sources */,
|
||||
882957FD1DC0443600E9DDD7 /* IfishCardScrollView.m in Sources */,
|
||||
E51D7D4E208CD5C8001FF053 /* RuiMeiCHControl.m in Sources */,
|
||||
883E78A01D48A5E50030E075 /* ShotScreenImgViewController.m in Sources */,
|
||||
88602DB81E10D97E00F3DB5D /* SDWebImagePrefetcher.m in Sources */,
|
||||
88602F5B1E12002600F3DB5D /* NTESSystemNotificationViewController.m in Sources */,
|
||||
|
|
@ -15875,6 +15925,7 @@
|
|||
8867C8761D49B6BC0029F1FA /* TabBarDeviceShouYeCell.m in Sources */,
|
||||
8815D1281DFAACED00BEA2DA /* IfishCameraRecordfirstCell.m in Sources */,
|
||||
885979E21E52E38E003D0E5C /* MinekanHuNotSelectShopController.m in Sources */,
|
||||
E58C998A2081A6930004C42B /* RuiMeiBackMsgUtils.m in Sources */,
|
||||
88602DB41E10D97E00F3DB5D /* SDWebImageDecoder.m in Sources */,
|
||||
8815D13C1DFF892A00BEA2DA /* CameraNoParyBackVideoView.m in Sources */,
|
||||
889133391ECEB97D00F52EBC /* VideoEditeNameViewCell.m in Sources */,
|
||||
|
|
@ -15925,6 +15976,7 @@
|
|||
8816721B1EA5DE2B00BEBF23 /* UMComSimplicityDiscoverViewController.m in Sources */,
|
||||
88C5989D1EA0965B00BDC812 /* LBLaunchImageAdView.m in Sources */,
|
||||
88602A551E10BC3500F3DB5D /* NIMSessionListViewController.m in Sources */,
|
||||
E58C9984208195640004C42B /* RuiMeiViewController.m in Sources */,
|
||||
881A1D051DD2B9F200BA1AF4 /* WoDeKanKanViewController.m in Sources */,
|
||||
886E6A551D893870009C7724 /* SVIndefiniteAnimatedView.m in Sources */,
|
||||
88602A2C1E10BC3500F3DB5D /* NIMInputView.m in Sources */,
|
||||
|
|
@ -16046,6 +16098,7 @@
|
|||
883E76261D4897570030E075 /* DeviceCameraModel.m in Sources */,
|
||||
88602F571E12002600F3DB5D /* NTESCustomSysNotificationViewController.m in Sources */,
|
||||
8875B4FB1EDFA406000FAE93 /* RunSun84Protocol.m in Sources */,
|
||||
E58C99872081A3BA0004C42B /* RuiMeiProtocolModel.m in Sources */,
|
||||
881671C31EA5DE2B00BEBF23 /* UMComViewController.m in Sources */,
|
||||
883E785D1D48A5E50030E075 /* XuToWenDuPicview.m in Sources */,
|
||||
880707F51DE302630076F65A /* LXActionView.m in Sources */,
|
||||
|
|
@ -16234,6 +16287,7 @@
|
|||
88602A1B1E10BC3400F3DB5D /* NIMContactDataCell.m in Sources */,
|
||||
88696FBD1E9C7215005D4AFB /* MemberDetailViewController.m in Sources */,
|
||||
8816722C1EA5DE2B00BEBF23 /* UMComSimpleFeedTableViewController.m in Sources */,
|
||||
E51D7D51208CDB5B001FF053 /* RuiMeiSetViewController.m in Sources */,
|
||||
88602F8B1E12002600F3DB5D /* NTESBadgeView.m in Sources */,
|
||||
885692B41E82413200C51617 /* IfishBannerData.m in Sources */,
|
||||
881672091EA5DE2B00BEBF23 /* UMComiToast.m in Sources */,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,13 @@
|
|||
#import "ThreeControlName.h"
|
||||
#import "FourControlName.h"
|
||||
#import "XuToControlName.h"
|
||||
#import "RuiMeiCHControl.h"
|
||||
|
||||
@interface UserExtendataArchaver : NSObject
|
||||
//自定义水族箱名字数据
|
||||
+(void)archiverRuiMeiDeviceCHInfo:(RuiMeiCHControl*)ch;
|
||||
+(RuiMeiCHControl*)unArchiverRuiMeiDeviceCHInfo:(NSString *)mac;
|
||||
|
||||
//自定义水族箱名字数据
|
||||
+(void)archiverDeviceCHInfo:(RunSunCHControl*)ch;
|
||||
+(RunSunCHControl*)unArchiverDeviceCHInfo:(NSString *)mac;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,20 @@
|
|||
#import "UserExtendataArchaver.h"
|
||||
|
||||
@implementation UserExtendataArchaver
|
||||
|
||||
+(void)archiverRuiMeiDeviceCHInfo:(RuiMeiCHControl*)ch {
|
||||
NSString *key = [NSString stringWithFormat:@"Ruimei%@",ch.macAd];
|
||||
NSString *file = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:key];
|
||||
[NSKeyedArchiver archiveRootObject:ch toFile:file];
|
||||
}
|
||||
|
||||
+(RuiMeiCHControl*)unArchiverRuiMeiDeviceCHInfo:(NSString *)mac {
|
||||
NSString *key = [NSString stringWithFormat:@"Ruimei%@",mac];
|
||||
NSString *file = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:key];
|
||||
RuiMeiCHControl *ch = [NSKeyedUnarchiver unarchiveObjectWithFile:file];
|
||||
return ch;
|
||||
}
|
||||
|
||||
+(void)archiverDeviceCHInfo:(RunSunCHControl*)ch
|
||||
{
|
||||
NSString *key = [NSString stringWithFormat:@"Rusun%@",ch.macAd];
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
#import "RuSunHaveHeateViewController.h"
|
||||
#import "SongNuoDBCenterViewController.h"
|
||||
#import "RunSun84biteCenterViewController.h"
|
||||
#import "RuiMeiViewController.h"
|
||||
|
||||
//默认选中 下表类型
|
||||
//typedef NS_ENUM (NSInteger,saveIndexType){
|
||||
//
|
||||
|
|
|
|||
|
|
@ -140,6 +140,15 @@
|
|||
[nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"blackbar.png"] forBarMetrics:UIBarMetricsDefault];
|
||||
app1.window.rootViewController=nav;
|
||||
|
||||
} else if ([devicemodel.type isEqualToString:DECICE_TYPE_RUIMEI]) {
|
||||
RuiMeiViewController *ruimeiCenter=[[RuiMeiViewController alloc] init];
|
||||
ruimeiCenter.currentDevice = devicemodel;
|
||||
UIApplication*app=[UIApplication sharedApplication];
|
||||
AppDelegate*app1=(AppDelegate*)app.delegate;
|
||||
UINavigationController*nav=[[UINavigationController alloc]initWithRootViewController:ruimeiCenter];
|
||||
[nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"blackbar.png"] forBarMetrics:UIBarMetricsDefault];
|
||||
app1.window.rootViewController=nav;
|
||||
|
||||
}else{
|
||||
|
||||
int controlAmount=[devicemodel.controlAmount intValue];
|
||||
|
|
|
|||
|
|
@ -46,5 +46,7 @@
|
|||
//睿芯 独立 84 字节
|
||||
#define DECICE_TYPE_RUSUN2A @"2a" //0x2a
|
||||
|
||||
//瑞美4控
|
||||
#define DECICE_TYPE_RUIMEI @"2b"
|
||||
|
||||
#endif /* IfishDeviceInfo_h */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// RuiMeiBackMsgUtils.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/14.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RuiMeiProtocolModel.h"
|
||||
|
||||
#define DataCenterRuiMeiModelKey @"DataCenterRuiMeiModelKey"
|
||||
|
||||
@interface RuiMeiBackMsgUtils : NSObject
|
||||
|
||||
/**
|
||||
* save soket massage control
|
||||
*/
|
||||
+(void)readSoketDataWithBaackMassgModel:(RuiMeiProtocolModel*)ruSunModel
|
||||
addWithBackData:(NSData*)data;
|
||||
|
||||
/**
|
||||
* setTemperaturelabel
|
||||
*/
|
||||
+(void)setTemperaturelabel:(UILabel*)temperaturelabel
|
||||
addbubleImge:(UIImageView*)bubleImg
|
||||
WithBackData:(NSData*)data
|
||||
addWithBackMassageModel:(RuiMeiProtocolModel*)backModel
|
||||
addWithTableview:(UITableView*)tableview;
|
||||
/**
|
||||
* light state
|
||||
*/
|
||||
|
||||
+(void)resetRuSunCHState:(UIButton*)ch1
|
||||
ch2:(UIButton*)ch2
|
||||
ch3:(UIButton*)ch3
|
||||
ch4:(UIButton*)ch4
|
||||
andJiaRe:(UIButton*)jiaReBang
|
||||
withBackModel:(RuiMeiProtocolModel*)backModel;
|
||||
/**
|
||||
* refresh setViewData
|
||||
*/
|
||||
+(NSArray*)refreshRuSunTimerAddTemperatureWithBackMassageModel:(RuiMeiProtocolModel*)backModel;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
//
|
||||
// RuiMeiBackMsgUtils.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/14.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RuiMeiBackMsgUtils.h"
|
||||
|
||||
@implementation RuiMeiBackMsgUtils
|
||||
|
||||
+(void)readSoketDataWithBaackMassgModel:(RuiMeiProtocolModel*)ruSunModel
|
||||
addWithBackData:(NSData*)data
|
||||
{
|
||||
|
||||
NSString*totalString=[dataContorl dataToHexString:data];
|
||||
//无运行模式
|
||||
ruSunModel.ch1=[totalString substringWithRange:NSMakeRange(30, 4)];
|
||||
ruSunModel.ch2=[totalString substringWithRange:NSMakeRange(34, 4)];
|
||||
ruSunModel.ch3 = [totalString substringWithRange:NSMakeRange(38, 4)];
|
||||
ruSunModel.ch4 = [totalString substringWithRange:NSMakeRange(42, 4)];
|
||||
ruSunModel.customModel = [totalString substringWithRange:NSMakeRange(46, 4)];
|
||||
ruSunModel.timer1=[totalString substringWithRange:NSMakeRange(50,12)];
|
||||
ruSunModel.timer2=[totalString substringWithRange:NSMakeRange(62, 12)];
|
||||
ruSunModel.timer3=[totalString substringWithRange:NSMakeRange(74, 12)];
|
||||
ruSunModel.timer4=[totalString substringWithRange:NSMakeRange(86, 12)];
|
||||
ruSunModel.timer5=[totalString substringWithRange:NSMakeRange(98, 12)];
|
||||
ruSunModel.timer6=[totalString substringWithRange:NSMakeRange(110, 12)];
|
||||
ruSunModel.timer7=[totalString substringWithRange:NSMakeRange(122, 12)];
|
||||
ruSunModel.timer8=[totalString substringWithRange:NSMakeRange(134, 12)];
|
||||
ruSunModel.heatStickState=[totalString substringWithRange:NSMakeRange(146, 2)];//16进制型
|
||||
ruSunModel.wendu=[totalString substringWithRange:NSMakeRange(148, 4)];
|
||||
ruSunModel.heatTemperature=[totalString substringWithRange:NSMakeRange(152, 4)];
|
||||
ruSunModel.shiwen = [totalString substringWithRange:NSMakeRange(156, 4)];
|
||||
ruSunModel.baojingSwitch=[totalString substringWithRange:NSMakeRange(160, 2)];
|
||||
ruSunModel.miniTp=[totalString substringWithRange:NSMakeRange(162, 4)];
|
||||
ruSunModel.maxTp=[totalString substringWithRange:NSMakeRange(166, 4)];
|
||||
ruSunModel.funcCode= [totalString substringWithRange:NSMakeRange(170, 4)];
|
||||
[[DataCenter defaultDtacenter] setValue:ruSunModel forKey:DataCenterRuiMeiModelKey];
|
||||
|
||||
}
|
||||
|
||||
+(void)setTemperaturelabel:(UILabel*)temperaturelabel
|
||||
addbubleImge:(UIImageView*)bubleImg
|
||||
WithBackData:(NSData*)data
|
||||
addWithBackMassageModel:(RuiMeiProtocolModel*)backModel
|
||||
addWithTableview:(UITableView*)tableview
|
||||
{
|
||||
|
||||
|
||||
NSString*str=[dataContorl dataToHexString:data];
|
||||
str=[str substringWithRange:NSMakeRange(148,4)];
|
||||
UInt64 mac=[dataContorl hexToTen:str];
|
||||
float TPlabel=mac/10+(mac%10)*0.1;
|
||||
NSString *stringFloat = [NSString stringWithFormat:@"%.1f",TPlabel];
|
||||
NSLog(@"%@",stringFloat);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (mac==0) {
|
||||
|
||||
temperaturelabel.text=@"00.0";
|
||||
|
||||
}else{
|
||||
|
||||
temperaturelabel.text=stringFloat;
|
||||
}
|
||||
});
|
||||
}
|
||||
+(void)resetRuSunCHState:(UIButton*)ch1
|
||||
ch2:(UIButton*)ch2
|
||||
ch3:(UIButton*)ch3
|
||||
ch4:(UIButton*)ch4
|
||||
andJiaRe:(UIButton*)jiaReBang
|
||||
withBackModel:(RuiMeiProtocolModel*)backModel
|
||||
{
|
||||
|
||||
// ch1
|
||||
|
||||
NSString*stateString1=[backModel.ch1 substringWithRange:NSMakeRange(2, 2)];
|
||||
|
||||
if ([stateString1 isEqualToString:@"01"]) {
|
||||
[ch1 setImage:[UIImage imageNamed:@"PFLight1_on"] forState:UIControlStateNormal];
|
||||
ch1.selected=YES;
|
||||
}else{
|
||||
[ch1 setImage:[UIImage imageNamed:@"PFLight1_off"] forState:UIControlStateNormal];
|
||||
ch1.selected=NO;
|
||||
|
||||
}
|
||||
// ch2
|
||||
|
||||
NSString*stateString2=[backModel.ch2 substringWithRange:NSMakeRange(2, 2)];
|
||||
|
||||
if ([stateString2 isEqualToString:@"01"]) {
|
||||
[ch2 setImage:[UIImage imageNamed:@"PFLight1_on"] forState:UIControlStateNormal];
|
||||
ch2.selected=YES;
|
||||
}else{
|
||||
[ch2 setImage:[UIImage imageNamed:@"PFLight1_off"] forState:UIControlStateNormal];
|
||||
ch2.selected=NO;
|
||||
}
|
||||
|
||||
// ch3
|
||||
|
||||
NSString*stateString3=[backModel.ch3 substringWithRange:NSMakeRange(2, 2)];
|
||||
|
||||
if ([stateString3 isEqualToString:@"01"]){
|
||||
|
||||
[ch3 setImage:[UIImage imageNamed:@"PFkilLlight_on"] forState:UIControlStateNormal];
|
||||
ch3.selected=YES;
|
||||
|
||||
}else{
|
||||
[ch3 setImage:[UIImage imageNamed:@"PFkilLlight_off"] forState:UIControlStateNormal];
|
||||
ch3.selected=NO;
|
||||
|
||||
}
|
||||
|
||||
// ch4
|
||||
|
||||
NSString*stateString4=[backModel.ch4 substringWithRange:NSMakeRange(2, 2)];
|
||||
|
||||
if ([stateString4 isEqualToString:@"01"]){
|
||||
|
||||
[ch4 setImage:[UIImage imageNamed:@"O2_on"] forState:UIControlStateNormal];
|
||||
ch4.selected=YES;
|
||||
|
||||
}else{
|
||||
[ch4 setImage:[UIImage imageNamed:@"O2_off"] forState:UIControlStateNormal];
|
||||
ch4.selected=NO;
|
||||
|
||||
}
|
||||
|
||||
// 加热制冷 状态 1字节
|
||||
NSString*stateString6=[backModel.heatStickState substringWithRange:NSMakeRange(0, 2)];
|
||||
|
||||
if ([stateString6 isEqualToString:@"01"]){
|
||||
//加热
|
||||
[jiaReBang setImage:[UIImage imageNamed:@"JiaReBang_on"] forState:UIControlStateNormal];
|
||||
jiaReBang.selected=YES;
|
||||
|
||||
}else{
|
||||
//制冷
|
||||
|
||||
[jiaReBang setImage:[UIImage imageNamed:@"JiaReBang_off"] forState:UIControlStateNormal];
|
||||
jiaReBang.selected=NO;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+(NSArray*)refreshRuSunTimerAddTemperatureWithBackMassageModel:(RuiMeiProtocolModel*)backModel
|
||||
{
|
||||
NSArray*timerArr=[[NSArray alloc]init];
|
||||
NSString*low=backModel.miniTp;
|
||||
NSString*heigh=backModel.maxTp;
|
||||
UInt64 lowten=[dataContorl hexToTen:low];
|
||||
UInt64 heighten=[dataContorl hexToTen:heigh];
|
||||
float formatlow=lowten/10;
|
||||
float formatheigh=heighten/10;
|
||||
|
||||
NSString*wenduString=[NSString stringWithFormat:@"%.0f~%.0f°C",formatlow,formatheigh];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex1=[backModel.timer1 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex1=[backModel.timer1 substringWithRange:NSMakeRange(8, 4)];
|
||||
|
||||
// 十进制
|
||||
NSString*startTimeTen1=[dataContorl hexStringToDateString:startTimeHex1];
|
||||
NSString*endTimeTen1=[dataContorl hexStringToDateString:endTimeHex1];
|
||||
NSString*setTim1=[NSString stringWithFormat:@"%@~%@",startTimeTen1,endTimeTen1];
|
||||
// 十六进制
|
||||
NSString*startTimeHex2=[backModel.timer2 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex2=[backModel.timer2 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen2=[dataContorl hexStringToDateString:startTimeHex2];
|
||||
NSString*endTimeTen2=[dataContorl hexStringToDateString:endTimeHex2];
|
||||
NSString*setTim2=[NSString stringWithFormat:@"%@~%@",startTimeTen2,endTimeTen2];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex3=[backModel.timer3 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex3=[backModel.timer3 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen3=[dataContorl hexStringToDateString:startTimeHex3];
|
||||
NSString*endTimeTen3=[dataContorl hexStringToDateString:endTimeHex3];
|
||||
NSString*setTim3=[NSString stringWithFormat:@"%@~%@",startTimeTen3,endTimeTen3];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex4=[backModel.timer4 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex4=[backModel.timer4 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen4=[dataContorl hexStringToDateString:startTimeHex4];
|
||||
NSString*endTimeTen4=[dataContorl hexStringToDateString:endTimeHex4];
|
||||
NSString*setTim4=[NSString stringWithFormat:@"%@~%@",startTimeTen4,endTimeTen4];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex5=[backModel.timer5 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex5=[backModel.timer5 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen5=[dataContorl hexStringToDateString:startTimeHex5];
|
||||
NSString*endTimeTen5=[dataContorl hexStringToDateString:endTimeHex5];
|
||||
NSString*setTim5=[NSString stringWithFormat:@"%@~%@",startTimeTen5,endTimeTen5];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex6=[backModel.timer6 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex6=[backModel.timer6 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen6=[dataContorl hexStringToDateString:startTimeHex6];
|
||||
NSString*endTimeTen6=[dataContorl hexStringToDateString:endTimeHex6];
|
||||
NSString*setTim6=[NSString stringWithFormat:@"%@~%@",startTimeTen6,endTimeTen6];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex7=[backModel.timer7 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex7=[backModel.timer7 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen7=[dataContorl hexStringToDateString:startTimeHex7];
|
||||
NSString*endTimeTen7=[dataContorl hexStringToDateString:endTimeHex7];
|
||||
NSString*setTim7=[NSString stringWithFormat:@"%@~%@",startTimeTen7,endTimeTen7];
|
||||
|
||||
// 十六进制
|
||||
NSString*startTimeHex8=[backModel.timer8 substringWithRange:NSMakeRange(4, 4)];
|
||||
NSString*endTimeHex8=[backModel.timer8 substringWithRange:NSMakeRange(8, 4)];
|
||||
// 十进制
|
||||
NSString*startTimeTen8=[dataContorl hexStringToDateString:startTimeHex8];
|
||||
NSString*endTimeTen8=[dataContorl hexStringToDateString:endTimeHex8];
|
||||
NSString*setTim8=[NSString stringWithFormat:@"%@~%@",startTimeTen8,endTimeTen8];
|
||||
|
||||
timerArr=@[@[wenduString,@"设置时段"],@[setTim1,setTim2],@[setTim3,setTim4],@[setTim5,setTim6],@[setTim7,setTim8,@""]];
|
||||
|
||||
return timerArr;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// RuiMeiCHControl.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/22.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface RuiMeiCHControl : NSObject
|
||||
@property (nonatomic,copy) NSString *ch1name;
|
||||
@property (nonatomic,copy) NSString *ch2name;
|
||||
@property (nonatomic,copy) NSString *ch3name;
|
||||
@property (nonatomic,copy) NSString *ch4name;
|
||||
@property (nonatomic,copy) NSString *jiaRe;
|
||||
@property (nonatomic,copy) NSString *macAd;
|
||||
@end
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// RuiMeiCHControl.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/22.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RuiMeiCHControl.h"
|
||||
|
||||
@implementation RuiMeiCHControl
|
||||
|
||||
-(void)encodeWithCoder:(NSCoder*)aCoder{
|
||||
|
||||
[aCoder encodeObject:_ch1name forKey:@"ch1name"];
|
||||
[aCoder encodeObject:_ch2name forKey:@"ch2name"];
|
||||
[aCoder encodeObject:_ch3name forKey:@"ch3name"];
|
||||
[aCoder encodeObject:_ch4name forKey:@"ch4name"];
|
||||
[aCoder encodeObject:_macAd forKey:@"macaddress"];
|
||||
[aCoder encodeObject:_jiaRe forKey:@"jiaRe"];
|
||||
}
|
||||
|
||||
-(id)initWithCoder:(NSCoder*)aDecoder{
|
||||
if (self=[super init]) {
|
||||
self.ch1name=[aDecoder decodeObjectForKey:@"ch1name"];
|
||||
self.ch2name=[aDecoder decodeObjectForKey:@"ch2name"];
|
||||
self.ch3name=[aDecoder decodeObjectForKey:@"ch3name"];
|
||||
self.ch4name=[aDecoder decodeObjectForKey:@"ch4name"];
|
||||
self.macAd = [aDecoder decodeObjectForKey:@"macaddress"];
|
||||
self.jiaRe = [aDecoder decodeObjectForKey:@"jiaRe"];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// RuiMeiCHNameCustom.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/22.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RuiMeiCHControl.h"
|
||||
|
||||
@interface RuiMeiCHNameCustom : NSObject
|
||||
|
||||
+(void)saveCHname:(RuiMeiCHControl*)chModel;
|
||||
+(RuiMeiCHControl *)currentdevice:(NSString *)macaddress;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// RuiMeiCHNameCustom.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/22.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RuiMeiCHNameCustom.h"
|
||||
#import "UserExtendataArchaver.h"
|
||||
|
||||
@implementation RuiMeiCHNameCustom
|
||||
|
||||
+(void)saveCHname:(RuiMeiCHControl*)chModel
|
||||
{
|
||||
|
||||
[UserExtendataArchaver archiverRuiMeiDeviceCHInfo:chModel];
|
||||
|
||||
}
|
||||
|
||||
+(RuiMeiCHControl *)currentdevice:(NSString *)macaddress
|
||||
{
|
||||
RuiMeiCHControl *runsunCH = [UserExtendataArchaver unArchiverRuiMeiDeviceCHInfo:macaddress];
|
||||
if (!runsunCH||[runsunCH isKindOfClass:[NSNull class]]) {
|
||||
runsunCH = [[RuiMeiCHControl alloc] init];
|
||||
runsunCH.ch1name = @"S1";
|
||||
runsunCH.ch2name = @"S2";
|
||||
runsunCH.ch3name = @"UV/杀菌";
|
||||
runsunCH.ch4name = @"冲浪/氧泵";
|
||||
runsunCH.jiaRe = @"加热棒";
|
||||
runsunCH.macAd = macaddress;
|
||||
}
|
||||
return runsunCH;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
//
|
||||
// RuiMeiProtocolModel.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/14.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface RuiMeiProtocolModel : NSObject
|
||||
@property (nonatomic,copy) NSString *ch1;
|
||||
@property (nonatomic,copy) NSString *ch2;
|
||||
@property (nonatomic,copy) NSString *ch3;
|
||||
@property (nonatomic,copy) NSString *ch4;
|
||||
@property (nonatomic,copy) NSString *customModel;
|
||||
|
||||
@property(nonatomic,copy) NSString *timer1;
|
||||
@property(nonatomic,copy) NSString *timer2;
|
||||
@property(nonatomic,copy) NSString *timer3;
|
||||
@property(nonatomic,copy) NSString *timer4;
|
||||
@property(nonatomic,copy) NSString *timer5;
|
||||
@property(nonatomic,copy) NSString *timer6;
|
||||
@property(nonatomic,copy) NSString *timer7;
|
||||
@property(nonatomic,copy) NSString *timer8;
|
||||
@property(nonatomic,copy) NSString *heatStickState;
|
||||
@property(nonatomic,copy) NSString *wendu;
|
||||
// 加热温度
|
||||
@property(nonatomic,copy) NSString *heatTemperature;
|
||||
//室温
|
||||
@property(nonatomic,copy) NSString *shiwen;
|
||||
@property(nonatomic,copy) NSString *baojingSwitch;
|
||||
@property(nonatomic,copy) NSString *miniTp;
|
||||
@property(nonatomic,copy) NSString *maxTp;
|
||||
@property(nonatomic,copy) NSString *funcCode;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// RuiMeiProtocolModel.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/14.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RuiMeiProtocolModel.h"
|
||||
|
||||
@implementation RuiMeiProtocolModel
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// RuiMeiSetViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/22.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FatherController.h"
|
||||
|
||||
@interface RuiMeiSetViewController : FatherController
|
||||
{
|
||||
BOOL _isHidden;
|
||||
BOOL mySwitchIsOn;
|
||||
|
||||
}
|
||||
|
||||
@property(nonatomic,strong)NSArray*timeArr;
|
||||
@property(nonatomic,strong)NSArray*titleArr;
|
||||
@property(nonatomic)BOOL isAuto;// 自动模式
|
||||
|
||||
@property(nonatomic)UIActivityIndicatorView*indicatorView;
|
||||
|
||||
@property(nonatomic)int percent;
|
||||
@property(nonatomic,strong) DeviceModel* currentdevice;
|
||||
@property (nonatomic, assign) BOOL customModeOn;
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// RuiMeiViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/14.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CenterViewController.h"
|
||||
|
||||
//瑞美四控
|
||||
@interface RuiMeiViewController : CenterViewController
|
||||
@property(nonatomic,strong)UIButton*button;
|
||||
|
||||
@property(nonatomic,strong)UIButton *ch1Button;
|
||||
@property(nonatomic,strong)UIButton *ch2Button;
|
||||
@property(nonatomic,strong)UIButton *ch3Button;
|
||||
@property(nonatomic,strong)UIButton *ch4Button;
|
||||
|
||||
@property(nonatomic,strong) UILabel *chName;
|
||||
@property(nonatomic,strong) UILabel *ch1Name;
|
||||
@property(nonatomic,strong) UILabel *ch2Name;
|
||||
@property(nonatomic,strong) UILabel *ch3Name;
|
||||
@property(nonatomic,strong) UILabel *ch4Name;
|
||||
//S5 只控制温度
|
||||
@property(nonatomic,strong) UILabel *jiaReName;
|
||||
|
||||
@property(nonatomic,strong)UIButton*heatBtn;
|
||||
@property(nonatomic,strong) UILabel *hotcolLabe;
|
||||
@property(nonatomic,strong) UILabel *hotcolTempLabe;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,609 @@
|
|||
//
|
||||
// RuiMeiViewController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/14.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#define kPlace ([UIScreen mainScreen].bounds.size.width - btnWid*2) /4
|
||||
#define RUNSUN_CH1 6000
|
||||
#define RUNSUN_CH2 6001
|
||||
#define RUNSUN_CH3 6002
|
||||
#define RUNSUN_CH4 6003
|
||||
#define RUNSUN_JARE 6004
|
||||
|
||||
#define btnWid 100
|
||||
|
||||
#import "RuiMeiViewController.h"
|
||||
#import "RuiMeiProtocolModel.h"
|
||||
#import "RuiMeiBackMsgUtils.h"
|
||||
#import "XuToWenDuPicview.h"
|
||||
#import "RuSunLightOrder.h"
|
||||
#import "RuSunGuiDeng.h"
|
||||
#import "RunSun84CHSetViewController.h"
|
||||
#import "RuiMeiSetViewController.h"
|
||||
#import "RuiMeiCHControl.h"
|
||||
#import "RuiMeiCHNameCustom.h"
|
||||
#import "RuSunInpdViewController.h"
|
||||
#import "HaveHotCoolWenDuPicview.h"
|
||||
|
||||
@interface RuiMeiViewController ()<IfishCommuniteDelegate>
|
||||
{
|
||||
dispatch_queue_t _ruSunMainQueue;
|
||||
}
|
||||
@property(nonatomic,strong) RuiMeiProtocolModel *backmodel;
|
||||
@property(nonatomic,strong) HaveHotCoolWenDuPicview *wenduPicview;
|
||||
@property(nonatomic,strong) RuiMeiSetViewController *setVC;
|
||||
//@property(nonatomic,strong) RunSunChangeNameViewController *changenameVC;
|
||||
@property(nonatomic,strong) RuSunInpdViewController *changenameVC;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RuiMeiViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
||||
[super viewDidLoad];
|
||||
|
||||
_backmodel=[[RuiMeiProtocolModel alloc] init];
|
||||
[Socketsingleton sharedInstance].communiteDelegate=self;
|
||||
_ruSunMainQueue = dispatch_get_main_queue();
|
||||
// Do any additional setup after loading the view.
|
||||
UITapGestureRecognizer*tapgestureRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(RuSunCenterViewSetTap)];
|
||||
[self.setImag addGestureRecognizer:tapgestureRecognizer];
|
||||
[self.setbackBtn addTarget:self action:@selector(RuSunCenterViewSetAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.SetTimeButton addTarget:self action:@selector(RuSunCenterViewSetAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
[self initControlNormalBtn];
|
||||
}
|
||||
|
||||
-(void)RuSunCenterViewSetTap
|
||||
{
|
||||
|
||||
RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey];
|
||||
|
||||
if (backmodel) {
|
||||
[self pushSetTimeVC];
|
||||
}else{
|
||||
[self deviceNotOnlineState];
|
||||
|
||||
[self showLableAction:@"设备已离线"];
|
||||
|
||||
[self.indicatorView stopAnimating];
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -转跳设置界面
|
||||
|
||||
-(void)RuSunCenterViewSetAction:(UIButton*)btn
|
||||
{
|
||||
RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey];
|
||||
if (backmodel) {
|
||||
[self pushSetTimeVC];
|
||||
}else{
|
||||
[self deviceNotOnlineState];
|
||||
|
||||
[self showLableAction:@"设备已离线"];
|
||||
|
||||
[self.indicatorView stopAnimating];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)pushSetTimeVC{
|
||||
|
||||
self.setVC=[[RuiMeiSetViewController alloc]init];
|
||||
|
||||
self.setVC.currentdevice=self.currentDevice;
|
||||
NSString*stateString=[self.backmodel.customModel substringWithRange:NSMakeRange(2, 2)];
|
||||
if ([stateString isEqualToString:@"01"]) {
|
||||
self.setVC.customModeOn=YES;
|
||||
}else{
|
||||
self.setVC.customModeOn=NO;
|
||||
}
|
||||
[self.navigationController pushViewController:self.setVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void)initControlNormalBtn
|
||||
{
|
||||
|
||||
NSArray*nameArr=@[@"PFLight1_off.png",@"PFLight1_off.png",@"PFkilLlight_off.png",@"O2_off.png",@"JiaReBang_off"];
|
||||
|
||||
CGFloat btnControlWith = 70;
|
||||
CGFloat btnControlPlace = (kScreenSize.width - 3*btnControlWith )/4;
|
||||
|
||||
for (int i = 0; i < 3; i ++) {
|
||||
|
||||
self.button = [[UIButton alloc] init] ;
|
||||
self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -10 - 10 , btnControlWith, btnControlWith +11);
|
||||
|
||||
[self.button setImage:[UIImage imageNamed:nameArr[i]] forState:UIControlStateNormal];
|
||||
//self.button.backgroundColor = [UIColor redColor];
|
||||
self.button.tag=6000+i;
|
||||
[self.button addTarget:self action:@selector(controlBtnCilck:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
|
||||
self.chName = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -20 + btnControlWith -5 , btnControlWith, btnControlPlace - 5)];
|
||||
//textLbl.backgroundColor = [UIColor blackColor];
|
||||
self.chName.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1];
|
||||
self.chName.textAlignment = NSTextAlignmentCenter;
|
||||
NSArray *arr = @[@"S1",@"S2",@"UV/杀菌"];
|
||||
self.chName.text = arr[i];
|
||||
|
||||
self.chName.font = [UIFont boldSystemFontOfSize:14];
|
||||
|
||||
[self.tableView addSubview:self.chName];
|
||||
[self.tableView addSubview:self.button];
|
||||
|
||||
if (i==0) {
|
||||
|
||||
self.ch1Button = self.button;
|
||||
self.ch1Name = self.chName;
|
||||
}else if (i==1){
|
||||
|
||||
self.ch2Button = self.button;
|
||||
self.ch2Name = self.chName;
|
||||
|
||||
}else if (i==2){
|
||||
self.ch3Name = self.chName;
|
||||
self.ch3Button = self.button;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//CGFloat btnControlPlace1 = (kScreenSize.width - 2*btnControlWith )/3;
|
||||
|
||||
for (int i = 0; i < 2; i ++) {
|
||||
self.button = [[UIButton alloc] init] ;
|
||||
self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -25 -5 , btnControlWith, btnControlWith + 11);
|
||||
|
||||
|
||||
[self.button setImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal];
|
||||
|
||||
self.button.tag= 6003+i;
|
||||
[self.button addTarget:self action:@selector(controlBtnCilck:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -35 + btnControlWith, btnControlWith, btnControlPlace - 5)];
|
||||
//textLbl.backgroundColor = [UIColor blackColor];
|
||||
textLbl.textAlignment = NSTextAlignmentCenter;
|
||||
textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1];
|
||||
NSArray *arr = @[@"冲浪/氧泵",@"加热棒"];
|
||||
textLbl.font = [UIFont boldSystemFontOfSize:14];
|
||||
textLbl.text = arr[i];
|
||||
self.chName = textLbl;
|
||||
[self.tableView addSubview:textLbl];
|
||||
[self.tableView addSubview:self.button];
|
||||
|
||||
if (i==0) {
|
||||
|
||||
self.ch4Button = self.button;
|
||||
self.ch4Name = self.chName;
|
||||
} else if (i==1){
|
||||
self.heatBtn = self.button;
|
||||
self.jiaReName = self.chName;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//重置 self.bubble 的 frame
|
||||
CGFloat animViewHeight= kScreenSize.width/4;
|
||||
if (kScreenSize.height==480) {
|
||||
|
||||
self.bubble.frame = CGRectMake((kScreenSize.width -(kScreenSize.width - 2 * kPlace)*2/3)/2, kPlace + 60 , (kScreenSize.width - 2 * kPlace)*2/3, (kScreenSize.width - 2 * kPlace)*2/3);
|
||||
|
||||
//(kScreenSize.width - 2 * kPlace - 200)*2/3
|
||||
self.temperature.frame = CGRectMake(30, 70, (kScreenSize.width - 2 * kPlace - 100)*2/3, 50);
|
||||
self.temperature.font = [UIFont fontWithName:@"Avenir Next Condensed" size:46];
|
||||
|
||||
self.dulabel.frame = CGRectMake( (kScreenSize.width - 2 * kPlace - 100)*2/3,74,50, kScreenSize.width - 2 * kPlace - 210);
|
||||
|
||||
|
||||
self.dulabel.font = [UIFont fontWithName:@"Avenir Next Condensed" size:20];
|
||||
|
||||
self.animView.frame= CGRectMake(0, kPlace + 80 + (kScreenSize.width - 2 * kPlace) -animViewHeight/2 - 15-80, kScreenSize.width, animViewHeight);
|
||||
|
||||
self.notOnLineLabel.frame = CGRectMake(40, 60, kScreenSize.width - 2 * kPlace - 100, kScreenSize.width - 2 * kPlace - 200);
|
||||
self.notOnLineLabel .font = [UIFont fontWithName:@"Avenir Next Condensed" size:15];
|
||||
|
||||
self.hotcolLabe = [[UILabel alloc] init];
|
||||
self.hotcolLabe.frame = CGRectMake(0, CGRectGetMaxY(self.temperature.frame) + 10, self.bubble.frame.size.width, 15);
|
||||
//self.hotcolLabe.textColor = JWUIColorFromRGB(fc6638);
|
||||
self.hotcolLabe.textAlignment = NSTextAlignmentCenter;
|
||||
self.hotcolLabe.font =[UIFont systemFontOfSize:13];
|
||||
self.hotcolLabe.text = @"制冷加热";
|
||||
[self.bubble addSubview:self.hotcolLabe];
|
||||
|
||||
self.hotcolTempLabe = [[UILabel alloc] init];
|
||||
self.hotcolTempLabe.frame = CGRectMake(0, CGRectGetMaxY(self.hotcolLabe.frame) + 5, self.bubble.frame.size.width, 15);
|
||||
self.hotcolTempLabe.font =[UIFont systemFontOfSize:14];
|
||||
self.hotcolTempLabe.textAlignment = NSTextAlignmentCenter;
|
||||
self.hotcolTempLabe.textColor = JWUIColorFromRGB(0x666666);
|
||||
self.hotcolTempLabe.text = @"温度";
|
||||
[self.bubble addSubview:self.hotcolTempLabe];
|
||||
|
||||
|
||||
}else{
|
||||
//kScreenSize.width - 2 * kPlace - 200
|
||||
self.temperature.frame = CGRectMake(10, 80, kScreenSize.width - 2 * kPlace - 100,70);
|
||||
self.temperature.font = [UIFont fontWithName:@"Avenir Next Condensed" size:60];
|
||||
|
||||
self.bubble.frame = CGRectMake((kScreenSize.width -(kScreenSize.width - 3 * kPlace ))/2, kPlace + 80 , kScreenSize.width - 3 * kPlace, kScreenSize.width - 3 * kPlace);
|
||||
|
||||
self.dulabel.frame = CGRectMake((kScreenSize.width - 2 * kPlace)/3*2 -30 , 90 ,50, 60);
|
||||
self.dulabel.font = [UIFont fontWithName:@"Avenir Next Condensed" size:40];
|
||||
self.animView.frame= CGRectMake(0, kPlace + 40 + (kScreenSize.width - 2 * kPlace) -animViewHeight/2 - 15, kScreenSize.width, animViewHeight);
|
||||
|
||||
CGFloat bubH=kScreenSize.width - 3 * kPlace;
|
||||
self.notOnLineLabel.frame = CGRectMake(0,bubH/2-15, bubH, 30);
|
||||
self.notOnLineLabel .font = [UIFont fontWithName:@"Avenir Next Condensed" size:20];
|
||||
|
||||
self.hotcolLabe = [[UILabel alloc] init];
|
||||
self.hotcolLabe.frame = CGRectMake(0, CGRectGetMaxY(self.temperature.frame) + 10, self.bubble.frame.size.width, 15);
|
||||
//self.hotcolLabe.textColor = JWUIColorFromRGB(fc6638);
|
||||
self.hotcolLabe.textAlignment = NSTextAlignmentCenter;
|
||||
self.hotcolLabe.font =[UIFont systemFontOfSize:13];
|
||||
[self.bubble addSubview:self.hotcolLabe];
|
||||
|
||||
self.hotcolTempLabe = [[UILabel alloc] init];
|
||||
self.hotcolTempLabe.frame = CGRectMake(0, CGRectGetMaxY(self.hotcolLabe.frame) + 5, self.bubble.frame.size.width, 15);
|
||||
self.hotcolTempLabe.font =[UIFont systemFontOfSize:14];
|
||||
self.hotcolTempLabe.textAlignment = NSTextAlignmentCenter;
|
||||
self.hotcolTempLabe.textColor = JWUIColorFromRGB(0x666666);
|
||||
self.hotcolTempLabe.text = @"温度";
|
||||
[self.bubble addSubview:self.hotcolTempLabe];
|
||||
}
|
||||
|
||||
[self initCHNames];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - 控制按钮事件
|
||||
|
||||
-(void)controlBtnCilck:(UIButton *)btn{
|
||||
|
||||
RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey];
|
||||
if (backmodel) {
|
||||
|
||||
|
||||
}else{
|
||||
[self.indicatorView stopAnimating];
|
||||
[self deviceNotOnlineState];
|
||||
[self showLableAction:@"设备已离线"];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *lightSate;
|
||||
if (btn.selected) {
|
||||
lightSate=@"00";
|
||||
btn.selected=NO;
|
||||
|
||||
}else {
|
||||
lightSate=@"01";
|
||||
btn.selected=YES;
|
||||
}
|
||||
|
||||
switch (btn.tag) {
|
||||
|
||||
case RUNSUN_CH1:
|
||||
{
|
||||
btn.userInteractionEnabled=YES;
|
||||
[btn setImage:[UIImage imageNamed:@"PFLight1_on.png"] forState:UIControlStateSelected];
|
||||
[self sendOffOnLinghtCommend:@"01" liaghtState:lightSate];
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case RUNSUN_CH2:
|
||||
{
|
||||
btn.userInteractionEnabled=YES;
|
||||
[btn setImage:[UIImage imageNamed:@"PFLight1_on.png"] forState:UIControlStateSelected];
|
||||
[self sendOffOnLinghtCommend:@"02" liaghtState:lightSate];
|
||||
}
|
||||
break;
|
||||
case RUNSUN_CH3:
|
||||
{
|
||||
btn.userInteractionEnabled=YES;
|
||||
[btn setImage:[UIImage imageNamed:@"PFkilLlight_on.png"] forState:UIControlStateSelected];
|
||||
[self sendOffOnLinghtCommend:@"03" liaghtState:lightSate];
|
||||
}
|
||||
break;
|
||||
case RUNSUN_CH4:
|
||||
{
|
||||
btn.userInteractionEnabled=YES;
|
||||
[btn setImage:[UIImage imageNamed:@"O2_on.png"] forState:UIControlStateSelected];
|
||||
[self sendOffOnLinghtCommend:@"04" liaghtState:lightSate];
|
||||
}
|
||||
break;
|
||||
case RUNSUN_JARE:
|
||||
{
|
||||
if (backmodel) {
|
||||
_wenduPicview=[[HaveHotCoolWenDuPicview alloc] init];
|
||||
_wenduPicview.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height);
|
||||
[_wenduPicview.sureBtn addTarget:self action:@selector(sureBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
[self.view.window addSubview:_wenduPicview];
|
||||
_wenduPicview.wenDuPicviewDelegate = self;
|
||||
NSString *stateStr =nil;
|
||||
if ([backmodel.heatStickState isKindOfClass:[NSNull class]]||!backmodel.heatStickState) {
|
||||
backmodel.heatStickState = @"00";
|
||||
}
|
||||
stateStr = [backmodel.heatStickState substringWithRange:NSMakeRange(0, 2)];
|
||||
[_wenduPicview initCateBtnSate:stateStr];
|
||||
|
||||
[self ruSunJiaReMianQue];
|
||||
|
||||
}else{
|
||||
|
||||
[self showLableAction:@"设备已离线"];
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 发送开关灯指令
|
||||
-(void)sendOffOnLinghtCommend:(NSString *)linghtNumber liaghtState:(NSString *)state
|
||||
{
|
||||
//此款设备无运行模式
|
||||
RuSunLightOrder*lightOrder=[[RuSunLightOrder alloc]init];
|
||||
lightOrder.sendmacId = self.currentDevice.macAddress;
|
||||
lightOrder.resavemacId = self.currentDevice.macAddress;
|
||||
NSString*switchString1=lightOrder.description;
|
||||
lightOrder.switchBtn = state;
|
||||
lightOrder.crc16Str=@"0000";
|
||||
lightOrder.lightNumber=linghtNumber;
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightOrder.lightNumber,lightOrder.switchBtn,lightOrder.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[ [Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
if ([Socketsingleton sharedInstance].clientSocket.isConnected) {
|
||||
//soket 未断开时显示
|
||||
[self initHUD];
|
||||
[self.myhud myhudstart];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -发送柜灯指令
|
||||
-(void)sendGuiDengCommend:(NSString *)lightSate
|
||||
{
|
||||
|
||||
|
||||
RuSunGuiDeng*guidengModel=[[RuSunGuiDeng alloc]init];
|
||||
guidengModel.resavemacId = self.currentDevice.macAddress;
|
||||
guidengModel.sendmacId = self.currentDevice.macAddress;
|
||||
guidengModel.crc16Str=@"0000";
|
||||
guidengModel.onOff=lightSate;
|
||||
|
||||
NSString* guidengOrder=[NSString stringWithFormat:@"%@%@%@",guidengModel.description,guidengModel.onOff,guidengModel.crc16Str];
|
||||
NSData*guidengData=[dataContorl stringToHexData:guidengOrder];
|
||||
[[Socketsingleton sharedInstance] soketWriteData:guidengData];
|
||||
|
||||
if ([Socketsingleton sharedInstance].clientSocket.isConnected) {
|
||||
//soket 未断开时显示
|
||||
[self initHUD];
|
||||
[self.myhud myhudstart];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -加热制冷温度选择
|
||||
|
||||
-(void)sureBtnClick:(UIButton *)btn{
|
||||
|
||||
NSLog(@"%@******** _wenduPicview.picViewResultString",_wenduPicview.picViewResultString);
|
||||
if (_wenduPicview.picViewResultString ==nil) {
|
||||
|
||||
[_wenduPicview removeFromSuperview];
|
||||
|
||||
}else{
|
||||
|
||||
JiaReWenDuModel *model=[[JiaReWenDuModel alloc] init];
|
||||
model.resavemacId = self.currentDevice.macAddress;
|
||||
model.sendmacId = self.currentDevice.macAddress;
|
||||
int intlowString = [_wenduPicview.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];
|
||||
}
|
||||
|
||||
[_wenduPicview removeFromSuperview];
|
||||
|
||||
}
|
||||
|
||||
-(void)ruSunJiaReMianQue
|
||||
{
|
||||
RuiMeiProtocolModel*backmodel=[[DataCenter defaultDtacenter]valueForKey:DataCenterRuiMeiModelKey];
|
||||
UInt64 mac=[dataContorl hexToTen:backmodel.heatTemperature];
|
||||
NSLog(@"%llu",mac);
|
||||
float TPlabel=mac/10;
|
||||
int temp= (int)(TPlabel+0.5);
|
||||
NSString *stringFloat = [NSString stringWithFormat:@"%d",temp];
|
||||
NSLog(@"%@",stringFloat);
|
||||
NSArray*wenDuArr=[_wenduPicview.picArr objectAtIndex:0];
|
||||
|
||||
dispatch_async(_ruSunMainQueue, ^{
|
||||
for (NSInteger i=0; i<wenDuArr.count; i++) {
|
||||
|
||||
NSString*picString=wenDuArr[i];
|
||||
|
||||
if ([picString isEqualToString:stringFloat ] ) {
|
||||
|
||||
[_wenduPicview.pic selectRow:i inComponent:0 animated:NO];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
#pragma mark - 登陆成功后收到服务端的回执之后,调用的代理方法
|
||||
-(void)socketDidGetBackmsgData:(NSData *)data onsoket:(AsyncSocket *)sock{
|
||||
|
||||
[self.indicatorView stopAnimating];
|
||||
self.temperature.hidden=NO;
|
||||
//设备在线显示与设备离线相对应
|
||||
self.dulabel.hidden=NO;
|
||||
//设备在线显示与设备离线相对应 收到返回数据改变显示状态
|
||||
self.notOnLineLabel.hidden = YES;
|
||||
self.temperaturebackImg.hidden=NO;
|
||||
self.hotcolTempLabe.hidden = NO;
|
||||
self.hotcolLabe.hidden = NO;
|
||||
|
||||
[self.myhud hidmyHud];
|
||||
if (self.setVC.indicatorView) {
|
||||
[self.setVC.indicatorView stopAnimating];
|
||||
}
|
||||
//存储
|
||||
[RuiMeiBackMsgUtils readSoketDataWithBaackMassgModel:_backmodel addWithBackData:data];
|
||||
|
||||
// 温度 等状态
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.setVC) {
|
||||
NSString*stateString=[self.backmodel.customModel substringWithRange:NSMakeRange(2, 2)];
|
||||
if ([stateString isEqualToString:@"01"]) {
|
||||
self.setVC.customModeOn=YES;
|
||||
}else{
|
||||
self.setVC.customModeOn=NO;
|
||||
}
|
||||
}
|
||||
[RuiMeiBackMsgUtils setTemperaturelabel:self.temperature addbubleImge:self.bubble WithBackData:data addWithBackMassageModel:_backmodel addWithTableview:self.tableView];
|
||||
|
||||
[RuiMeiBackMsgUtils resetRuSunCHState:_ch1Button ch2:_ch2Button ch3:_ch3Button ch4:_ch4Button andJiaRe:_heatBtn withBackModel:_backmodel ];
|
||||
|
||||
|
||||
if (!_backmodel.heatStickState) {
|
||||
_backmodel.heatStickState = @"00";
|
||||
}
|
||||
NSString*stateString=[_backmodel.heatStickState substringWithRange:NSMakeRange(0, IFISH_LIGHTBTN_BYTE)];
|
||||
if ([stateString isEqualToString:@"00"]) {
|
||||
//00加热
|
||||
self.hotcolLabe.text = [NSString stringWithFormat:@"-加热-"];
|
||||
self.hotcolLabe.textColor = JWUIColorFromRGB(0xfc6638);
|
||||
|
||||
|
||||
}else{
|
||||
//01制冷
|
||||
self.hotcolLabe.text = [NSString stringWithFormat:@"-室内温度-"];
|
||||
self.hotcolLabe.textColor = JWUIColorFromRGB(0x38b9fc);
|
||||
|
||||
}
|
||||
|
||||
if (!_backmodel.heatStickState) {
|
||||
_backmodel.heatStickState = @"00";
|
||||
}
|
||||
UInt64 mac=[dataContorl hexToTen:_backmodel.heatTemperature];
|
||||
float TPlabel=mac/10;
|
||||
int temp= (int)(TPlabel+0.5);
|
||||
NSString *stringFloat = [NSString stringWithFormat:@"%d°C",temp];
|
||||
NSLog(@"制冷加热温度%@",stringFloat);
|
||||
|
||||
self.hotcolTempLabe.text = stringFloat;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// 刷新设置界面
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
if (self.setVC) {
|
||||
self.setVC.timeArr= [RuiMeiBackMsgUtils refreshRuSunTimerAddTemperatureWithBackMassageModel:_backmodel];
|
||||
[self.setVC.tableView reloadData];
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
-(void)ifishDeviceLogInSuccees{
|
||||
self.isconnect=YES;
|
||||
NSLog(@"设备登录成功");
|
||||
|
||||
}
|
||||
-(void)ifishDeviceLogInFail{
|
||||
|
||||
[self endRefreshing];
|
||||
[self.indicatorView stopAnimating];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self deviceNotOnlineState];//设备离线
|
||||
self.hotcolTempLabe.hidden = YES;
|
||||
self.hotcolLabe.hidden = YES;
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark -父类方法
|
||||
-(void)shezhiMingCheng
|
||||
{
|
||||
|
||||
//_changenameVC = [[RunSunChangeNameViewController alloc] init];
|
||||
|
||||
_changenameVC = [[RuSunInpdViewController alloc] init];
|
||||
_changenameVC.name = self.name.text;
|
||||
_changenameVC.device = self.currentDevice;
|
||||
__weak typeof (self)wself = self;
|
||||
|
||||
_changenameVC.NameWithBlock = ^(NSString *nameStr){
|
||||
wself.name.text = nameStr;
|
||||
[wself initCHNames];
|
||||
};
|
||||
[ wself.navigationController pushViewController: _changenameVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
-(void)initCHNames{
|
||||
|
||||
RuiMeiCHControl * ruSunCH = [RuiMeiCHNameCustom currentdevice:self.currentDevice.macAddress];
|
||||
self.ch1Name.text = ruSunCH.ch1name;
|
||||
self.ch2Name.text = ruSunCH.ch2name;
|
||||
self.ch3Name.text = ruSunCH.ch3name;
|
||||
self.ch4Name.text = ruSunCH.ch4name;
|
||||
self.jiaReName.text = ruSunCH.jiaRe;
|
||||
|
||||
}
|
||||
#pragma mark - 制冷制热指令
|
||||
-(void)didSelectCoolOrHeat:(NSString *)hotCool{
|
||||
//由s5 控制 原理同灯
|
||||
RuSunLightOrder*lightOrder=[[RuSunLightOrder alloc]init];
|
||||
lightOrder.sendmacId = self.currentDevice.macAddress;
|
||||
lightOrder.resavemacId = self.currentDevice.macAddress;
|
||||
NSString*switchString1=lightOrder.description;
|
||||
lightOrder.switchBtn = hotCool;
|
||||
lightOrder.crc16Str=@"0000";
|
||||
lightOrder.lightNumber=@"05";
|
||||
|
||||
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString1,lightOrder.lightNumber,lightOrder.switchBtn,lightOrder.crc16Str];
|
||||
NSData*manulData=[dataContorl stringToHexData:switchString2];
|
||||
[ [Socketsingleton sharedInstance] soketWriteData:manulData];
|
||||
if ([Socketsingleton sharedInstance].clientSocket.isConnected) {
|
||||
//soket 未断开时显示
|
||||
[self initHUD];
|
||||
[self.myhud myhudstart];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Binary file not shown.
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// CustomModeSetCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/22.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface CustomModeSetCell : UITableViewCell
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *customModeTitleLbl;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *switchControl;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// CustomModeSetCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/22.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CustomModeSetCell.h"
|
||||
|
||||
@implementation CustomModeSetCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
// Initialization code
|
||||
self.backgroundView=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"set_cellBack"]];
|
||||
UIView *clearView=[[UIView alloc] init];
|
||||
clearView.backgroundColor=[UIColor clearColor];
|
||||
clearView.frame=self.bounds;
|
||||
|
||||
self.customModeTitleLbl.font = [UIFont systemFontOfSize:15];
|
||||
[self.customModeTitleLbl sizeToFit];
|
||||
|
||||
[self setSelectedBackgroundView:clearView];
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="GuiDengViewCell" rowHeight="43" id="KGk-i7-Jjw" customClass="CustomModeSetCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="327" height="48"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="327" height="47.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="自定义模式开关" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fae-Uc-c7P">
|
||||
<rect key="frame" x="18" y="18" width="110" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="9ho-ka-f9n"/>
|
||||
<constraint firstAttribute="width" constant="110" id="txm-ZH-wUN"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SAe-jT-rxs">
|
||||
<rect key="frame" x="254" y="11" width="60" height="33"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="33" id="oLF-cT-z4c"/>
|
||||
<constraint firstAttribute="width" constant="60" id="wIB-9g-a0X"/>
|
||||
</constraints>
|
||||
<state key="normal" backgroundImage="graybtn_big.png"/>
|
||||
<state key="selected" backgroundImage="greenbtn_big.png"/>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="SAe-jT-rxs" secondAttribute="trailing" constant="5" id="2Wi-iL-Sfn"/>
|
||||
<constraint firstItem="SAe-jT-rxs" firstAttribute="leading" secondItem="Fae-Uc-c7P" secondAttribute="trailing" constant="126" id="56D-Mp-Xah"/>
|
||||
<constraint firstItem="Fae-Uc-c7P" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="10" id="dWK-xq-pxG"/>
|
||||
<constraint firstItem="SAe-jT-rxs" firstAttribute="centerY" secondItem="Fae-Uc-c7P" secondAttribute="centerY" id="g0F-O6-5GU"/>
|
||||
<constraint firstItem="SAe-jT-rxs" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" id="gzX-So-xGM"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="customModeTitleLbl" destination="Fae-Uc-c7P" id="V49-Eh-YgL"/>
|
||||
<outlet property="switchControl" destination="SAe-jT-rxs" id="vNc-Nb-a3D"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="252.5" y="226"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="graybtn_big.png" width="172" height="94"/>
|
||||
<image name="greenbtn_big.png" width="172" height="94"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
|
@ -1,9 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
|
|
@ -12,32 +16,32 @@
|
|||
<rect key="frame" x="0.0" y="0.0" width="336" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="336" height="50"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="336" height="50.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ldH-Zi-Nv3">
|
||||
<rect key="frame" x="205" y="17" width="38" height="18"/>
|
||||
<rect key="frame" x="197" y="14" width="38" height="18"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" red="0.45490196078431372" green="0.45490196078431372" blue="0.45490196078431372" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.45490196078431372" green="0.45490196078431372" blue="0.45490196078431372" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0CU-uJ-mzK">
|
||||
<rect key="frame" x="18" y="14" width="87" height="21"/>
|
||||
<rect key="frame" x="26" y="17" width="87" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="87" id="uWM-a2-TdU"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" red="0.12156862745098039" green="0.12156862745098039" blue="0.12156862745098039" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.12156862745098039" green="0.12156862745098039" blue="0.12156862745098039" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="U9D-Nd-wVC">
|
||||
<rect key="frame" x="263" y="8" width="60" height="33"/>
|
||||
<rect key="frame" x="255" y="8" width="60" height="33"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="33" id="QNA-2E-zkO"/>
|
||||
<constraint firstAttribute="width" constant="60" id="jL2-Td-vJx"/>
|
||||
</constraints>
|
||||
<state key="normal" backgroundImage="graybtn_big.png">
|
||||
<color key="titleColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
</button>
|
||||
</subviews>
|
||||
|
|
|
|||
Loading…
Reference in New Issue