测试修改

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

View File

@ -2234,6 +2234,8 @@
88F5EFD81D48D08100CC7CAF /* MMVectorImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF591D48D08100CC7CAF /* MMVectorImage.m */; }; 88F5EFD81D48D08100CC7CAF /* MMVectorImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF591D48D08100CC7CAF /* MMVectorImage.m */; };
88F5EFD91D48D08100CC7CAF /* MyControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF5C1D48D08100CC7CAF /* MyControl.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 88F5EFD91D48D08100CC7CAF /* MyControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF5C1D48D08100CC7CAF /* MyControl.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
88F740C01ECC28E800876AED /* ShopAddGoodsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */; }; 88F740C01ECC28E800876AED /* ShopAddGoodsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */; };
C017B1E2245ED2D4003151DF /* UIImage+WaterMark.h in Headers */ = {isa = PBXBuildFile; fileRef = C017B1E0245ED2D3003151DF /* UIImage+WaterMark.h */; };
C017B1E3245ED2D4003151DF /* UIImage+WaterMark.m in Sources */ = {isa = PBXBuildFile; fileRef = C017B1E1245ED2D4003151DF /* UIImage+WaterMark.m */; };
C024B79E2379668B00509424 /* NSArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B78A2379668B00509424 /* NSArray+AvoidCrash.m */; }; C024B79E2379668B00509424 /* NSArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B78A2379668B00509424 /* NSArray+AvoidCrash.m */; };
C024B79F2379668B00509424 /* AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B78B2379668B00509424 /* AvoidCrash.h */; }; C024B79F2379668B00509424 /* AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B78B2379668B00509424 /* AvoidCrash.h */; };
C024B7A02379668B00509424 /* NSString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B78C2379668B00509424 /* NSString+AvoidCrash.m */; }; C024B7A02379668B00509424 /* NSString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B78C2379668B00509424 /* NSString+AvoidCrash.m */; };
@ -5684,6 +5686,8 @@
88F5EF5C1D48D08100CC7CAF /* MyControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyControl.m; sourceTree = "<group>"; }; 88F5EF5C1D48D08100CC7CAF /* MyControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyControl.m; sourceTree = "<group>"; };
88F740BE1ECC28E800876AED /* ShopAddGoodsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopAddGoodsViewController.h; 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>"; }; 88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopAddGoodsViewController.m; sourceTree = "<group>"; };
C017B1E0245ED2D3003151DF /* UIImage+WaterMark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+WaterMark.h"; sourceTree = "<group>"; };
C017B1E1245ED2D4003151DF /* UIImage+WaterMark.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+WaterMark.m"; sourceTree = "<group>"; };
C024B78A2379668B00509424 /* NSArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+AvoidCrash.m"; sourceTree = "<group>"; }; C024B78A2379668B00509424 /* NSArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+AvoidCrash.m"; sourceTree = "<group>"; };
C024B78B2379668B00509424 /* AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrash.h; sourceTree = "<group>"; }; C024B78B2379668B00509424 /* AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrash.h; sourceTree = "<group>"; };
C024B78C2379668B00509424 /* NSString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AvoidCrash.m"; sourceTree = "<group>"; }; C024B78C2379668B00509424 /* NSString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AvoidCrash.m"; sourceTree = "<group>"; };
@ -12208,6 +12212,8 @@
C0837A54244FF5500034FEC5 /* EGOCache */ = { C0837A54244FF5500034FEC5 /* EGOCache */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C017B1E0245ED2D3003151DF /* UIImage+WaterMark.h */,
C017B1E1245ED2D4003151DF /* UIImage+WaterMark.m */,
C0837A55244FF5500034FEC5 /* EGOCache.m */, C0837A55244FF5500034FEC5 /* EGOCache.m */,
C0837A56244FF5500034FEC5 /* EGOCache.h */, C0837A56244FF5500034FEC5 /* EGOCache.h */,
); );
@ -13026,6 +13032,7 @@
CB484E0E22B8C8C80075F050 /* version.h in Headers */, CB484E0E22B8C8C80075F050 /* version.h in Headers */,
3D1C50E4221A9EE00096AE43 /* config.h in Headers */, 3D1C50E4221A9EE00096AE43 /* config.h in Headers */,
CBB0243223517947002900D5 /* NSObject+MJProperty.h in Headers */, CBB0243223517947002900D5 /* NSObject+MJProperty.h in Headers */,
C017B1E2245ED2D4003151DF /* UIImage+WaterMark.h in Headers */,
3D1C5104221A9EE00096AE43 /* YooseConnectFirstViewController.h in Headers */, 3D1C5104221A9EE00096AE43 /* YooseConnectFirstViewController.h in Headers */,
CB484E1E22B8C8C90075F050 /* P2PCInterface.h in Headers */, CB484E1E22B8C8C90075F050 /* P2PCInterface.h in Headers */,
3D1C5127221A9EE00096AE43 /* IfishCameraRecordSecondCell.h in Headers */, 3D1C5127221A9EE00096AE43 /* IfishCameraRecordSecondCell.h in Headers */,
@ -15467,6 +15474,7 @@
E51D7D5B208CF4E7001FF053 /* RuiMeiInputViewController.m in Sources */, E51D7D5B208CF4E7001FF053 /* RuiMeiInputViewController.m in Sources */,
881672241EA5DE2B00BEBF23 /* UMComSelectTopicCell.m in Sources */, 881672241EA5DE2B00BEBF23 /* UMComSelectTopicCell.m in Sources */,
FAFC08242279CB5900B5A07B /* SetTimerCell.m in Sources */, FAFC08242279CB5900B5A07B /* SetTimerCell.m in Sources */,
C017B1E3245ED2D4003151DF /* UIImage+WaterMark.m in Sources */,
3D1C5097221A9EDF0096AE43 /* TabView.m in Sources */, 3D1C5097221A9EDF0096AE43 /* TabView.m in Sources */,
88696FBD1E9C7215005D4AFB /* MemberDetailViewController.m in Sources */, 88696FBD1E9C7215005D4AFB /* MemberDetailViewController.m in Sources */,
8816722C1EA5DE2B00BEBF23 /* UMComSimpleFeedTableViewController.m in Sources */, 8816722C1EA5DE2B00BEBF23 /* UMComSimpleFeedTableViewController.m in Sources */,
@ -15689,7 +15697,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
@ -15807,7 +15815,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -70,7 +70,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>3</string> <string>$(CURRENT_PROJECT_VERSION)</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>

View File

@ -0,0 +1,81 @@
//
// UIImage+WaterMark.h
// PictureWatermark
//
// Created by AD-iOS on 15/8/3.
// Copyright (c) 2015年 Adinnet. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (WaterMark)
/**
*
*
* @param image
* @param imgRect
* @param alpha 0~1
*
* @return
*/
- (UIImage*)imageWaterMarkWithImage:(UIImage *)image imageRect:(CGRect)imgRect alpha:(CGFloat)alpha;
/**
*
*
* @param image
* @param imgPoint 00
* @param alpha
*
* @return
*/
- (UIImage*)imageWaterMarkWithImage:(UIImage*)image imagePoint:(CGPoint)imgPoint alpha:(CGFloat)alpha;
/**
*
*
* @param str
* @param strRect
* @param attri
*
* @return
*/
- (UIImage*)imageWaterMarkWithString:(NSString*)str rect:(CGRect)strRect attribute:(NSDictionary *)attri;
/**
*
*
* @param str
* @param strPoint 00
* @param attri
*
* @return
*/
- (UIImage*)imageWaterMarkWithString:(NSString*)str point:(CGPoint)strPoint attribute:(NSDictionary*)attri;
/**
*
*
* @param str
* @param strPoint 00
* @param attri
* @param image
* @param imgPoint 00
* @param alpha
*
* @return
*/
- (UIImage*)imageWaterMarkWithString:(NSString*)str point:(CGPoint)strPoint attribute:(NSDictionary*)attri image:(UIImage*)image imagePoint:(CGPoint)imgPoint alpha:(CGFloat)alpha;
/**
*
*
* @param str
* @param strRect
* @param attri
* @param image
* @param imgRect
* @param alpha
*
* @return
*/
- (UIImage*)imageWaterMarkWithString:(NSString*)str rect:(CGRect)strRect attribute:(NSDictionary *)attri image:(UIImage *)image imageRect:(CGRect)imgRect alpha:(CGFloat)alpha;
@end

View File

