UI修改读取定时
This commit is contained in:
parent
e9992fed8b
commit
146e89a310
|
|
@ -2255,6 +2255,9 @@
|
||||||
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 */; };
|
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 */; };
|
C017B1E3245ED2D4003151DF /* UIImage+WaterMark.m in Sources */ = {isa = PBXBuildFile; fileRef = C017B1E1245ED2D4003151DF /* UIImage+WaterMark.m */; };
|
||||||
|
C01B9888282F50E8004FF42D /* UIView+Frame.m in Sources */ = {isa = PBXBuildFile; fileRef = C01B9886282F50E8004FF42D /* UIView+Frame.m */; };
|
||||||
|
C01B9889282F50E8004FF42D /* UIView+Frame.h in Headers */ = {isa = PBXBuildFile; fileRef = C01B9887282F50E8004FF42D /* UIView+Frame.h */; };
|
||||||
|
C01B988B282F802E004FF42D /* arrow_right@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C01B988A282F802E004FF42D /* arrow_right@2x.png */; };
|
||||||
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 */; };
|
||||||
|
|
@ -2299,7 +2302,6 @@
|
||||||
C0837A57244FF5510034FEC5 /* EGOCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C0837A55244FF5500034FEC5 /* EGOCache.m */; };
|
C0837A57244FF5510034FEC5 /* EGOCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C0837A55244FF5500034FEC5 /* EGOCache.m */; };
|
||||||
C0837A58244FF5510034FEC5 /* EGOCache.h in Headers */ = {isa = PBXBuildFile; fileRef = C0837A56244FF5500034FEC5 /* EGOCache.h */; };
|
C0837A58244FF5510034FEC5 /* EGOCache.h in Headers */ = {isa = PBXBuildFile; fileRef = C0837A56244FF5500034FEC5 /* EGOCache.h */; };
|
||||||
C089767E281BCB3A0098B5FA /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C089767D281BCB3A0098B5FA /* NetworkExtension.framework */; };
|
C089767E281BCB3A0098B5FA /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C089767D281BCB3A0098B5FA /* NetworkExtension.framework */; };
|
||||||
C08976AC282110280098B5FA /* arrow_right@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AB282110280098B5FA /* arrow_right@2x.png */; };
|
|
||||||
C08976B0282117930098B5FA /* 矩形.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AD282117920098B5FA /* 矩形.png */; };
|
C08976B0282117930098B5FA /* 矩形.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AD282117920098B5FA /* 矩形.png */; };
|
||||||
C08976B1282117930098B5FA /* 矩形@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AE282117920098B5FA /* 矩形@2x.png */; };
|
C08976B1282117930098B5FA /* 矩形@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AE282117920098B5FA /* 矩形@2x.png */; };
|
||||||
C08976B2282117930098B5FA /* 矩形@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AF282117930098B5FA /* 矩形@3x.png */; };
|
C08976B2282117930098B5FA /* 矩形@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AF282117930098B5FA /* 矩形@3x.png */; };
|
||||||
|
|
@ -5753,6 +5755,9 @@
|
||||||
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>"; };
|
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>"; };
|
C017B1E1245ED2D4003151DF /* UIImage+WaterMark.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+WaterMark.m"; sourceTree = "<group>"; };
|
||||||
|
C01B9886282F50E8004FF42D /* UIView+Frame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Frame.m"; sourceTree = "<group>"; };
|
||||||
|
C01B9887282F50E8004FF42D /* UIView+Frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Frame.h"; sourceTree = "<group>"; };
|
||||||
|
C01B988A282F802E004FF42D /* arrow_right@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow_right@2x.png"; 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>"; };
|
||||||
|
|
@ -5797,7 +5802,6 @@
|
||||||
C0837A55244FF5500034FEC5 /* EGOCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOCache.m; sourceTree = "<group>"; };
|
C0837A55244FF5500034FEC5 /* EGOCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOCache.m; sourceTree = "<group>"; };
|
||||||
C0837A56244FF5500034FEC5 /* EGOCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOCache.h; sourceTree = "<group>"; };
|
C0837A56244FF5500034FEC5 /* EGOCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOCache.h; sourceTree = "<group>"; };
|
||||||
C089767D281BCB3A0098B5FA /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
|
C089767D281BCB3A0098B5FA /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
|
||||||
C08976AB282110280098B5FA /* arrow_right@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "arrow_right@2x.png"; path = "../../../../../arrow_right@2x.png"; sourceTree = "<group>"; };
|
|
||||||
C08976AD282117920098B5FA /* 矩形.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形.png"; sourceTree = "<group>"; };
|
C08976AD282117920098B5FA /* 矩形.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形.png"; sourceTree = "<group>"; };
|
||||||
C08976AE282117920098B5FA /* 矩形@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形@2x.png"; sourceTree = "<group>"; };
|
C08976AE282117920098B5FA /* 矩形@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形@2x.png"; sourceTree = "<group>"; };
|
||||||
C08976AF282117930098B5FA /* 矩形@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形@3x.png"; sourceTree = "<group>"; };
|
C08976AF282117930098B5FA /* 矩形@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形@3x.png"; sourceTree = "<group>"; };
|
||||||
|
|
@ -9022,9 +9026,9 @@
|
||||||
882955A01DBDA3A100E9DDD7 /* ifishSetCell_back.png */,
|
882955A01DBDA3A100E9DDD7 /* ifishSetCell_back.png */,
|
||||||
FA08931D2275FCF10084A609 /* light_big@2x.png */,
|
FA08931D2275FCF10084A609 /* light_big@2x.png */,
|
||||||
FA0893092275DD770084A609 /* shajun_big@2x.png */,
|
FA0893092275DD770084A609 /* shajun_big@2x.png */,
|
||||||
C08976AB282110280098B5FA /* arrow_right@2x.png */,
|
|
||||||
882955A11DBDA3A100E9DDD7 /* secondSetCell.png */,
|
882955A11DBDA3A100E9DDD7 /* secondSetCell.png */,
|
||||||
882955A21DBDA3A100E9DDD7 /* set_cellBack.png */,
|
882955A21DBDA3A100E9DDD7 /* set_cellBack.png */,
|
||||||
|
C01B988A282F802E004FF42D /* arrow_right@2x.png */,
|
||||||
C08976AD282117920098B5FA /* 矩形.png */,
|
C08976AD282117920098B5FA /* 矩形.png */,
|
||||||
C08976AE282117920098B5FA /* 矩形@2x.png */,
|
C08976AE282117920098B5FA /* 矩形@2x.png */,
|
||||||
C08976AF282117930098B5FA /* 矩形@3x.png */,
|
C08976AF282117930098B5FA /* 矩形@3x.png */,
|
||||||
|
|
@ -12413,6 +12417,8 @@
|
||||||
C0C4CCFE272CDF4A00574BE8 /* UIViewController+Navgation.h */,
|
C0C4CCFE272CDF4A00574BE8 /* UIViewController+Navgation.h */,
|
||||||
C0C4CCFD272CDF4A00574BE8 /* UIViewController+Navgation.m */,
|
C0C4CCFD272CDF4A00574BE8 /* UIViewController+Navgation.m */,
|
||||||
C017B1E0245ED2D3003151DF /* UIImage+WaterMark.h */,
|
C017B1E0245ED2D3003151DF /* UIImage+WaterMark.h */,
|
||||||
|
C01B9887282F50E8004FF42D /* UIView+Frame.h */,
|
||||||
|
C01B9886282F50E8004FF42D /* UIView+Frame.m */,
|
||||||
C017B1E1245ED2D4003151DF /* UIImage+WaterMark.m */,
|
C017B1E1245ED2D4003151DF /* UIImage+WaterMark.m */,
|
||||||
C057166A282376CC004F113A /* UIButton+ImageTitleStyle.h */,
|
C057166A282376CC004F113A /* UIButton+ImageTitleStyle.h */,
|
||||||
C057166B282376CC004F113A /* UIButton+ImageTitleStyle.m */,
|
C057166B282376CC004F113A /* UIButton+ImageTitleStyle.m */,
|
||||||
|
|
@ -13107,6 +13113,7 @@
|
||||||
CB484E0A22B8C8C80075F050 /* avstring.h in Headers */,
|
CB484E0A22B8C8C80075F050 /* avstring.h in Headers */,
|
||||||
3D1C50DD221A9EE00096AE43 /* RecommendInfoDAO.h in Headers */,
|
3D1C50DD221A9EE00096AE43 /* RecommendInfoDAO.h in Headers */,
|
||||||
CB0F4E8722951A130091C76D /* SVIndefiniteAnimatedView.h in Headers */,
|
CB0F4E8722951A130091C76D /* SVIndefiniteAnimatedView.h in Headers */,
|
||||||
|
C01B9889282F50E8004FF42D /* UIView+Frame.h in Headers */,
|
||||||
3D1C5090221A9EDF0096AE43 /* AccountResult.h in Headers */,
|
3D1C5090221A9EDF0096AE43 /* AccountResult.h in Headers */,
|
||||||
CB484E1822B8C8C90075F050 /* old_codec_ids.h in Headers */,
|
CB484E1822B8C8C90075F050 /* old_codec_ids.h in Headers */,
|
||||||
2AC8750D26874F7500B6161C /* ESPTouchGenerator.h in Headers */,
|
2AC8750D26874F7500B6161C /* ESPTouchGenerator.h in Headers */,
|
||||||
|
|
@ -13639,7 +13646,6 @@
|
||||||
FAB3721322619DB70051E107 /* Xuanduo2fController.xib in Resources */,
|
FAB3721322619DB70051E107 /* Xuanduo2fController.xib in Resources */,
|
||||||
CB4820892334E99700A50C92 /* IQKeyboardManager.bundle in Resources */,
|
CB4820892334E99700A50C92 /* IQKeyboardManager.bundle in Resources */,
|
||||||
889C14F31EA7397B00470F50 /* personal_iocn_set.png in Resources */,
|
889C14F31EA7397B00470F50 /* personal_iocn_set.png in Resources */,
|
||||||
C08976AC282110280098B5FA /* arrow_right@2x.png in Resources */,
|
|
||||||
883E78ED1D48A5E50030E075 /* ConnectWifiViewController.xib in Resources */,
|
883E78ED1D48A5E50030E075 /* ConnectWifiViewController.xib in Resources */,
|
||||||
8807074B1DDD40B40076F65A /* P2PShareViewsec2Cell.xib in Resources */,
|
8807074B1DDD40B40076F65A /* P2PShareViewsec2Cell.xib in Resources */,
|
||||||
8869B3AD1E6967DF0010F099 /* levelUp_yashark@3x.png in Resources */,
|
8869B3AD1E6967DF0010F099 /* levelUp_yashark@3x.png in Resources */,
|
||||||
|
|
@ -13819,6 +13825,7 @@
|
||||||
883E788E1D48A5E50030E075 /* InfoViewNiChengCell.xib in Resources */,
|
883E788E1D48A5E50030E075 /* InfoViewNiChengCell.xib in Resources */,
|
||||||
886B80741D63112000E1B9B3 /* CertificationViewSecondCell.xib in Resources */,
|
886B80741D63112000E1B9B3 /* CertificationViewSecondCell.xib in Resources */,
|
||||||
882955EE1DBDA3A100E9DDD7 /* lightclose.png in Resources */,
|
882955EE1DBDA3A100E9DDD7 /* lightclose.png in Resources */,
|
||||||
|
C01B988B282F802E004FF42D /* arrow_right@2x.png in Resources */,
|
||||||
88C1B2D51DD1ADB600C2C99A /* live_navicon_look@3x.png in Resources */,
|
88C1B2D51DD1ADB600C2C99A /* live_navicon_look@3x.png in Resources */,
|
||||||
882957621DBDA3A300E9DDD7 /* ifisharrow_r@1x.png in Resources */,
|
882957621DBDA3A300E9DDD7 /* ifisharrow_r@1x.png in Resources */,
|
||||||
886B80791D63114500E1B9B3 /* CertificationViewThirdCell.xib in Resources */,
|
886B80791D63114500E1B9B3 /* CertificationViewThirdCell.xib in Resources */,
|
||||||
|
|
@ -15155,6 +15162,7 @@
|
||||||
88597ABC1E56BAF1003D0E5C /* PopView.m in Sources */,
|
88597ABC1E56BAF1003D0E5C /* PopView.m in Sources */,
|
||||||
3D8F64C12157530000F04BD3 /* IfishHistroyVo.m in Sources */,
|
3D8F64C12157530000F04BD3 /* IfishHistroyVo.m in Sources */,
|
||||||
880707F91DE3DF540076F65A /* MineKanKanRoomInfo.m in Sources */,
|
880707F91DE3DF540076F65A /* MineKanKanRoomInfo.m in Sources */,
|
||||||
|
C01B9888282F50E8004FF42D /* UIView+Frame.m in Sources */,
|
||||||
881672221EA5DE2B00BEBF23 /* UMComBriefEditViewController.m in Sources */,
|
881672221EA5DE2B00BEBF23 /* UMComBriefEditViewController.m in Sources */,
|
||||||
3D1C511C221A9EE00096AE43 /* IfishCameraModel.m in Sources */,
|
3D1C511C221A9EE00096AE43 /* IfishCameraModel.m in Sources */,
|
||||||
881672341EA5DE2B00BEBF23 /* UMComLikeButtonTableViewCell.m in Sources */,
|
881672341EA5DE2B00BEBF23 /* UMComLikeButtonTableViewCell.m in Sources */,
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,37 @@
|
||||||
|
//
|
||||||
|
// UIView+Frame.h
|
||||||
|
// FWChat
|
||||||
|
//
|
||||||
|
// Created by Yang on 16/1/25.
|
||||||
|
// Copyright © 2016年 Yang. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface UIView (Frame)
|
||||||
|
|
||||||
|
@property (nonatomic, assign) CGFloat x;
|
||||||
|
@property (nonatomic, assign) CGFloat y;
|
||||||
|
|
||||||
|
@property (nonatomic, assign) CGPoint origin;
|
||||||
|
@property (nonatomic, assign) CGSize size;
|
||||||
|
|
||||||
|
@property (nonatomic) CGFloat centerX;
|
||||||
|
@property (nonatomic) CGFloat centerY;
|
||||||
|
|
||||||
|
@property (nonatomic) CGFloat top;
|
||||||
|
@property (nonatomic) CGFloat bottom;
|
||||||
|
@property (nonatomic) CGFloat right;
|
||||||
|
@property (nonatomic) CGFloat left;
|
||||||
|
|
||||||
|
@property (nonatomic) CGFloat width;
|
||||||
|
@property (nonatomic) CGFloat height;
|
||||||
|
|
||||||
|
+ (instancetype)viewFromXib;
|
||||||
|
|
||||||
|
/** 设置锚点 */
|
||||||
|
- (void)setAnchorPoint:(CGPoint)anchorPoint;
|
||||||
|
/** 设回默认锚点 */
|
||||||
|
- (void)setDefaultAnchorPoint;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,173 @@
|
||||||
|
//
|
||||||
|
// UIView+Frame.m
|
||||||
|
// FWChat
|
||||||
|
//
|
||||||
|
// Created by Yang on 16/1/25.
|
||||||
|
// Copyright © 2016年 Yang. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "UIView+Frame.h"
|
||||||
|
|
||||||
|
@implementation UIView (Frame)
|
||||||
|
|
||||||
|
- (CGFloat)x
|
||||||
|
{
|
||||||
|
return self.frame.origin.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setX:(CGFloat)x
|
||||||
|
{
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.origin.x = x;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)y
|
||||||
|
{
|
||||||
|
return self.frame.origin.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setY:(CGFloat)y
|
||||||
|
{
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.origin.y = y;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Shortcuts for the coords
|
||||||
|
- (CGFloat)top
|
||||||
|
{
|
||||||
|
return self.frame.origin.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setTop:(CGFloat)y
|
||||||
|
{
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.origin.y = y;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)right
|
||||||
|
{
|
||||||
|
return self.frame.origin.x + self.frame.size.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setRight:(CGFloat)right
|
||||||
|
{
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.origin.x = right - self.frame.size.width;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)bottom
|
||||||
|
{
|
||||||
|
return self.frame.origin.y + self.frame.size.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setBottom:(CGFloat)bottom
|
||||||
|
{
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.origin.y = bottom - self.frame.size.height;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)left
|
||||||
|
{
|
||||||
|
return self.frame.origin.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setLeft:(CGFloat)x
|
||||||
|
{
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.origin.x = x;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)width
|
||||||
|
{
|
||||||
|
return self.frame.size.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setWidth:(CGFloat)width
|
||||||
|
{
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.size.width = width;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)height
|
||||||
|
{
|
||||||
|
return self.frame.size.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setHeight:(CGFloat)height
|
||||||
|
{
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.size.height = height;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Shortcuts for frame properties
|
||||||
|
- (CGPoint)origin {
|
||||||
|
return self.frame.origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setOrigin:(CGPoint)origin {
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.origin = origin;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGSize)size {
|
||||||
|
return self.frame.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setSize:(CGSize)size {
|
||||||
|
CGRect frame = self.frame;
|
||||||
|
frame.size = size;
|
||||||
|
self.frame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Shortcuts for positions
|
||||||
|
- (CGFloat)centerX {
|
||||||
|
return self.center.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setCenterX:(CGFloat)centerX {
|
||||||
|
self.center = CGPointMake(centerX, self.center.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)centerY {
|
||||||
|
return self.center.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setCenterY:(CGFloat)centerY {
|
||||||
|
self.center = CGPointMake(self.center.x, centerY);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (instancetype)viewFromXib
|
||||||
|
{
|
||||||
|
return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setAnchorPoint:(CGPoint)anchorPoint
|
||||||
|
{
|
||||||
|
CGPoint oldOrigin = self.frame.origin;
|
||||||
|
self.layer.anchorPoint = anchorPoint;
|
||||||
|
CGPoint newOrigin = self.frame.origin;
|
||||||
|
|
||||||
|
CGPoint transition;
|
||||||
|
transition.x = newOrigin.x - oldOrigin.x;
|
||||||
|
transition.y = newOrigin.y - oldOrigin.y;
|
||||||
|
|
||||||
|
self.center = CGPointMake (self.center.x - transition.x, self.center.y - transition.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setDefaultAnchorPoint
|
||||||
|
{
|
||||||
|
[self setAnchorPoint:CGPointMake(0.5f, 0.5f)];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
#pragma mark soket错误断开
|
#pragma mark soket错误断开
|
||||||
|
|
||||||
-(void)onSocket:(AsyncSocket *)sock willDisconnectWithError:(NSError *)err{
|
-(void)onSocket:(AsyncSocket *)sock willDisconnectWithError:(NSError *)err{
|
||||||
NSLog(@"soket错误断开");
|
NSLog(@"soket错误断开:%@",err);
|
||||||
NSLog(@"存留数据%@",[sock unreadData]);
|
NSLog(@"存留数据%@",[sock unreadData]);
|
||||||
if (self.communiteDelegate&&[self.communiteDelegate respondsToSelector:@selector(ifishSocket:willDisconnectWithError:)]) {
|
if (self.communiteDelegate&&[self.communiteDelegate respondsToSelector:@selector(ifishSocket:willDisconnectWithError:)]) {
|
||||||
[self.communiteDelegate ifishSocket:sock willDisconnectWithError:err];
|
[self.communiteDelegate ifishSocket:sock willDisconnectWithError:err];
|
||||||
|
|
@ -135,7 +135,7 @@
|
||||||
[self.communiteDelegate ifishSocket:sock ifishSocketdidConnectToHost:host port:port];
|
[self.communiteDelegate ifishSocket:sock ifishSocketdidConnectToHost:host port:port];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"comm已经与服务器建立连接%d macAddress%@", self.clientSocket.isConnected,self.macAddress);
|
NSLog(@"服务器建立连接%d macAddress%@", self.clientSocket.isConnected,self.macAddress);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
NSString*string1=[dataContorl dataToHexString:data];
|
NSString*string1=[dataContorl dataToHexString:data];
|
||||||
NSString*string2=[string1 substringWithRange:NSMakeRange(30, 2)];
|
NSString*string2=[string1 substringWithRange:NSMakeRange(30, 2)];
|
||||||
if ([string2 isEqualToString:@"01"]&&string1.length==52) {
|
if ([string2 isEqualToString:@"01"]&&string1.length==52) {
|
||||||
NSLog(@"app登录成功");
|
|
||||||
// 查询
|
// 查询
|
||||||
|
|
||||||
// AppDelegate*delegate=[[UIApplication sharedApplication]delegate];
|
// AppDelegate*delegate=[[UIApplication sharedApplication]delegate];
|
||||||
|
|
@ -180,6 +180,7 @@
|
||||||
|
|
||||||
[self getDeviceInfo];
|
[self getDeviceInfo];
|
||||||
if (self.communiteDelegate) {
|
if (self.communiteDelegate) {
|
||||||
|
NSLog(@"登录");
|
||||||
[self.communiteDelegate ifishDeviceLogInSuccees];
|
[self.communiteDelegate ifishDeviceLogInSuccees];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,6 +191,7 @@
|
||||||
// [delegate.window makeToast:@"设备已离线"];
|
// [delegate.window makeToast:@"设备已离线"];
|
||||||
|
|
||||||
if (self.communiteDelegate) {
|
if (self.communiteDelegate) {
|
||||||
|
NSLog(@"离线");
|
||||||
[self.communiteDelegate ifishDeviceLogInFail];
|
[self.communiteDelegate ifishDeviceLogInFail];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -203,7 +205,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"登陆成功后收到服务器的回执--->%@",data);
|
NSLog(@"readData--->%@",data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -252,7 +254,7 @@
|
||||||
-(void)soketWriteData:(NSData *)data{
|
-(void)soketWriteData:(NSData *)data{
|
||||||
|
|
||||||
[ self.clientSocket writeData:data withTimeout:-1 tag:0];
|
[ self.clientSocket writeData:data withTimeout:-1 tag:0];
|
||||||
NSLog(@"manulData:%@",data);
|
NSLog(@"sendData:%@",data);
|
||||||
|
|
||||||
[self.clientSocket readDataWithTimeout:-1 tag:0];// 会出现接受服务器心跳包粘包问题
|
[self.clientSocket readDataWithTimeout:-1 tag:0];// 会出现接受服务器心跳包粘包问题
|
||||||
//[ self.singletonSocket.clientSocket readDataToLength:99 withTimeout:-1 tag:0];// 防止心跳包粘包
|
//[ self.singletonSocket.clientSocket readDataToLength:99 withTimeout:-1 tag:0];// 防止心跳包粘包
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
|
||||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
@class TimerTypeTableViewCell;
|
@class TimerTypeTableViewCell;
|
||||||
@protocol TimerTypeTableViewCellDelegate <NSObject>
|
@protocol TimerTypeTableViewCellDelegate <NSObject>
|
||||||
|
|
||||||
-(void)clickCell:(TimerTypeTableViewCell*)cell button:(UIButton*)button timerType:(NSInteger*)type;
|
-(void)clickCell:(TimerTypeTableViewCell*)cell button:(UIButton*)button timerType:(NSInteger)type;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@interface TimerTypeTableViewCell : UITableViewCell
|
@interface TimerTypeTableViewCell : UITableViewCell
|
||||||
|
|
|
||||||
|
|
@ -55,11 +55,12 @@
|
||||||
xuanduoModel.waterTemperature = [dataString substringWithRange:NSMakeRange(60, 4)];
|
xuanduoModel.waterTemperature = [dataString substringWithRange:NSMakeRange(60, 4)];
|
||||||
xuanduoModel.heatingTemperature = [dataString substringWithRange:NSMakeRange(64, 4)];
|
xuanduoModel.heatingTemperature = [dataString substringWithRange:NSMakeRange(64, 4)];
|
||||||
xuanduoModel.huliLight = [dataString substringWithRange:NSMakeRange(68, 2)];
|
xuanduoModel.huliLight = [dataString substringWithRange:NSMakeRange(68, 2)];
|
||||||
xuanduoModel.fishFeed = [dataString substringWithRange:NSMakeRange(70, 2)];
|
xuanduoModel.fishFeedOrder = [dataString substringWithRange:NSMakeRange(70, 2)];
|
||||||
xuanduoModel.powerRating = [dataString substringWithRange:NSMakeRange(72, 4)];
|
xuanduoModel.powerRating = [dataString substringWithRange:NSMakeRange(72, 4)];
|
||||||
xuanduoModel.alarmSwitch = [dataString substringWithRange:NSMakeRange(76, 2)];
|
xuanduoModel.alarmSwitch = [dataString substringWithRange:NSMakeRange(76, 2)];
|
||||||
xuanduoModel.miniTemp = [dataString substringWithRange:NSMakeRange(78, 4)];
|
xuanduoModel.miniTemp = [dataString substringWithRange:NSMakeRange(78, 4)];
|
||||||
xuanduoModel.maxTemp = [dataString substringWithRange:NSMakeRange(82, 4)];
|
xuanduoModel.maxTemp = [dataString substringWithRange:NSMakeRange(82, 4)];
|
||||||
|
xuanduoModel.fishFeedStatus = [dataString substringWithRange:NSMakeRange(86, 2)];
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ([type isEqualToString:DECICE_TYPE_XUANDUO3F]&&[model isKindOfClass:[Xuanduo3fModel class]]&&dataString.length>67)
|
else if ([type isEqualToString:DECICE_TYPE_XUANDUO3F]&&[model isKindOfClass:[Xuanduo3fModel class]]&&dataString.length>67)
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,18 @@ bfec crc16校验码
|
||||||
/// 最高温
|
/// 最高温
|
||||||
@property (nonatomic, strong) NSString *maxTemp;
|
@property (nonatomic, strong) NSString *maxTemp;
|
||||||
@property (nonatomic, strong) NSString *waterLevel;//水位报警开关
|
@property (nonatomic, strong) NSString *waterLevel;//水位报警开关
|
||||||
/// 一键喂鱼 4 5 f有
|
/// 一键喂鱼 4 5 f有 一键喂鱼0 关,1开(背光)手机到设备
|
||||||
@property (nonatomic, strong) NSString *fishFeed;
|
/// 设置值 发送指令 打开或者关闭 注意发送指定和接受状态不是一个字段
|
||||||
|
@property (nonatomic, strong) NSString *fishFeedOrder;
|
||||||
|
/// 4 5 f有 一键喂鱼0 关,1开(湿度)设备到手机
|
||||||
|
/// 接受值 这个值会变化,喂鱼结束则为0 开启1 只接受状态
|
||||||
|
@property (nonatomic, strong) NSString *fishFeedStatus;
|
||||||
/// 功率 4 5 f有
|
/// 功率 4 5 f有
|
||||||
@property (nonatomic, strong) NSString *powerRating;
|
@property (nonatomic, strong) NSString *powerRating;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
self.userInteractionEnabled=YES;
|
self.userInteractionEnabled=YES;
|
||||||
|
|
||||||
[self.statusBtn setTitle:@"关闭" forState:UIControlStateNormal];
|
[self.statusBtn setTitle:@"关闭" forState:UIControlStateNormal];
|
||||||
[self.statusBtn setTitle:@"打开" forState:UIControlStateNormal];
|
[self.statusBtn setTitle:@"打开" forState:UIControlStateSelected];
|
||||||
|
|
||||||
}
|
}
|
||||||
- (void)configWithImageName:(NSString *)name labelName:(NSString *)labelName {
|
- (void)configWithImageName:(NSString *)name labelName:(NSString *)labelName {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AWf-ci-ZDG">
|
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AWf-ci-ZDG">
|
||||||
<rect key="frame" x="310" y="0.0" width="30" height="30"/>
|
<rect key="frame" x="310" y="5" width="30" height="30"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="30" id="BSn-IJ-pQK"/>
|
<constraint firstAttribute="height" constant="30" id="BSn-IJ-pQK"/>
|
||||||
<constraint firstAttribute="width" constant="30" id="RtE-QV-28X"/>
|
<constraint firstAttribute="width" constant="30" id="RtE-QV-28X"/>
|
||||||
|
|
@ -51,13 +51,13 @@
|
||||||
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
|
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="AWf-ci-ZDG" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="K05-ks-Nmu"/>
|
|
||||||
<constraint firstItem="Y79-yA-YK5" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="Xed-ko-MEG"/>
|
<constraint firstItem="Y79-yA-YK5" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="Xed-ko-MEG"/>
|
||||||
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="AWf-ci-ZDG" secondAttribute="trailing" constant="35" id="Y5h-qw-cMO"/>
|
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="AWf-ci-ZDG" secondAttribute="trailing" constant="35" id="Y5h-qw-cMO"/>
|
||||||
<constraint firstItem="Y79-yA-YK5" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="gST-eX-J7c"/>
|
<constraint firstItem="Y79-yA-YK5" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="gST-eX-J7c"/>
|
||||||
<constraint firstItem="15T-Hk-end" firstAttribute="centerY" secondItem="FHB-eh-cwx" secondAttribute="centerY" id="iKL-10-FRc"/>
|
<constraint firstItem="15T-Hk-end" firstAttribute="centerY" secondItem="FHB-eh-cwx" secondAttribute="centerY" id="iKL-10-FRc"/>
|
||||||
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="Y79-yA-YK5" secondAttribute="trailing" id="k1b-ga-ZxG"/>
|
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="Y79-yA-YK5" secondAttribute="trailing" id="k1b-ga-ZxG"/>
|
||||||
<constraint firstItem="FHB-eh-cwx" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="18" id="nac-Pm-Unf"/>
|
<constraint firstItem="FHB-eh-cwx" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="18" id="nac-Pm-Unf"/>
|
||||||
|
<constraint firstItem="AWf-ci-ZDG" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="sAJ-cf-z7L"/>
|
||||||
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="FHB-eh-cwx" secondAttribute="bottom" constant="7" id="uE5-FC-gtB"/>
|
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="FHB-eh-cwx" secondAttribute="bottom" constant="7" id="uE5-FC-gtB"/>
|
||||||
<constraint firstItem="Y79-yA-YK5" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="wNy-g6-uXh"/>
|
<constraint firstItem="Y79-yA-YK5" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="wNy-g6-uXh"/>
|
||||||
<constraint firstItem="15T-Hk-end" firstAttribute="leading" secondItem="FHB-eh-cwx" secondAttribute="trailing" constant="4" id="ytC-rn-ftY"/>
|
<constraint firstItem="15T-Hk-end" firstAttribute="leading" secondItem="FHB-eh-cwx" secondAttribute="trailing" constant="4" id="ytC-rn-ftY"/>
|
||||||
|
|
|
||||||
|
|
@ -397,6 +397,7 @@ static NSString *setTimerflag = @"SetTimerCell";
|
||||||
return oneHeader;
|
return oneHeader;
|
||||||
}else if(section > 1){
|
}else if(section > 1){
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
||||||
|
headerView.backImageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
headerView.controlBtn.tag = kBtnTag + section;
|
||||||
if (_selectSection == section) {
|
if (_selectSection == section) {
|
||||||
headerView.controlBtn.selected = YES;
|
headerView.controlBtn.selected = YES;
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
[self.tableView registerNib:[UINib nibWithNibName:setTimerflag bundle:nil] forCellReuseIdentifier:setTimerflag];
|
[self.tableView registerNib:[UINib nibWithNibName:setTimerflag bundle:nil] forCellReuseIdentifier:setTimerflag];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)clickCell:(TimerTypeTableViewCell *)cell button:(UIButton *)button timerType:(NSInteger *)type
|
-(void)clickCell:(TimerTypeTableViewCell *)cell button:(UIButton *)button timerType:(NSInteger)type
|
||||||
{
|
{
|
||||||
XuanduoTimerSettingViewController *_settingVC = [[XuanduoTimerSettingViewController alloc] init];
|
XuanduoTimerSettingViewController *_settingVC = [[XuanduoTimerSettingViewController alloc] init];
|
||||||
_settingVC.currentdevice = self.currentdevice;
|
_settingVC.currentdevice = self.currentdevice;
|
||||||
|
|
@ -416,7 +416,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
}else if (indexPath.section - 2 <_titieArr.count) {
|
}else if (indexPath.section - 2 <_titieArr.count) {
|
||||||
NSArray *dataArr = [self.timeDic objectForKey:_titieArr[indexPath.section-2]];
|
NSArray *dataArr = [self.timeDic objectForKey:_titieArr[indexPath.section-2]];
|
||||||
BOOL havePlus = [dataArr containsObject:plusflag];
|
BOOL havePlus = [dataArr containsObject:plusflag];
|
||||||
if (_selectSection == indexPath.section) {
|
if (_selectSection == indexPath.section&&_timerType) {
|
||||||
if (havePlus && indexPath.row == dataArr.count - 1) {
|
if (havePlus && indexPath.row == dataArr.count - 1) {
|
||||||
return 40;
|
return 40;
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -464,6 +464,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
return oneHeader;
|
return oneHeader;
|
||||||
}else if(section == 2){
|
}else if(section == 2){
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
||||||
|
headerView.backImageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
headerView.controlBtn.tag = kBtnTag + section;
|
||||||
if (_selectSection == section) {
|
if (_selectSection == section) {
|
||||||
headerView.controlBtn.selected = YES;
|
headerView.controlBtn.selected = YES;
|
||||||
|
|
@ -473,6 +474,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
return headerView;
|
return headerView;
|
||||||
}else if(section == 3){
|
}else if(section == 3){
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
||||||
|
headerView.backImageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
headerView.controlBtn.tag = kBtnTag + section;
|
||||||
if (_selectSection == section) {
|
if (_selectSection == section) {
|
||||||
headerView.controlBtn.selected = YES;
|
headerView.controlBtn.selected = YES;
|
||||||
|
|
@ -482,6 +484,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
return headerView;
|
return headerView;
|
||||||
}else if(section == 4){
|
}else if(section == 4){
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
||||||
|
headerView.backImageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
headerView.controlBtn.tag = kBtnTag + section;
|
||||||
if (_selectSection == section) {
|
if (_selectSection == section) {
|
||||||
headerView.controlBtn.selected = YES;
|
headerView.controlBtn.selected = YES;
|
||||||
|
|
@ -499,6 +502,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
||||||
|
headerView.backImageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
headerView.controlBtn.tag = kBtnTag + section;
|
||||||
if (_selectSection == section) {
|
if (_selectSection == section) {
|
||||||
headerView.controlBtn.selected = YES;
|
headerView.controlBtn.selected = YES;
|
||||||
|
|
@ -510,6 +514,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
|
|
||||||
}else if(section == 6){
|
}else if(section == 6){
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
||||||
|
headerView.backImageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
headerView.controlBtn.tag = kBtnTag + section;
|
||||||
if (_selectSection == section) {
|
if (_selectSection == section) {
|
||||||
headerView.controlBtn.selected = YES;
|
headerView.controlBtn.selected = YES;
|
||||||
|
|
@ -519,6 +524,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
return headerView;
|
return headerView;
|
||||||
}else if(section == 7){
|
}else if(section == 7){
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
||||||
|
headerView.backImageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
headerView.controlBtn.tag = kBtnTag + section;
|
||||||
if (_selectSection == section) {
|
if (_selectSection == section) {
|
||||||
headerView.controlBtn.selected = YES;
|
headerView.controlBtn.selected = YES;
|
||||||
|
|
@ -625,6 +631,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
- (void)foldAction:(UIButton *)btn {
|
- (void)foldAction:(UIButton *)btn {
|
||||||
if (_selectSection == btn.tag - kBtnTag) {
|
if (_selectSection == btn.tag - kBtnTag) {
|
||||||
_selectSection = -1;
|
_selectSection = -1;
|
||||||
|
_timerType=nil;
|
||||||
[self.tableView reloadData];
|
[self.tableView reloadData];
|
||||||
}else {
|
}else {
|
||||||
//读取开关定时
|
//读取开关定时
|
||||||
|
|
@ -1612,45 +1619,8 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (0)
|
|
||||||
{
|
|
||||||
if (!_timerModel) {
|
|
||||||
_timerModel = [[Xuanduo2TimerModel alloc] init];
|
|
||||||
_timerModel.groupModelArr = [NSMutableArray array];
|
|
||||||
}else {
|
|
||||||
[_timerModel.groupModelArr removeAllObjects];
|
|
||||||
}
|
|
||||||
[Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1 type:self.currentdevice.type];
|
|
||||||
NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection-2]];
|
|
||||||
[dataArr removeAllObjects];
|
|
||||||
[dataArr addObject:plusflag];
|
|
||||||
[dataArr addObjectsFromArray:_timerModel.groupModelArr];
|
|
||||||
BOOL havePlus = [dataArr containsObject:plusflag];
|
|
||||||
if (havePlus && dataArr.count > 10) {
|
|
||||||
[dataArr removeObjectAtIndex:0];
|
|
||||||
}else if (!havePlus && dataArr.count < 10){
|
|
||||||
[dataArr insertObject:plusflag atIndex:0];
|
|
||||||
}
|
|
||||||
NSLog(@"dataarr.count = %ld",dataArr.count);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
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];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
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];
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@
|
||||||
#import "IfishDeviceInfo.h"
|
#import "IfishDeviceInfo.h"
|
||||||
#include "xuanduo3fModel.h"
|
#include "xuanduo3fModel.h"
|
||||||
#import "ReadTimerModel.h"
|
#import "ReadTimerModel.h"
|
||||||
|
#import "UIView+Frame.h"
|
||||||
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
||||||
{
|
{
|
||||||
CGFloat height=0;
|
CGFloat height=0;
|
||||||
height=(section==0?50:40);
|
height=50;
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,7 +358,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
height=section==0?50:40;
|
height=section==0?50:40;
|
||||||
UIImageView*imageView=[[UIImageView alloc]init];
|
UIImageView*imageView=[[UIImageView alloc]init];
|
||||||
imageView.frame=CGRectMake(0, 0, self.tableView.frame.size.width, height);
|
imageView.frame=CGRectMake(0, 0, self.tableView.frame.size.width, height);
|
||||||
imageView.image=[UIImage imageNamed:@"ifishSetCell_back"];
|
imageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, self.tableView.frame.size.width-20, height)];
|
UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, self.tableView.frame.size.width-20, height)];
|
||||||
label.text=_titieArr[section];
|
label.text=_titieArr[section];
|
||||||
label.textColor=[UIColor blackColor];
|
label.textColor=[UIColor blackColor];
|
||||||
|
|
@ -368,11 +368,21 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
}else if(section == 1)
|
}else if(section == 1)
|
||||||
{
|
{
|
||||||
CGFloat height=0;
|
CGFloat height=0;
|
||||||
height=section==0?50:40;
|
height=50;
|
||||||
UIImageView*imageView=[[UIImageView alloc]init];
|
UIImageView*imageView=[[UIImageView alloc]init];
|
||||||
imageView.frame=CGRectMake(0, 0, self.tableView.frame.size.width, height);
|
imageView.frame=CGRectMake(0, 0, self.tableView.frame.size.width, height);
|
||||||
imageView.image=[UIImage imageNamed:@"ifishSetCell_back"];
|
imageView.image=[UIImage imageNamed:@"set_cellBack"];
|
||||||
|
UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, self.tableView.frame.size.width-20, height)];
|
||||||
|
label.text=@"全天自恢复模式";
|
||||||
|
label.textColor=[UIColor blackColor];
|
||||||
|
[imageView addSubview:label];
|
||||||
|
UIButton*swichBtn=[UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
[swichBtn setBackgroundImage:[UIImage imageNamed:@"graybtn_big.png"] forState:UIControlStateNormal];
|
||||||
|
[swichBtn setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateSelected];
|
||||||
|
[swichBtn addTarget:self action:@selector(allDayModesSwitchAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
swichBtn.frame=CGRectMake(CGRectGetWidth(imageView.frame)-8-60, (CGRectGetHeight(imageView.frame)-33)/2.0, 60, 33);
|
||||||
|
[imageView addSubview:swichBtn];
|
||||||
|
imageView.userInteractionEnabled=YES;
|
||||||
|
|
||||||
return imageView;
|
return imageView;
|
||||||
}
|
}
|
||||||
|
|
@ -621,6 +631,85 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ([_cycleModel.status isEqualToString:@"01"]) {
|
||||||
|
_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)allDayModesSwitchAction:(UIButton *)btn {
|
||||||
|
|
||||||
|
btn.selected=!btn.selected;
|
||||||
|
return;
|
||||||
|
NSInteger index = btn.tag - kSwitchBtnTag;
|
||||||
|
|
||||||
|
NSArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection]];
|
||||||
|
BOOL havePlus = [dataArr containsObject:plusflag];
|
||||||
|
SetTimerModel *timerModel = [[SetTimerModel alloc] init];
|
||||||
|
timerModel.sendmacId =self.currentdevice.macAddress;
|
||||||
|
timerModel.resavemacId = self.currentdevice.macAddress;
|
||||||
|
timerModel.crc16str=@"0000";
|
||||||
|
XuanduoTimerGroup *group = [dataArr objectAtIndex:(havePlus?index+1:index)];
|
||||||
|
if ([group isKindOfClass: [XuanduoTimerGroup class] ]) {
|
||||||
|
NSString*hexDateString1=[dataContorl dateStringToHexString:group.startTime];
|
||||||
|
NSString*hexDateString2=[dataContorl dateStringToHexString:group.endTime];
|
||||||
|
timerModel.selectorTime=[NSString stringWithFormat:@"%@%@",hexDateString1,hexDateString2];
|
||||||
|
timerModel.groupNumber = [dataContorl groupNumberTohex:group.groupNumber.integerValue];
|
||||||
|
if ([group.status isEqualToString:@"01"]) {
|
||||||
|
timerModel.isOn = @"00";
|
||||||
|
}else {
|
||||||
|
timerModel.isOn = @"01";
|
||||||
|
}
|
||||||
|
|
||||||
|
ReadTimerModel *readModel = [[ReadTimerModel alloc] init];
|
||||||
|
readModel.sendmacId =self.currentdevice.macAddress;
|
||||||
|
readModel.resavemacId = self.currentdevice.macAddress;
|
||||||
|
readModel.crc16str=@"0000";
|
||||||
|
readModel.selectorNumber=@"";
|
||||||
|
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];
|
||||||
|
;
|
||||||
|
}
|
||||||
|
else if ([group isKindOfClass: [XuanduoCycleModel class] ])
|
||||||
|
{
|
||||||
|
baseModel*tempModel=[[baseModel alloc]init];
|
||||||
|
tempModel.sendmacId =self.currentdevice.macAddress;
|
||||||
|
tempModel.resavemacId =self.currentdevice.macAddress;
|
||||||
|
tempModel.functionCode=@"18";
|
||||||
|
tempModel.massagelegth=@"17";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ([_cycleModel.status isEqualToString:@"01"]) {
|
if ([_cycleModel.status isEqualToString:@"01"]) {
|
||||||
_cycleModel.status = @"00";
|
_cycleModel.status = @"00";
|
||||||
}else {
|
}else {
|
||||||
|
|
@ -1442,27 +1531,64 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
NSString*string1=[dataContorl dataToHexString:data];
|
NSString*string1=[dataContorl dataToHexString:data];
|
||||||
NSLog(@"return str == %@",string1);
|
NSLog(@"return str == %@",string1);
|
||||||
NSString *readTimer = [string1 substringToIndex:4];
|
NSString *readTimer = [string1 substringToIndex:4];
|
||||||
if ([readTimer isEqualToString:@"0116"]) {
|
if ([readTimer isEqualToString:@"0116"])
|
||||||
if (!_timerModel) {
|
{
|
||||||
_timerModel = [[Xuanduo2TimerModel alloc] init];
|
NSString*lightNumber=[string1 substringWithRange:NSMakeRange(30, 2)];
|
||||||
_timerModel.groupModelArr = [NSMutableArray array];
|
if (self.timerType==1&&[lightNumber containsString:@"0"])//定时
|
||||||
}else {
|
{
|
||||||
[_timerModel.groupModelArr removeAllObjects];
|
if (!_timerModel) {
|
||||||
}
|
_timerModel = [[Xuanduo2TimerModel alloc] init];
|
||||||
[Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1 type:self.currentdevice.type];
|
_timerModel.groupModelArr = [NSMutableArray array];
|
||||||
NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection]];
|
}else {
|
||||||
[dataArr removeAllObjects];
|
[_timerModel.groupModelArr removeAllObjects];
|
||||||
[dataArr addObject:plusflag];
|
}
|
||||||
[dataArr addObjectsFromArray:_timerModel.groupModelArr];
|
[Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1 type:self.currentdevice.type];
|
||||||
BOOL havePlus = [dataArr containsObject:plusflag];
|
NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection]];
|
||||||
if (havePlus && dataArr.count > 10) {
|
[dataArr removeAllObjects];
|
||||||
[dataArr removeObjectAtIndex:0];
|
[dataArr addObject:plusflag];
|
||||||
}else if (!havePlus && dataArr.count < 10){
|
[dataArr addObjectsFromArray:_timerModel.groupModelArr];
|
||||||
[dataArr insertObject:plusflag atIndex:0];
|
BOOL havePlus = [dataArr containsObject:plusflag];
|
||||||
}
|
if (havePlus && dataArr.count > 10) {
|
||||||
NSLog(@"dataarr.count = %ld",dataArr.count);
|
[dataArr removeObjectAtIndex:0];
|
||||||
|
}else if (!havePlus && dataArr.count < 10){
|
||||||
|
[dataArr insertObject:plusflag atIndex:0];
|
||||||
|
}
|
||||||
|
NSLog(@"dataarr.count = %ld",dataArr.count);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (self.timerType==2&&[lightNumber containsString:@"e"])//循环
|
||||||
|
{
|
||||||
|
_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];
|
||||||
|
}
|
||||||
|
else if (self.timerType==3&&[lightNumber containsString:@"d"])//自恢复
|
||||||
|
{
|
||||||
|
if (!_timerModel) {
|
||||||
|
_timerModel = [[Xuanduo2TimerModel alloc] init];
|
||||||
|
_timerModel.groupModelArr = [NSMutableArray array];
|
||||||
|
}else {
|
||||||
|
[_timerModel.groupModelArr removeAllObjects];
|
||||||
|
}
|
||||||
|
[Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1 type:self.currentdevice.type];
|
||||||
|
NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection]];
|
||||||
|
[dataArr removeAllObjects];
|
||||||
|
[dataArr addObject:plusflag];
|
||||||
|
[dataArr addObjectsFromArray:_timerModel.groupModelArr];
|
||||||
|
BOOL havePlus = [dataArr containsObject:plusflag];
|
||||||
|
if (havePlus && dataArr.count > 10) {
|
||||||
|
[dataArr removeObjectAtIndex:0];
|
||||||
|
}else if (!havePlus && dataArr.count < 10){
|
||||||
|
[dataArr insertObject:plusflag atIndex:0];
|
||||||
|
}
|
||||||
|
NSLog(@"dataarr.count = %ld",dataArr.count);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (_selectSection<_titieArr.count && _selectSection>=0 && [readTimer isEqualToString:@"0119"]) {
|
else if (_selectSection<_titieArr.count && _selectSection>=0 && [readTimer isEqualToString:@"0119"]) {
|
||||||
|
|
||||||
|
|
@ -1491,19 +1617,25 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)ifishDeviceLogInSuccees{
|
-(void)ifishDeviceLogInSuccees{
|
||||||
|
|
||||||
|
//读取具体开关定时
|
||||||
ReadTimerModel*readModel=self.readMode;
|
ReadTimerModel*readModel=self.readMode;
|
||||||
|
readModel.functionCode=@"16";
|
||||||
if (readModel) {
|
if (readModel) {
|
||||||
if (self.timerType==1)
|
if (self.timerType==1)//灯编为原始
|
||||||
{
|
{
|
||||||
readModel.functionCode=@"16";
|
|
||||||
|
readModel.selectorNumber=[readModel.selectorNumber stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:@"0"];
|
||||||
}
|
}
|
||||||
else if (self.timerType==2)
|
else if (self.timerType==2)//灯编号为e
|
||||||
{
|
{
|
||||||
readModel.functionCode=@"19";
|
|
||||||
|
readModel.selectorNumber=[readModel.selectorNumber stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:@"e"];
|
||||||
}
|
}
|
||||||
else if (self.timerType==3)
|
else if (self.timerType==3)//灯编号为d
|
||||||
{
|
{
|
||||||
readModel.functionCode=@"15";
|
|
||||||
|
readModel.selectorNumber=[readModel.selectorNumber stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:@"d"];
|
||||||
}
|
}
|
||||||
NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,readModel.selectorNumber,readModel.crc16str];
|
NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,readModel.selectorNumber,readModel.crc16str];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -440,7 +440,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
UIView *oneHeader = [[UIView alloc] init];
|
UIView *oneHeader = [[UIView alloc] init];
|
||||||
oneHeader.backgroundColor = COLOR_MIAN;
|
oneHeader.backgroundColor = COLOR_MIAN;
|
||||||
return oneHeader;
|
return oneHeader;
|
||||||
}else if(section == 2){
|
}else if(section > 1){
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
headerView.controlBtn.tag = kBtnTag + section;
|
||||||
headerView.statusBtn.tag = kBtnTag + section;
|
headerView.statusBtn.tag = kBtnTag + section;
|
||||||
|
|
@ -455,61 +455,6 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
[headerView.controlBtn addTarget:self action:@selector(statusChangeAction:) forControlEvents:UIControlEventTouchUpInside];
|
[headerView.controlBtn addTarget:self action:@selector(statusChangeAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
|
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
|
||||||
return headerView;
|
return headerView;
|
||||||
}else if(section == 3){
|
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
|
||||||
if (_selectSection == section) {
|
|
||||||
headerView.controlBtn.selected = YES;
|
|
||||||
}
|
|
||||||
[headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
||||||
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
|
|
||||||
return headerView;
|
|
||||||
}else if(section == 4){
|
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
|
||||||
if (_selectSection == section) {
|
|
||||||
headerView.controlBtn.selected = YES;
|
|
||||||
}
|
|
||||||
[headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
||||||
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
|
|
||||||
return headerView;
|
|
||||||
}else if(section == 5){
|
|
||||||
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
|
|
||||||
{
|
|
||||||
UIView *oneHeader = [[UIView alloc] init];
|
|
||||||
oneHeader.backgroundColor = COLOR_MIAN;
|
|
||||||
return oneHeader;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
|
||||||
if (_selectSection == section) {
|
|
||||||
headerView.controlBtn.selected = YES;
|
|
||||||
}
|
|
||||||
[headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
||||||
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
|
|
||||||
return headerView;
|
|
||||||
}
|
|
||||||
|
|
||||||
}else if(section == 6){
|
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
|
||||||
if (_selectSection == section) {
|
|
||||||
headerView.controlBtn.selected = YES;
|
|
||||||
}
|
|
||||||
[headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
||||||
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
|
|
||||||
return headerView;
|
|
||||||
}else if(section == 7){
|
|
||||||
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
|
|
||||||
headerView.controlBtn.tag = kBtnTag + section;
|
|
||||||
if (_selectSection == section) {
|
|
||||||
headerView.controlBtn.selected = YES;
|
|
||||||
}
|
|
||||||
[headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
||||||
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
|
|
||||||
return headerView;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
|
|
@ -606,11 +551,9 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - cell的折叠
|
#pragma mark - cell的折叠
|
||||||
|
//添加或者去除一键喂鱼的关联
|
||||||
- (void)foldAction:(UIButton *)btn {
|
- (void)foldAction:(UIButton *)btn {
|
||||||
if (_selectSection == btn.tag - kBtnTag) {
|
|
||||||
_selectSection = -1;
|
|
||||||
[self.tableView reloadData];
|
|
||||||
}else {
|
|
||||||
_selectSection = btn.tag - kBtnTag;
|
_selectSection = btn.tag - kBtnTag;
|
||||||
ReadTimerModel *readModel = [[ReadTimerModel alloc] init];
|
ReadTimerModel *readModel = [[ReadTimerModel alloc] init];
|
||||||
//杀菌不定时
|
//杀菌不定时
|
||||||
|
|
@ -665,15 +608,12 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
[[Socketsingleton sharedInstance] soketWriteData:readData];
|
[[Socketsingleton sharedInstance] soketWriteData:readData];
|
||||||
self.readMode=readModel;
|
self.readMode=readModel;
|
||||||
[_indicatorView startAnimating];
|
[_indicatorView startAnimating];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//改变一键喂鱼的开关状态
|
//改变一键喂鱼的开关状态
|
||||||
-(void)statusChangeAction:(UIButton*)btn
|
-(void)statusChangeAction:(UIButton*)btn
|
||||||
{
|
{
|
||||||
if (_selectSection == btn.tag - kBtnTag) {
|
|
||||||
_selectSection = -1;
|
|
||||||
[self.tableView reloadData];
|
|
||||||
}else {
|
|
||||||
_selectSection = btn.tag - kBtnTag;
|
_selectSection = btn.tag - kBtnTag;
|
||||||
ReadTimerModel *readModel = [[ReadTimerModel alloc] init];
|
ReadTimerModel *readModel = [[ReadTimerModel alloc] init];
|
||||||
//杀菌不定时
|
//杀菌不定时
|
||||||
|
|
@ -728,7 +668,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell";
|
||||||
[[Socketsingleton sharedInstance] soketWriteData:readData];
|
[[Socketsingleton sharedInstance] soketWriteData:readData];
|
||||||
self.readMode=readModel;
|
self.readMode=readModel;
|
||||||
[_indicatorView startAnimating];
|
[_indicatorView startAnimating];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)switchAction:(UIButton *)btn {
|
- (void)switchAction:(UIButton *)btn {
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Loading…
Reference in New Issue