@ -0,0 +1,70 @@
//
// UIImage+WaterMark.m
// PictureWatermark
//
// Created by AD-iOS on 15/8/3.
// Copyright (c) 2015 Adinnet. All rights reserved.
//
#import "UIImage+WaterMark.h"
@implementation UIImage (WaterMark)
- (UIImage*)imageWaterMarkWithImage:(UIImage *)image imageRect:(CGRect)imgRect alpha:(CGFloat)alpha
{
return [self imageWaterMarkWithString:nil rect:CGRectZero attribute:nil image:image imageRect:imgRect alpha:alpha];
}
- (UIImage*)imageWaterMarkWithImage:(UIImage*)image imagePoint:(CGPoint)imgPoint alpha:(CGFloat)alpha
{
return [self imageWaterMarkWithString:nil point:CGPointZero attribute:nil image:image imagePoint:imgPoint alpha:alpha];
}
- (UIImage*)imageWaterMarkWithString:(NSString*)str rect:(CGRect)strRect attribute:(NSDictionary *)attri
{
return [self imageWaterMarkWithString:str rect:strRect attribute:attri image:nil imageRect:CGRectZero alpha:0];
}
- (UIImage*)imageWaterMarkWithString:(NSString*)str point:(CGPoint)strPoint attribute:(NSDictionary*)attri
{
return [self imageWaterMarkWithString:str point:strPoint attribute:attri image:nil imagePoint:CGPointZero alpha:0];
}
- (UIImage*)imageWaterMarkWithString:(NSString*)str point:(CGPoint)strPoint attribute:(NSDictionary*)attri image:(UIImage*)image imagePoint:(CGPoint)imgPoint alpha:(CGFloat)alpha
{
UIGraphicsBeginImageContext(self.size);
[self drawAtPoint:CGPointMake(0, 0) blendMode:kCGBlendModeNormal alpha:1.0];
if (image) {
[image drawAtPoint:imgPoint blendMode:kCGBlendModeNormal alpha:alpha];
}
if (str) {
[str drawAtPoint:strPoint withAttributes:attri];
}
UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return resultImage;
}
- (UIImage*)imageWaterMarkWithString:(NSString*)str rect:(CGRect)strRect attribute:(NSDictionary *)attri image:(UIImage *)image imageRect:(CGRect)imgRect alpha:(CGFloat)alpha
{
UIGraphicsBeginImageContext(self.size);
[self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height) blendMode:kCGBlendModeNormal alpha:1.0];
if (image) {
[image drawInRect:imgRect blendMode:kCGBlendModeNormal alpha:alpha];
}
if ([str isKindOfClass:[NSAttributedString class]])
{
[(NSAttributedString*)str drawInRect:strRect];
}
else if (str) {
[str drawInRect:strRect withAttributes:attri];
}
UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return resultImage;
}
@end

View File

@ -240,6 +240,10 @@
{ {
NSString*hexString=[NSString stringWithFormat:@"%@",[[NSString alloc]initWithFormat:@"%1x",intString]]; NSString*hexString=[NSString stringWithFormat:@"%@",[[NSString alloc]initWithFormat:@"%1x",intString]];
siWeihexString=[NSString stringWithFormat:@"00%@",hexString]; siWeihexString=[NSString stringWithFormat:@"00%@",hexString];
if (hexString.length==1)
{
siWeihexString=[NSString stringWithFormat:@"000%@",hexString];
}
}else if (intString>=260) }else if (intString>=260)

View File

@ -131,6 +131,7 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi
YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init]; YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init];
nextvc.wifiName=self.wifiName; nextvc.wifiName=self.wifiName;
nextvc.wifiPwd=self.wifiPwd; nextvc.wifiPwd=self.wifiPwd;
nextvc.conectType =conectType_ap; nextvc.conectType =conectType_ap;
[self.navigationController pushViewController:nextvc animated:YES]; [self.navigationController pushViewController:nextvc animated:YES];
} }

View File

@ -68,7 +68,7 @@ Copy NSString *deviceId;
// // Do any additional setup after loading the view. // // Do any additional setup after loading the view.
self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES]; self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes]; [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
[self showStoreNameView];
} }
//AP //AP
@ -349,6 +349,10 @@ Copy NSString *deviceId;
}; };
store.sureBlock=^(NSString*name) store.sureBlock=^(NSString*name)
{ {
if (!name)
{
name=@"宠物店";
}
[weakSelf.mask removeFromSuperview]; [weakSelf.mask removeFromSuperview];
[weakSelf.storeNameView removeFromSuperview]; [weakSelf.storeNameView removeFromSuperview];
weakSelf.storeName=name; weakSelf.storeName=name;

View File

@ -13,9 +13,11 @@ NS_ASSUME_NONNULL_BEGIN
@interface SetTimerCell : UITableViewCell @interface SetTimerCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIButton *switchBtn; @property (weak, nonatomic) IBOutlet UIButton *switchBtn;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *timerLabel;
- (void)configTitleLabel:(NSString *)title timer:(NSString *)timeStr switchStatus:(BOOL)status; - (void)configTitleLabel:(NSString *)title timer:(NSString *)timeStr switchStatus:(BOOL)status;
@property (nonatomic, strong) id model;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@ -9,8 +9,7 @@
#import "SetTimerCell.h" #import "SetTimerCell.h"
@interface SetTimerCell () @interface SetTimerCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *timerLabel;
@end @end

View File

@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
+(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr type:(NSString*)type; +(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr type:(NSString*)type;
+(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(id)backModel type:(NSString*)type; +(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(id)backModel type:(NSString*)type;
+(void)readCycleSocketDataWithBackMsgModel:(XuanduoCycleModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr type:(nonnull NSString *)type;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@ -7,6 +7,7 @@
// //
#import "Xuanduo2DataUtility.h" #import "Xuanduo2DataUtility.h"
#import "UIImage+WaterMark.h"
@implementation Xuanduo2DataUtility @implementation Xuanduo2DataUtility
@ -147,6 +148,7 @@
waterLightBtn.selected = NO; waterLightBtn.selected = NO;
} }
// //
NSString *stateString4 = [backModel.constTmep substringWithRange:NSMakeRange(2, 2)]; NSString *stateString4 = [backModel.constTmep substringWithRange:NSMakeRange(2, 2)];
if ([stateString4 isEqualToString:@"01"]) { if ([stateString4 isEqualToString:@"01"]) {
light2Btn.selected = YES; light2Btn.selected = YES;
@ -154,6 +156,21 @@
light2Btn.selected = NO; light2Btn.selected = NO;
} }
UInt64 mac=[dataContorl hexToTen:backModel.heatingTemperature];
//float TPlabel=mac/10+(mac%10)*0.1;
float temp = mac/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp];
UIImage*imageTempNomal=[UIImage imageNamed:@"恒温关"];
imageTempNomal=[imageTempNomal imageWaterMarkWithString:stringTemp rect:CGRectMake(130, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}];
[light2Btn setImage:imageTempNomal forState:UIControlStateNormal];
UIImage*imageTempsel=[UIImage imageNamed:@"恒温开"];
imageTempsel=[imageTempNomal imageWaterMarkWithString:stringTemp rect:CGRectMake(130, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}];
[light2Btn setImage:imageTempsel forState:UIControlStateSelected];
} }
} }
@ -179,5 +196,17 @@
group.time = [NSString stringWithFormat:@"%@ - %@",startStr,endStr]; group.time = [NSString stringWithFormat:@"%@ - %@",startStr,endStr];
[xuanduoTimerModel.groupModelArr addObject:group]; [xuanduoTimerModel.groupModelArr addObject:group];
} }
}
+(void)readCycleSocketDataWithBackMsgModel:(XuanduoCycleModel*)xuanduocycleModel addWithBackStr:(NSString*)dataStr type:(nonnull NSString *)type
{
xuanduocycleModel.lightNumber = [dataStr substringWithRange:NSMakeRange(30, 2)];
xuanduocycleModel.lastTime = [dataStr substringWithRange:NSMakeRange(32, 4)];
xuanduocycleModel.gapTime = [dataStr substringWithRange:NSMakeRange(36, 4)];
xuanduocycleModel.status = [dataStr substringWithRange:NSMakeRange(40, 2)];
} }
@end @end

View File

@ -39,6 +39,8 @@ static NSString *setTimerflag = @"SetTimerCell";
@interface Xuanduo2SettingController ()<IfishCommuniteDelegate> @interface Xuanduo2SettingController ()<IfishCommuniteDelegate>
@property(nonatomic,strong) setRemindWaterModel *waterInfmodel; @property(nonatomic,strong) setRemindWaterModel *waterInfmodel;
@property(nonatomic,strong) Xuanduo2TimerModel *timerModel; @property(nonatomic,strong) Xuanduo2TimerModel *timerModel;
@property(nonatomic,strong) XuanduoCycleModel *cycleModel;
@property (nonatomic,strong) NSMutableDictionary *timeDic; @property (nonatomic,strong) NSMutableDictionary *timeDic;
@property(nonatomic,copy) NSString *nextChangeDateLabel; @property(nonatomic,copy) NSString *nextChangeDateLabel;
@property(nonatomic,strong) MyHud *XuTohud; @property(nonatomic,strong) MyHud *XuTohud;
@ -131,7 +133,11 @@ static NSString *setTimerflag = @"SetTimerCell";
_selectSection = -1; _selectSection = -1;
for (int i = 0; i<_titieArr.count; i++) { for (int i = 0; i<_titieArr.count; i++) {
NSMutableArray *dataArr = [NSMutableArray arrayWithCapacity:0]; NSMutableArray *dataArr = [NSMutableArray arrayWithCapacity:0];
[dataArr addObject:plusflag]; if (![_titieArr[i] isEqualToString:@"杀菌"])
{
[dataArr addObject:plusflag];
}
[self.timeDic setObject:dataArr forKey:_titieArr[i]]; [self.timeDic setObject:dataArr forKey:_titieArr[i]];
} }
self.tableView.backgroundColor=COLOR_MIAN; self.tableView.backgroundColor=COLOR_MIAN;
@ -223,9 +229,7 @@ static NSString *setTimerflag = @"SetTimerCell";
}else{ }else{
cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%ld天",(long)self.waterInfmodel.remindcycle]; cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%ld天",(long)self.waterInfmodel.remindcycle];
NSLog(@"ce;;%@",cell.huanshuiDaylabel.text);
NSLog(@"222");
} }
@ -273,13 +277,18 @@ static NSString *setTimerflag = @"SetTimerCell";
TemperatureSetModel *model=[[TemperatureSetModel alloc]init]; TemperatureSetModel *model=[[TemperatureSetModel alloc]init];
model.title = @"恒温设置"; model.title = @"恒温设置";
cell.titleLabel.text = model.title; cell.titleLabel.text = model.title;
NSLog(@"wendu str = %@",_wenduString);
model.temperatureLabel = _wenduString; Xuanduo3fModel*xmodel=(Xuanduo3fModel*)_dataModel;
NSString*heating = xmodel.heatingTemperature;
UInt64 heat = [dataContorl hexToTen:heating];
float formatheat = heat/10;
model.temperatureLabel = [NSString stringWithFormat:@"%f",formatheat];
cell.temPSwitch.hidden=YES; cell.temPSwitch.hidden=YES;
cell.temperaturelabel.frame=cell.temPSwitch.frame; cell.temperaturelabel.frame=cell.temPSwitch.frame;
Xuanduo3fModel*model3=self.dataModel; Xuanduo3fModel*model3=self.dataModel;
int mac=[dataContorl hexToTen:model3.temperature]; int mac=[dataContorl hexToTen:model3.heatingTemperature];
//float TPlabel=mac/10+(mac%10)*0.1; //float TPlabel=mac/10+(mac%10)*0.1;
float temp = mac/10.0; float temp = mac/10.0;
@ -307,12 +316,31 @@ static NSString *setTimerflag = @"SetTimerCell";
cell.switchBtn.tag = kSwitchBtnTag + indexPath.row; cell.switchBtn.tag = kSwitchBtnTag + indexPath.row;
[cell.switchBtn addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventTouchUpInside]; [cell.switchBtn addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventTouchUpInside];
XuanduoTimerGroup *group = [dataArr objectAtIndex:havePlus?indexPath.row+1:indexPath.row]; XuanduoTimerGroup *group = [dataArr objectAtIndex:havePlus?indexPath.row+1:indexPath.row];
BOOL isOn = NO; cell.model=group;
if ([group.status isEqualToString:@"01"]) { if ([group isKindOfClass:[XuanduoTimerGroup class]])
isOn = YES; {
BOOL isOn = NO;
if ([group.status isEqualToString:@"01"]) {
isOn = YES;
}
[cell configTitleLabel:[NSString stringWithFormat:@"时段%@",group.groupNumber] timer:group.time switchStatus:isOn];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
else if([group isKindOfClass:[XuanduoCycleModel class]])
{
XuanduoCycleModel*model=group;
BOOL isOn = NO;
if ([model.status isEqualToString:@"00"]) {
isOn = YES;
}
[cell configTitleLabel:@"循环开关" timer:[NSString stringWithFormat:@" %d分钟",[dataContorl hexToTen:model.lastTime]] switchStatus:isOn];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
} }
[cell configTitleLabel:[NSString stringWithFormat:@"时段%@",group.groupNumber] timer:group.time switchStatus:isOn];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
} }
} }
@ -462,7 +490,7 @@ static NSString *setTimerflag = @"SetTimerCell";
}else if (indexPath.section==1){ }else if (indexPath.section==1){
// //
_remindPic=[[remindCyclePic alloc]init]; _remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:self.currentdevice.type];
_remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); _remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height);
_remindPic.type=self.currentdevice.type; _remindPic.type=self.currentdevice.type;
@ -479,11 +507,27 @@ static NSString *setTimerflag = @"SetTimerCell";
[_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside]; [_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside];
[self huanShuiMainQueue]; [self huanShuiMainQueue];
}else { }else {
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:_indexPath]; SetTimerCell *cell = [self.tableView cellForRowAtIndexPath:_indexPath];
if ([cell isKindOfClass:[PlusTableViewCell class]]) { if ([cell isKindOfClass:[PlusTableViewCell class]]) {
return; return;
} }
[self addTimer:nil]; else if([cell isKindOfClass:[SetTimerCell class]]&&[cell.model isKindOfClass:[XuanduoCycleModel class]])
{
//
_cycleModel=cell.model;
_remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:@"cycle"];
_remindPic.type=@"cycle";
_remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height);
[self.view.window addSubview:_remindPic];
[_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside];
[self huanShuiMainQueue];
}
else
{
[self addTimer:nil];
}
} }
} }
@ -530,6 +574,15 @@ static NSString *setTimerflag = @"SetTimerCell";
}else { }else {
_selectSection = btn.tag - kBtnTag; _selectSection = btn.tag - kBtnTag;
ReadTimerModel *readModel = [[ReadTimerModel alloc] init]; ReadTimerModel *readModel = [[ReadTimerModel alloc] init];
//
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]&&(_selectSection - 2)==2)
{
readModel.functionCode=@"19";//
}
else
{
readModel.functionCode=@"16";
}
readModel.sendmacId =self.currentdevice.macAddress; readModel.sendmacId =self.currentdevice.macAddress;
readModel.resavemacId = self.currentdevice.macAddress; readModel.resavemacId = self.currentdevice.macAddress;
readModel.crc16str=@"0000"; readModel.crc16str=@"0000";
@ -584,82 +637,120 @@ static NSString *setTimerflag = @"SetTimerCell";
timerModel.resavemacId = self.currentdevice.macAddress; timerModel.resavemacId = self.currentdevice.macAddress;
timerModel.crc16str=@"0000"; timerModel.crc16str=@"0000";
XuanduoTimerGroup *group = [dataArr objectAtIndex:(havePlus?index+1:index)]; XuanduoTimerGroup *group = [dataArr objectAtIndex:(havePlus?index+1:index)];
NSString*hexDateString1=[dataContorl dateStringToHexString:group.startTime]; if ([group isKindOfClass: [XuanduoTimerGroup class] ]) {
NSString*hexDateString2=[dataContorl dateStringToHexString:group.endTime]; NSString*hexDateString1=[dataContorl dateStringToHexString:group.startTime];
timerModel.selectorTime=[NSString stringWithFormat:@"%@%@",hexDateString1,hexDateString2]; NSString*hexDateString2=[dataContorl dateStringToHexString:group.endTime];
timerModel.groupNumber = [dataContorl groupNumberTohex:group.groupNumber.integerValue]; timerModel.selectorTime=[NSString stringWithFormat:@"%@%@",hexDateString1,hexDateString2];
if ([group.status isEqualToString:@"01"]) { timerModel.groupNumber = [dataContorl groupNumberTohex:group.groupNumber.integerValue];
timerModel.isOn = @"00"; if ([group.status isEqualToString:@"01"]) {
}else { timerModel.isOn = @"00";
timerModel.isOn = @"01"; }else {
} timerModel.isOn = @"01";
}
ReadTimerModel *readModel = [[ReadTimerModel alloc] init];
readModel.sendmacId =self.currentdevice.macAddress; ReadTimerModel *readModel = [[ReadTimerModel alloc] init];
readModel.resavemacId = self.currentdevice.macAddress; readModel.sendmacId =self.currentdevice.macAddress;
readModel.crc16str=@"0000"; readModel.resavemacId = self.currentdevice.macAddress;
switch (_selectSection - 2) { readModel.crc16str=@"0000";
case 0: // switch (_selectSection - 2) {
{ case 0: //
timerModel.selectorNumber = @"04"; {
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) timerModel.selectorNumber = @"04";
{ if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
timerModel.selectorNumber=@"01"; {
} timerModel.selectorNumber=@"01";
} }
break; }
case 1: // break;
{ case 1: //
timerModel.selectorNumber = @"01"; {
timerModel.selectorNumber = @"01";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{ if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
timerModel.selectorNumber=@"02"; {
} timerModel.selectorNumber=@"02";
}
} }
break; break;
case 2: //1 case 2: //1
{ {
timerModel.selectorNumber = @"02"; timerModel.selectorNumber = @"02";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{ {
timerModel.selectorNumber=@"03"; timerModel.selectorNumber=@"03";
} }
} }
break; break;
case 3: //2 case 3: //2
{ {
timerModel.selectorNumber = @"03"; timerModel.selectorNumber = @"03";
} }
break; break;
case 4: // case 4: //
{ {
timerModel.selectorNumber = @"06"; timerModel.selectorNumber = @"06";
} }
break; break;
case 5: // case 5: //
{ {
timerModel.selectorNumber = @"05"; timerModel.selectorNumber = @"05";
} }
break; break;
default: default:
break; break;
}
NSString*selectorString=[NSString stringWithFormat:@"%@%@%@%@%@%@",timerModel.description,timerModel.selectorNumber,timerModel.groupNumber,timerModel.isOn,timerModel.selectorTime,timerModel.crc16str];
NSData*selctorData=[dataContorl stringToHexData:selectorString];
[[Socketsingleton sharedInstance] soketWriteData:selctorData];
[_indicatorView startAnimating];
readModel.selectorNumber = timerModel.selectorNumber;
NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,readModel.selectorNumber,readModel.crc16str];
NSLog(@"read str = %@",readString);
NSData*readData=[dataContorl stringToHexData:readString];
[[Socketsingleton sharedInstance] soketWriteData:readData];
[_indicatorView startAnimating];
} }
NSString*selectorString=[NSString stringWithFormat:@"%@%@%@%@%@%@",timerModel.description,timerModel.selectorNumber,timerModel.groupNumber,timerModel.isOn,timerModel.selectorTime,timerModel.crc16str]; else if ([group isKindOfClass: [XuanduoCycleModel class] ])
{
NSData*selctorData=[dataContorl stringToHexData:selectorString]; baseModel*tempModel=[[baseModel alloc]init];
[[Socketsingleton sharedInstance] soketWriteData:selctorData]; tempModel.sendmacId =self.currentdevice.macAddress;
[_indicatorView startAnimating]; tempModel.resavemacId =self.currentdevice.macAddress;
tempModel.functionCode=@"18";
readModel.selectorNumber = timerModel.selectorNumber; tempModel.massagelegth=@"17";
NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,readModel.selectorNumber,readModel.crc16str];
NSLog(@"read str = %@",readString);
NSData*readData=[dataContorl stringToHexData:readString];
[[Socketsingleton sharedInstance] soketWriteData:readData]; if ([_cycleModel.status isEqualToString:@"01"]) {
[_indicatorView startAnimating]; _cycleModel.status = @"00";
}else {
_cycleModel.status = @"01";
}
NSString*minString=[NSString stringWithFormat:@"%@%@%@%@%@%@",tempModel.description,_cycleModel.lightNumber,_cycleModel.lastTime,_cycleModel.gapTime,_cycleModel.status,@"0000"];
NSData*tempData=[dataContorl stringToHexData:minString];
[[Socketsingleton sharedInstance] soketWriteData:tempData];
baseModel*readModel=[[baseModel alloc]init];
readModel.sendmacId =self.currentdevice.macAddress;
readModel.resavemacId =self.currentdevice.macAddress;
readModel.functionCode=@"19";
readModel.massagelegth=@"12";
NSString*readString=[NSString stringWithFormat:@"%@%@%@%@%@%@",readModel.description,_cycleModel.lightNumber,@"0000"];
NSData*readData=[dataContorl stringToHexData:readString];
[[Socketsingleton sharedInstance] soketWriteData:readData];
}
} }
- (void)addTimer:(UIButton *)btn { - (void)addTimer:(UIButton *)btn {
@ -1056,7 +1147,7 @@ static NSString *setTimerflag = @"SetTimerCell";
if (_indexPath.section-2==_titieArr.count) if (_indexPath.section-2==_titieArr.count)
{ {
Xuanduo3fModel*model3=self.dataModel; Xuanduo3fModel*model3=self.dataModel;
int mac=[dataContorl hexToTen:model3.temperature]; int mac=[dataContorl hexToTen:model3.heatingTemperature];
//float TPlabel=mac/10+(mac%10)*0.1; //float TPlabel=mac/10+(mac%10)*0.1;
NSInteger temp = mac/10.0; NSInteger temp = mac/10.0;
@ -1068,6 +1159,21 @@ static NSString *setTimerflag = @"SetTimerCell";
return; return;
} }
else if ([_remindPic.type isEqualToString:@"cycle"])
{
int mac=[dataContorl hexToTen:_cycleModel.lastTime];
//float TPlabel=mac/10+(mac%10)*0.1;
NSInteger temp = mac;
if (temp<1)
{
temp=1;
}
[_remindPic.pic selectRow:temp-1 inComponent:0 animated:NO];
return;
}
else if (_remindPic.picViewResultString !=nil || (_remindPic.picViewResultString ==nil && self.waterInfmodel.remindcycle !=0 )) { else if (_remindPic.picViewResultString !=nil || (_remindPic.picViewResultString ==nil && self.waterInfmodel.remindcycle !=0 )) {
NSArray*shijianArr=[_remindPic.picArr objectAtIndex:0]; NSArray*shijianArr=[_remindPic.picArr objectAtIndex:0];
@ -1167,7 +1273,7 @@ static NSString *setTimerflag = @"SetTimerCell";
baseModel*tempModel=[[baseModel alloc]init]; baseModel*tempModel=[[baseModel alloc]init];
tempModel.sendmacId =self.currentdevice.macAddress; tempModel.sendmacId =self.currentdevice.macAddress;
tempModel.resavemacId =self.currentdevice.macAddress; tempModel.resavemacId =self.currentdevice.macAddress;
tempModel.functionCode=@"0E"; tempModel.functionCode=@"14";
tempModel.massagelegth=@"13"; tempModel.massagelegth=@"13";
@ -1176,12 +1282,65 @@ static NSString *setTimerflag = @"SetTimerCell";
int newIntString=intString*10; int newIntString=intString*10;
NSString*temp =[dataContorl tpIntStringToFourHex:newIntString]; NSString*temp =[dataContorl tpIntStringToFourHex:newIntString];
NSString*minString=[NSString stringWithFormat:@"%@%@%%@",tempModel.description,temp,@"0000"]; NSString*minString=[NSString stringWithFormat:@"%@%@%@",tempModel.description,temp,@"0000"];
NSLog(@"minstring = %@",minString); NSLog(@"minstring = %@",minString);
NSData*tempData=[dataContorl stringToHexData:minString]; NSData*tempData=[dataContorl stringToHexData:minString];
[[Socketsingleton sharedInstance] soketWriteData:tempData]; [[Socketsingleton sharedInstance] soketWriteData:tempData];
}
else if ([_remindPic.type isEqualToString:@"cycle"])
{
SetTimerCell*cell=[self.tableView cellForRowAtIndexPath:_indexPath];
NSString *str=_remindPic.picViewResultString;
if (str==nil) {
//str=@"1";
NSLog(@"ni hua dong tai kuai");
str=[NSString stringWithFormat:@"%ld",(long)self.waterInfmodel.remindcycle];
[_remindPic makeToast:@"请设置杀菌持续时间"];
return;
}
cell.timerLabel.text=[NSString stringWithFormat:@"%d分钟",str.intValue];
//
;
[_remindPic removeFromSuperview];
baseModel*tempModel=[[baseModel alloc]init];
tempModel.sendmacId =self.currentdevice.macAddress;
tempModel.resavemacId =self.currentdevice.macAddress;
tempModel.functionCode=@"18";
tempModel.massagelegth=@"17";
int intString = [str intValue];
NSString*temp =[dataContorl tpIntStringToFourHex:intString];
_cycleModel.lastTime=temp;
NSString*minString=[NSString stringWithFormat:@"%@%@%@%@%@%@",tempModel.description,_cycleModel.lightNumber,_cycleModel.lastTime,_cycleModel.gapTime,_cycleModel.status,@"0000"];
NSLog(@"minstring = %@",minString);
NSData*tempData=[dataContorl stringToHexData:minString];
[[Socketsingleton sharedInstance] soketWriteData:tempData];
baseModel*readModel=[[baseModel alloc]init];
readModel.sendmacId =self.currentdevice.macAddress;
readModel.resavemacId =self.currentdevice.macAddress;
readModel.functionCode=@"19";
readModel.massagelegth=@"12";
NSString*readString=[NSString stringWithFormat:@"%@%@%@%@%@%@",readModel.description,_cycleModel.lightNumber,@"0000"];
NSData*readData=[dataContorl stringToHexData:readString];
[[Socketsingleton sharedInstance] soketWriteData:readData];
} }
} }
@ -1392,6 +1551,20 @@ static NSString *setTimerflag = @"SetTimerCell";
[self.indicatorView stopAnimating]; [self.indicatorView stopAnimating];
[self.tableView reloadData]; [self.tableView reloadData];
} }
else if (_selectSection-2<_titieArr.count && _selectSection-2>=0 && [readTimer isEqualToString:@"0119"]) {
_cycleModel=[[XuanduoCycleModel alloc]init];
[Xuanduo2DataUtility readCycleSocketDataWithBackMsgModel:_cycleModel addWithBackStr:string1 type:self.currentdevice.type];
NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection-2]];
[dataArr removeAllObjects];
[dataArr addObject:_cycleModel];
[self.XuTohud hidmyHud];
[self.indicatorView stopAnimating];
[self.tableView reloadData];
}
if ([readTimer isEqualToString:@"0108"] || [readTimer isEqualToString:@"0105"]) { if ([readTimer isEqualToString:@"0108"] || [readTimer isEqualToString:@"0105"]) {
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentdevice.type]; [Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentdevice.type];
[self refreshWithData:self.dataModel]; [self refreshWithData:self.dataModel];

View File

@ -43,6 +43,16 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) NSMutableArray *groupModelArr; @property (nonatomic, strong) NSMutableArray *groupModelArr;
@end
@interface XuanduoCycleModel : NSObject
/// 灯的序号
@property (nonatomic, strong) NSString *lightNumber;
@property (nonatomic, strong) NSString *lastTime;
@property (nonatomic, strong) NSString *gapTime;
@property (nonatomic, strong) NSString *status;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@ -15,3 +15,8 @@
@implementation Xuanduo2TimerModel @implementation Xuanduo2TimerModel
@end @end
@implementation XuanduoCycleModel
@end

View File

@ -27,6 +27,7 @@
#import "JHRefresh.h" #import "JHRefresh.h"
#import "searchDeviceModel.h" #import "searchDeviceModel.h"
#import "PetStoresViewController.h" #import "PetStoresViewController.h"
#import "UIImage+WaterMark.h"
#define kBtnTag 100 #define kBtnTag 100
@ -65,6 +66,8 @@
@property(nonatomic) BOOL isconnect;// socket @property(nonatomic) BOOL isconnect;// socket
@property (weak, nonatomic) IBOutlet UIView *contentView; @property (weak, nonatomic) IBOutlet UIView *contentView;
@property (weak, nonatomic) IBOutlet UIImageView *imageView; @property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property(nonatomic,strong) XuanduoCycleModel *cycleModel;
@end @end
@ -254,13 +257,46 @@
//[_HUD hide:YES]; //[_HUD hide:YES];
[self.XuTohud hidmyHud]; [self.XuTohud hidmyHud];
[self endRefreshing]; [self endRefreshing];
NSLog(@"123124124");
NSString*string1=[dataContorl dataToHexString:data];
NSLog(@"return str == %@",string1);
NSString *readTimer = [string1 substringToIndex:4];
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentDevice.type];
[self setTemperature];
if ([readTimer isEqualToString:@"0119"])
{
_cycleModel=[[XuanduoCycleModel alloc]init];
[Xuanduo2DataUtility readCycleSocketDataWithBackMsgModel:_cycleModel addWithBackStr:string1 type:self.currentDevice.type];
if (_cycleModel.lastTime.length)
{
UInt64 mac1=[dataContorl hexToTen:_cycleModel.lastTime];
//float TPlabel=mac/10+(mac%10)*0.1;
float temp1 = mac1/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp1];
UIImage*uvNomal=[UIImage imageNamed:@"杀菌关"];
uvNomal=[uvNomal imageWaterMarkWithString:stringTemp rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}];
[self.light1 setImage:uvNomal forState:UIControlStateNormal];
UIImage*uvsel=[UIImage imageNamed:@"杀菌开"];
uvsel=[uvsel imageWaterMarkWithString:stringTemp rect:CGRectMake(140, 60, 60, 60) attribute:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}];
[self.light1 setImage:uvsel forState:UIControlStateSelected];
}
}
else
{
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentDevice.type];
[self setTemperature];
}
if (self.dataModel) { if (self.dataModel) {
_offLineLabel.hidden = YES; _offLineLabel.hidden = YES;
@ -268,6 +304,25 @@
_offLineLabel.hidden = NO; _offLineLabel.hidden = NO;
} }
[Xuanduo2DataUtility resetNewXuanduoButtonState:self.uvLight gasPumpLight:self.gasPumpLight light1:self.light1 light2:self.light2 waveLight:self.waveLight huliLight:self.huliLight waterLight:self.waterLight heatLight:self.heatLight withModel:self.dataModel type:self.currentDevice.type]; [Xuanduo2DataUtility resetNewXuanduoButtonState:self.uvLight gasPumpLight:self.gasPumpLight light1:self.light1 light2:self.light2 waveLight:self.waveLight huliLight:self.huliLight waterLight:self.waterLight heatLight:self.heatLight withModel:self.dataModel type:self.currentDevice.type];
//
}
-(void)readCycleWithNumber:(NSString*)num
{
baseModel*readModel=[[baseModel alloc]init];
readModel.sendmacId =self.currentDevice.macAddress;
readModel.resavemacId =self.currentDevice.macAddress;
readModel.functionCode=@"19";
readModel.massagelegth=@"12";
NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,num,@"0000"];
NSData*readData=[dataContorl stringToHexData:readString];
[[Socketsingleton sharedInstance] soketWriteData:readData];
} }
-(void)ifishDeviceLogInFail{ -(void)ifishDeviceLogInFail{
@ -276,6 +331,7 @@
-(void)ifishDeviceLogInSuccees{ -(void)ifishDeviceLogInSuccees{
[self readCycleWithNumber:@"03"];
} }
-(void)ifishSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket{ -(void)ifishSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket{

View File

@ -399,7 +399,9 @@ Assign BOOL isPush;
petStores[storeName]=array; petStores[storeName]=array;
} }
else {
{
[deviceArr insertObject:devicemodel atIndex:0]; [deviceArr insertObject:devicemodel atIndex:0];
} }
@ -848,12 +850,17 @@ Assign BOOL isPush;
} }
for (DeviceModel *device in deivceArr) { for (DeviceModel *device in deivceArr) {
FormatTankAddCamera *deviceListModel =[[FormatTankAddCamera alloc] init];
deviceListModel.device = device; if (!device.storeName.length)
deviceListModel.type = @"tank"; {
deviceListModel.deviceName = device.showName; FormatTankAddCamera *deviceListModel =[[FormatTankAddCamera alloc] init];
deviceListModel.imgeaName = @"home_iocn_aquarium"; deviceListModel.device = device;
[self.totalArr addObject:deviceListModel]; deviceListModel.type = @"tank";
deviceListModel.deviceName = device.showName;
deviceListModel.imgeaName = @"home_iocn_aquarium";
[self.totalArr addObject:deviceListModel];
}
} }

View File

@ -64,6 +64,7 @@
#import "RuiMeiSetViewController.h" #import "RuiMeiSetViewController.h"
#import "Xuanduo2SettingController.h" #import "Xuanduo2SettingController.h"
#import "MessageAlertView.h" #import "MessageAlertView.h"
#import "CreatErWeiMaController.h"
// //
@interface IfishP2PMonitorController ()<HaveHotCoolWenDuPicviewDelegate,GWP2PVideoPlayerProtocol> @interface IfishP2PMonitorController ()<HaveHotCoolWenDuPicviewDelegate,GWP2PVideoPlayerProtocol>
{ {
@ -347,12 +348,13 @@ Strong UIImage *screenShotImage;//截图
}); });
} ready:^{ } ready:^{
[self.view makeToast:@"连接成功"];
// //
NSLog(@"连接摄像头成功 当前所在线程为%@",[NSThread currentThread]); NSLog(@"连接摄像头成功 当前所在线程为%@",[NSThread currentThread]);
//UI //UI
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
// //
[self.view makeToast:@"连接成功"];
[weakSelf hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO]; [weakSelf hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO];
// //
[weakSelf didHiddenMonitorUIWith:YES]; [weakSelf didHiddenMonitorUIWith:YES];
@ -583,7 +585,47 @@ Strong UIImage *screenShotImage;//截图
CGFloat controlSegY= CGRectGetMaxY(self.canvasView.frame); CGFloat controlSegY= CGRectGetMaxY(self.canvasView.frame);
IifshSegmentView *seg = [[IifshSegmentView alloc] initWithFrame:CGRectMake(0.0, controlSegY,kScreenSize.width, segMentH)]; IifshSegmentView *seg = [[IifshSegmentView alloc] initWithFrame:CGRectMake(0.0, controlSegY,kScreenSize.width, segMentH)];
seg.segDelegate = self; 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.segControl = seg;
[self.view addSubview:seg]; [self.view addSubview:seg];
@ -629,6 +671,11 @@ Strong UIImage *screenShotImage;//截图
[weakSelf delectCamera]; [weakSelf delectCamera];
}else if (tag == 2){ }else if (tag == 2){
//
[weakSelf fenXiangSheBei];
}
else if (tag == 3){
// //
if ([weakSelf.player isPlaying]) { if ([weakSelf.player isPlaying]) {
@ -665,8 +712,8 @@ Strong UIImage *screenShotImage;//截图
[self.view addSubview:self.popView]; [self.view addSubview:self.popView];
NSArray *titleImgs =nil; NSArray *titleImgs =nil;
NSArray *titles=nil; NSArray *titles=nil;
titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate"]; titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"Ifish_share_device",@"equipment_icon_equipmentupdate"];
titles=@[@"修改名称",@"删除设备",@"设备升级"]; titles=@[@"修改名称",@"删除设备",@"分享设备",@"设备升级"];
[self.popView loadInfoWithTitle:titles Icons:titleImgs]; [self.popView loadInfoWithTitle:titles Icons:titleImgs];
} }
@ -747,6 +794,15 @@ Strong UIImage *screenShotImage;//截图
[self presentViewController:ac2 animated:YES completion:nil]; [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{ -(void)deleteCameraAtRequset{
@ -998,14 +1054,14 @@ Strong UIImage *screenShotImage;//截图
}else{ }else{
UIButton *notbindBtn=[UIButton buttonWithType:UIButtonTypeCustom]; UIButton *notbindBtn=[UIButton buttonWithType:UIButtonTypeCustom];
NSString *title=@"您暂未绑定水族箱,前往绑定。"; NSString *title=@"您暂未绑定水族箱或宠物笼,前往绑定。";
[notbindBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [notbindBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:title]; NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:title];
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init]; NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:8]; [paragraphStyle setLineSpacing:12];
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [title length])]; [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 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)]; [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange([title length]-1,1)];
[notbindBtn setAttributedTitle:attributedString forState:UIControlStateNormal]; [notbindBtn setAttributedTitle:attributedString forState:UIControlStateNormal];
[notbindBtn sizeToFit]; [notbindBtn sizeToFit];
@ -4216,35 +4272,60 @@ GWP2PCallErrorNotSupport,
-(void)selectXuanduo2Index:(NSIndexPath *)index withBackModel:(Xuanduo2Model *)backModel{ -(void)selectXuanduo2Index:(NSIndexPath *)index withBackModel:(Xuanduo2Model *)backModel{
if (backModel) { if (backModel) {
if (index.row == 3) { if (index.row == 3)
// {
manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init]; if ([backModel isKindOfClass:[Xuanduo2Model class]]) {
[[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel]; //
NSString*switchString=manulModel.description; manulswitchMSModel*manulModel=[[manulswitchMSModel alloc]init];
manulModel.lightNumber = @"04"; [[Socketsingleton sharedInstance] setSoketLightDataWith:manulModel];
if([[backModel.waterPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) NSString*switchString=manulModel.description;
{ manulModel.lightNumber = @"04";
manulModel.switchBtn = @"01"; if([[backModel.waterPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
}else{ {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"确认关闭循环泵?" preferredStyle:UIAlertControllerStyleAlert]; manulModel.switchBtn = @"01";
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil]; }else{
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"确认关闭循环泵?" preferredStyle:UIAlertControllerStyleAlert];
manulModel.switchBtn = @"00"; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
manulModel.crc16Str = @"0000"; UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str]; manulModel.switchBtn = @"00";
NSData*manulData=[dataContorl stringToHexData:switchString2]; manulModel.crc16Str = @"0000";
[[Socketsingleton sharedInstance] soketWriteData:manulData]; NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str];
}]; NSData*manulData=[dataContorl stringToHexData:switchString2];
[alertController addAction:cancelAction]; [[Socketsingleton sharedInstance] soketWriteData:manulData];
[alertController addAction:sureAction]; }];
[self.navigationController presentViewController:alertController animated:YES completion:nil]; [alertController addAction:cancelAction];
return; [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"; manulModel.crc16Str = @"0000";
NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str]; NSString*switchString2=[NSString stringWithFormat:@"%@%@%@%@",switchString,manulModel.lightNumber,manulModel.switchBtn,manulModel.crc16Str];
NSData*manulData=[dataContorl stringToHexData:switchString2]; NSData*manulData=[dataContorl stringToHexData:switchString2];
[[Socketsingleton sharedInstance] soketWriteData:manulData]; [[Socketsingleton sharedInstance] soketWriteData:manulData];
}
}else { }else {
_xuanduoPicView=[[HaveHotCoolWenDuPicview alloc] init]; _xuanduoPicView=[[HaveHotCoolWenDuPicview alloc] init];
_xuanduoPicView.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); _xuanduoPicView.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height);

View File

@ -473,10 +473,17 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔复位摄像
[[GWP2PClient sharedClient] setDeviceInitialPassword:self.lastSetPassword withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) { [[GWP2PClient sharedClient] setDeviceInitialPassword:self.lastSetPassword withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"success:%i %@",success,dataDictionary); NSLog(@"success:%i %@",success,dataDictionary);
[self resetPassWord];//初始化密码 [self resetPassWord];//初始化密码
[self bindCameraDevice];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self bindCameraDevice];
});
}]; }];
}else{//如果已经设置过初始密码,则直接使用 }else{//如果已经设置过初始密码,则直接使用
[self bindCameraDevice]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self bindCameraDevice];
});
} }
} }
@ -574,6 +581,7 @@ self.attentionLabel.text=@"1、请长按摄像头背后复位孔复位摄像
contact.contactType = CONTACT_TYPE_UNKNOWN; contact.contactType = CONTACT_TYPE_UNKNOWN;
[[FListManager sharedFList] insert:contact]; [[FListManager sharedFList] insert:contact];
//设置密码成功后爱鱼奇用户绑定摄像头 //设置密码成功后爱鱼奇用户绑定摄像头
[self ifishUserBindcameraIdBy:self.deviceID]; [self ifishUserBindcameraIdBy:self.deviceID];
} }

View File

@ -10,6 +10,7 @@
#import "IfishDeviceInfo.h" #import "IfishDeviceInfo.h"
#import "RuSunGuiDeng.h" #import "RuSunGuiDeng.h"
#import "XuanduoHuliModel.h" #import "XuanduoHuliModel.h"
#import "xuanduo3fModel.h"
@implementation BootomViewSoketBackMasgConreol @implementation BootomViewSoketBackMasgConreol
@ -92,6 +93,9 @@
}else if ([type isEqualToString:DECICE_TYPE_XUANDUO2F]){ }else if ([type isEqualToString:DECICE_TYPE_XUANDUO2F]){
str=[str substringWithRange:NSMakeRange(60,IFISH_TEMPERATURE_BYTE2)]; str=[str substringWithRange:NSMakeRange(60,IFISH_TEMPERATURE_BYTE2)];
} }
else if ([type isEqualToString:DECICE_TYPE_XUANDUO3F]){
str=[str substringWithRange:NSMakeRange(46,IFISH_TEMPERATURE_BYTE2)];
}
UInt64 mac=[dataContorl hexToTen:str]; UInt64 mac=[dataContorl hexToTen:str];
NSLog(@"%llu",mac); NSLog(@"%llu",mac);
@ -927,7 +931,17 @@ indexPath {
if (index == 0) { // if (index == 0) { //
manulModel.lightNumber = @"04"; manulModel.lightNumber = @"04";
if([[model.waterPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
NSString*state;
if ([model isKindOfClass:[Xuanduo3fModel class]])
{
state=model.gasPump;
manulModel.lightNumber=@"01";
}
else{
state= model.waterPump;
}
if([[state substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
{ {
manulModel.switchBtn = @"01"; manulModel.switchBtn = @"01";
@ -939,6 +953,11 @@ indexPath {
}else if (index == 1){ // }else if (index == 1){ //
manulModel.lightNumber = @"01"; manulModel.lightNumber = @"01";
if ([model isKindOfClass:[Xuanduo3fModel class]])
{
manulModel.lightNumber=@"02";
}
if([[model.gasPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) if([[model.gasPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
{ {
@ -953,7 +972,16 @@ indexPath {
manulModel.lightNumber = @"02"; manulModel.lightNumber = @"02";
if([[model.light1 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) NSString*state;
if ([model isKindOfClass:[Xuanduo3fModel class]])
{
state=model.uvLamp;
manulModel.lightNumber=@"03";
}
else{
state= model.light1;
}
if([[state substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
{ {
manulModel.switchBtn = @"01"; manulModel.switchBtn = @"01";
@ -967,7 +995,17 @@ indexPath {
manulModel.lightNumber = @"03"; manulModel.lightNumber = @"03";
if([[model.light2 substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"]) NSString*state;
if ([model isKindOfClass:[Xuanduo3fModel class]])
{
state=((Xuanduo3fModel*)model).constTmep;
manulModel.lightNumber=@"04";
}
else{
state= model.light2;
}
if([[state substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)] isEqualToString:@"00"])
{ {
manulModel.switchBtn = @"01"; manulModel.switchBtn = @"01";

View File

@ -154,7 +154,7 @@
@property(nonatomic,strong) RunSun84Protocol *ruSun84Back; @property(nonatomic,strong) RunSun84Protocol *ruSun84Back;
@property (nonatomic, strong) RuiMeiProtocolModel *ruiMeiBack; @property (nonatomic, strong) RuiMeiProtocolModel *ruiMeiBack;
@property(nonatomic,strong) SongNuoBDProtocol *songNuoBDBack; @property(nonatomic,strong) SongNuoBDProtocol *songNuoBDBack;
@property(nonatomic,strong) Xuanduo2Model *xuanduoBack; @property(nonatomic,strong) id xuanduoBack;
-(void)setTabViewWithFrame:(CGRect)frame; -(void)setTabViewWithFrame:(CGRect)frame;

View File

@ -237,14 +237,14 @@
UIButton *notbindBtn=[UIButton buttonWithType:UIButtonTypeCustom]; UIButton *notbindBtn=[UIButton buttonWithType:UIButtonTypeCustom];
NSString *title=@"您暂无可用的水族箱,前往绑定。"; NSString *title=@"您暂无可用的水族箱或宠物笼,前往绑定。";
[notbindBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [notbindBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:title]; NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:title];
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init]; NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:8]; [paragraphStyle setLineSpacing:12];
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [title length])]; [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [title length])];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:0 green:170.0/255.0 blue:218.0/255.0 alpha:1] range:NSMakeRange(9,5)]; [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:0 green:170.0/255.0 blue:218.0/255.0 alpha:1] range:NSMakeRange(13,5)];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(0,10)]; [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(0,10)];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange([title length]-1,1)]; [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange([title length]-1,1)];
[notbindBtn setAttributedTitle:attributedString forState:UIControlStateNormal]; [notbindBtn setAttributedTitle:attributedString forState:UIControlStateNormal];
@ -307,7 +307,7 @@
//[headerView setBackgroundColor:XBGAlpha]; //[headerView setBackgroundColor:XBGAlpha];
[headerView setBackgroundColor:RGB(242, 242, 242)]; [headerView setBackgroundColor:RGB(242, 242, 242)];
UILabel *readLabel=[[UILabel alloc] init ]; UILabel *readLabel=[[UILabel alloc] init ];
readLabel.text = @"请选择一个水族箱,和摄像头建立关系"; readLabel.text = @"请选择一个水族箱或宠物笼,和摄像头建立关系";
NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:readLabel.text ]; NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:readLabel.text ];
@ -618,7 +618,11 @@
return 3 + 5; return 3 + 5;
} else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]){ } else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]){
return 3 + self.device.controlAmount.integerValue + 1; return 3 + self.device.controlAmount.integerValue + 1;
}else { }
else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
return 3 + self.device.controlAmount.integerValue + 1;
}
else {
if (self.device.controlAmount.integerValue ==5) { if (self.device.controlAmount.integerValue ==5) {
@ -708,7 +712,32 @@
if (!cell || [cell.templabel.text containsString:@"kwh"]) { if (!cell || [cell.templabel.text containsString:@"kwh"]) {
return; return;
} }
UInt64 mac = [dataContorl hexToTen:_xuanduoBack.electricity]; Xuanduo2Model*model=_xuanduoBack;
UInt64 mac = [dataContorl hexToTen:model.electricity];
NSString *stringTemp = [NSString stringWithFormat:@"%llukwh",mac/10.0];
cell.templabel.font = [UIFont systemFontOfSize:37];
cell.templabel.textColor = RGB(253, 188, 63);
[cell.templabel setAttributedText:[NSString ls_changeFontAndColor:[UIFont systemFontOfSize:17] Color:nil TotalString:stringTemp SubStringArray:@[@"kwh"]]];
if (!_switchTimer) {
_switchTimer = [NSTimer timerWithTimeInterval:3.0 target:self selector:@selector(changeTemp) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_switchTimer forMode:NSRunLoopCommonModes];
}
}else if(indexPath.row == 2) {
[self.MonitorBottomDelegate didselectXuanduo2SetttngWithData:self.device andBackModel:_xuanduoBack];
}
}
else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
if (!_xuanduoBack) {
[self makeToast:@"暂未连接"];
return;
}
if (indexPath.row == 1) {
FishControlSecondCell *cell = [self.collectionView viewWithTag:ktempTag];
if (!cell || [cell.templabel.text containsString:@"kwh"]) {
return;
}
Xuanduo3fModel*model=_xuanduoBack;
UInt64 mac = [dataContorl hexToTen:model.temperature];
NSString *stringTemp = [NSString stringWithFormat:@"%llukwh",mac/10.0]; NSString *stringTemp = [NSString stringWithFormat:@"%llukwh",mac/10.0];
cell.templabel.font = [UIFont systemFontOfSize:37]; cell.templabel.font = [UIFont systemFontOfSize:37];
cell.templabel.textColor = RGB(253, 188, 63); cell.templabel.textColor = RGB(253, 188, 63);
@ -925,7 +954,7 @@
} }
[self makeToastActivity:CSToastPositionCenter]; [self makeToastActivity:CSToastPositionCenter];
}else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]){ }else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]||[self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
// //
if (!_xuanduoBack) { if (!_xuanduoBack) {
[self makeToast:@"暂未连接"]; [self makeToast:@"暂未连接"];
@ -1118,10 +1147,17 @@
if (!cell) { if (!cell) {
return; return;
} }
UInt64 mac = [dataContorl hexToTen:_xuanduoBack.waterTemperature]; UInt64 mac = 0;
NSLog(@"%llu",mac); NSLog(@"%llu",mac);
//float TPlabel=mac/10+(mac%10)*0.1; if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
float temp = mac/10.0; Xuanduo2Model*model=(Xuanduo2Model*)_xuanduoBack;
mac=[dataContorl hexToTen:model.waterTemperature];
}
else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
Xuanduo3fModel*model=(Xuanduo3fModel*)_xuanduoBack;
mac=[dataContorl hexToTen:model.temperature];
} float temp = mac/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f",temp]; NSString *stringTemp = [NSString stringWithFormat:@"%.1f",temp];
[cell setTemWith:stringTemp]; [cell setTemWith:stringTemp];
} }
@ -1243,7 +1279,7 @@
[cell setSongNuoBDControBtnImg:self.btnImgArr addArr:self.btnOnImgArr atIndex:indexPath addBackModel:_songNuoBDBack]; [cell setSongNuoBDControBtnImg:self.btnImgArr addArr:self.btnOnImgArr atIndex:indexPath addBackModel:_songNuoBDBack];
}else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]){ }else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO2F]||[self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
if (!_xuanduoBack) { if (!_xuanduoBack) {
cell.controBtnImg.image = self.btnImgArr[indexPath.row - 3]; cell.controBtnImg.image = self.btnImgArr[indexPath.row - 3];
[self makeToast:@"连接设备中..."]; [self makeToast:@"连接设备中..."];
@ -1487,7 +1523,21 @@
[UIImage imageNamed:@"shajun_selected"], [UIImage imageNamed:@"shajun_selected"],
[UIImage imageNamed:@"huli_selected"], [UIImage imageNamed:@"huli_selected"],
[UIImage imageNamed:@"jiare_selected"]]; [UIImage imageNamed:@"jiare_selected"]];
}else{ }
else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
self.btnNameArr = @[@"照明",@"换气",@"杀菌",@"恒温"];
self.btnImgArr = @[[UIImage imageNamed:@"照明关"],
[UIImage imageNamed:@"换气关"],
[UIImage imageNamed:@"杀菌关"],
[UIImage imageNamed:@"恒温关"]];
self.btnOnImgArr = @[[UIImage imageNamed:@"照明开"],
[UIImage imageNamed:@"换气开"],
[UIImage imageNamed:@"杀菌开"],
[UIImage imageNamed:@"恒温开"]];
}
else{
int controlAmount=[self.device.controlAmount intValue]; int controlAmount=[self.device.controlAmount intValue];
@ -1802,7 +1852,16 @@
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:DECICE_TYPE_XUANDUO2F]; [Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:DECICE_TYPE_XUANDUO2F];
self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO2F]; self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO2F];
[self.collectionView reloadData]; [self.collectionView reloadData];
}else{ }else if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
//
if (!_xuanduoBack) {
_xuanduoBack = [[Xuanduo3fModel alloc] init];
}
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:self.device.type];
self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO3F];
[self.collectionView reloadData];
}
else{
int controlAmount=[devicemoel.controlAmount intValue]; int controlAmount=[devicemoel.controlAmount intValue];

View File

@ -29,6 +29,8 @@
UIView *hengLine=[[UIView alloc] initWithFrame:CGRectMake(0,self.frame.size.height -1,self.frame.size.width, 1)]; UIView *hengLine=[[UIView alloc] initWithFrame:CGRectMake(0,self.frame.size.height -1,self.frame.size.width, 1)];
hengLine.backgroundColor = shuLine.backgroundColor = JWUIColorFromRGB(0xdddddd); hengLine.backgroundColor = shuLine.backgroundColor = JWUIColorFromRGB(0xdddddd);
[self addSubview:hengLine]; [self addSubview:hengLine];
[self bringSubviewToFront:self.factoryIcon];
self.factoryIcon.hidden=NO;
} }
@ -38,12 +40,18 @@
-(void)intiFactoryImgWith:(DeviceModel *)devicemodel{ -(void)intiFactoryImgWith:(DeviceModel *)devicemodel{
[self.factoryIcon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetLogUrl,devicemodel.logo]] placeholderImage:[UIImage imageNamed:@""]];
if (!self.factoryIcon.image) {
self.factoryIcon.image = [UIImage imageNamed:@"brandLogo_hold"];
}
[self.factoryIcon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetLogUrl,devicemodel.logo]] placeholderImage:[UIImage imageNamed:@"brandLogo_hold"]];
if (!self.factoryIcon) { if (!self.factoryIcon) {
self.factoryIcon.image = [UIImage imageNamed:@"greenbtn_big"]; self.factoryIcon.image = [UIImage imageNamed:@"greenbtn_big"];
} }
[self bringSubviewToFront:self.factoryIcon];
self.factoryIcon.hidden=NO;
} }
@end @end

View File

@ -7,6 +7,7 @@
// //
#import "FishControlFourthCell.h" #import "FishControlFourthCell.h"
#import "xuanduo3fModel.h"
@implementation FishControlFourthCell @implementation FishControlFourthCell
- (instancetype)initWithFrame:(CGRect)frame{ - (instancetype)initWithFrame:(CGRect)frame{
@ -258,6 +259,10 @@
atIndex:(NSIndexPath *)indexPath atIndex:(NSIndexPath *)indexPath
addBackModel:(Xuanduo2Model*)model { addBackModel:(Xuanduo2Model*)model {
if ([model isKindOfClass:[Xuanduo2Model class]])
{
NSInteger index = indexPath.row - 3; NSInteger index = indexPath.row - 3;
if (index == 0) { if (index == 0) {
@ -307,7 +312,40 @@
addOffArr:imgOffArr]; addOffArr:imgOffArr];
} }
}
else if ([model isKindOfClass:[Xuanduo3fModel class]])
{
Xuanduo3fModel*xuan3fmodel=model;
NSInteger index = indexPath.row - 3;
if (index == 0) {
NSString*stateString=[xuan3fmodel.light substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}else if (index == 1){
NSString*stateString=[xuan3fmodel.gasPump substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}else if (index == 2){
NSString*stateString=[xuan3fmodel.uvLamp substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}else if (index == 3){
NSString*stateString=[xuan3fmodel.constTmep substringWithRange:NSMakeRange(2, IFISH_LIGHTBTN_BYTE)];
[self btnImgAtIndex:indexPath withStr:stateString addWithOnImg:imgOnArr
addOffArr:imgOffArr];
}else
{
NSLog(@"index=%ld",indexPath.row);
}
}
} }

View File

@ -72,7 +72,7 @@
withdeviceName:(NSString *)nameStr{ withdeviceName:(NSString *)nameStr{
self.deviceNameLabel.text = [NSString stringWithFormat:@"水族箱:%@",nameStr]; self.deviceNameLabel.text = nameStr;
self.deviceNameLabel.textColor = [UIColor blackColor]; self.deviceNameLabel.textColor = [UIColor blackColor];

View File

@ -14,6 +14,7 @@
@property (weak, nonatomic) IBOutlet UIImageView *erWeiMaView; @property (weak, nonatomic) IBOutlet UIImageView *erWeiMaView;
@property (nonatomic,strong) DeviceModel *erdevicemodel; @property (nonatomic,strong) DeviceModel *erdevicemodel;
@property (nonatomic, strong) NSString *deviceid;
@end @end

View File

@ -42,7 +42,7 @@
// } // }
//DeviceModel*model=[_arry objectAtIndex:0];// //DeviceModel*model=[_arry objectAtIndex:0];//
NSString*str=[NSString stringWithFormat:@"deviceId=%@",self.erdevicemodel.deviceId]; NSString*str=[NSString stringWithFormat:@"deviceId=%@",self.erdevicemodel.deviceId.length?self.erdevicemodel.deviceId:[CommonUtils getNotNilStr:self.deviceid]];
self.erWeiMaView.image=[QRCodeGenerator qrImageForString:str imageSize:self.erWeiMaView.bounds.size.width]; self.erWeiMaView.image=[QRCodeGenerator qrImageForString:str imageSize:self.erWeiMaView.bounds.size.width];
} }

View File

@ -135,7 +135,7 @@ extern BOOL isfromCameraView;
[self creatConnectStateUI]; [self creatConnectStateUI];
//WiFi //WiFi
[self getSSid]; [self getSSid];
[self showStoreNameView];
} }
- (void)updateUI { - (void)updateUI {

View File

@ -13,7 +13,9 @@
{ {
self.messagetype=@"00"; self.messagetype=@"00";
self.massagelegth=@"12"; self.massagelegth=@"12";
self.functionCode=@"16"; if (!self.functionCode.length) {
self.functionCode=@"16";
}
return [NSString stringWithFormat:@"%@%@%@%@%@",self.messagetype,self.functionCode,self.sendmacId,self.resavemacId,self.massagelegth]; return [NSString stringWithFormat:@"%@%@%@%@%@",self.messagetype,self.functionCode,self.sendmacId,self.resavemacId,self.massagelegth];
} }

View File

@ -52,6 +52,9 @@
else if ([self.type isEqualToString:@"temp"]) { else if ([self.type isEqualToString:@"temp"]) {
title.text=@"恒温设置"; title.text=@"恒温设置";
} }
else if ([self.type isEqualToString:@"cycle"]) {
title.text=@"杀菌持续时长";
}
title.textAlignment=NSTextAlignmentCenter; title.textAlignment=NSTextAlignmentCenter;
@ -118,6 +121,10 @@ _picArr=@[@[@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13"
{ {
_picArr=@[@[@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31",@"32",@"33",@"34",@"35",@"36",@"37",@"38",@"39",@"40",@"41",@"42",@"43",@"44",@"45",@"46",@"47",@"48",@"49",@"50",@"51",@"52",@"53",@"54",@"55",@"56",@"57",@"58",@"59",@"60",@"61",@"62",@"63",@"64",@"65",@"66",@"67",@"68",@"69",@"70",@"71",@"72",@"73",@"74",@"75",@"76",@"77",@"78",@"79",@"80"]]; _picArr=@[@[@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31",@"32",@"33",@"34",@"35",@"36",@"37",@"38",@"39",@"40",@"41",@"42",@"43",@"44",@"45",@"46",@"47",@"48",@"49",@"50",@"51",@"52",@"53",@"54",@"55",@"56",@"57",@"58",@"59",@"60",@"61",@"62",@"63",@"64",@"65",@"66",@"67",@"68",@"69",@"70",@"71",@"72",@"73",@"74",@"75",@"76",@"77",@"78",@"79",@"80"]];
} }
else if ([self.type isEqualToString:@"cycle"])
{
_picArr=@[@[@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30"]];
}
} }