diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj index dc42e08..27c777a 100644 --- a/Ifish.xcodeproj/project.pbxproj +++ b/Ifish.xcodeproj/project.pbxproj @@ -2245,6 +2245,12 @@ C024B7B12379668B00509424 /* NSMutableArray+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */; }; C02ED596249E3B7300CAC37D /* InfoByImageViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C02ED594249E3B7300CAC37D /* InfoByImageViewController.h */; }; C02ED597249E3B7300CAC37D /* InfoByImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C02ED595249E3B7300CAC37D /* InfoByImageViewController.m */; }; + C072196A253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0721969253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib */; }; + C072196D253B1F4F0065CF17 /* DatePickerCustomView.h in Headers */ = {isa = PBXBuildFile; fileRef = C072196B253B1F4F0065CF17 /* DatePickerCustomView.h */; }; + C072196E253B1F4F0065CF17 /* DatePickerCustomView.m in Sources */ = {isa = PBXBuildFile; fileRef = C072196C253B1F4F0065CF17 /* DatePickerCustomView.m */; }; + C0721972253C054D0065CF17 /* PlayBackViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C072196F253C054D0065CF17 /* PlayBackViewController.h */; }; + C0721973253C054D0065CF17 /* PlayBackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C0721970253C054D0065CF17 /* PlayBackViewController.m */; }; + C0721974253C054D0065CF17 /* PlayBackViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0721971253C054D0065CF17 /* PlayBackViewController.xib */; }; C0837A57244FF5510034FEC5 /* EGOCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C0837A55244FF5500034FEC5 /* EGOCache.m */; }; C0837A58244FF5510034FEC5 /* EGOCache.h in Headers */ = {isa = PBXBuildFile; fileRef = C0837A56244FF5500034FEC5 /* EGOCache.h */; }; C0873EE12491060000D47D34 /* ESPUDPSocketClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C0873EBE249105FF00D47D34 /* ESPUDPSocketClient.h */; }; @@ -5704,6 +5710,12 @@ C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+AvoidCrash.h"; sourceTree = ""; }; C02ED594249E3B7300CAC37D /* InfoByImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InfoByImageViewController.h; sourceTree = ""; }; C02ED595249E3B7300CAC37D /* InfoByImageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InfoByImageViewController.m; sourceTree = ""; }; + C0721969253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = IfishP2PPlayBackListViewController.xib; sourceTree = ""; }; + C072196B253B1F4F0065CF17 /* DatePickerCustomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatePickerCustomView.h; sourceTree = ""; }; + C072196C253B1F4F0065CF17 /* DatePickerCustomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatePickerCustomView.m; sourceTree = ""; }; + C072196F253C054D0065CF17 /* PlayBackViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlayBackViewController.h; sourceTree = ""; }; + C0721970253C054D0065CF17 /* PlayBackViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PlayBackViewController.m; sourceTree = ""; }; + C0721971253C054D0065CF17 /* PlayBackViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PlayBackViewController.xib; sourceTree = ""; }; C0837A55244FF5500034FEC5 /* EGOCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOCache.m; sourceTree = ""; }; C0837A56244FF5500034FEC5 /* EGOCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOCache.h; sourceTree = ""; }; C0873EBE249105FF00D47D34 /* ESPUDPSocketClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ESPUDPSocketClient.h; sourceTree = ""; }; @@ -6597,6 +6609,7 @@ 3D1C4FEB221A9EDD0096AE43 /* CameraNoParyBackVideoView.m */, 3D1C4FF4221A9EDD0096AE43 /* IfishP2PPlayBackListViewController.h */, 3D1C4FEC221A9EDD0096AE43 /* IfishP2PPlayBackListViewController.m */, + C0721969253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib */, 3D1C4FF0221A9EDD0096AE43 /* IfishPlaybackViewCell.h */, 3D1C4FF7221A9EDD0096AE43 /* IfishPlaybackViewCell.m */, 3D1C4FF2221A9EDD0096AE43 /* IfishPlaybackViewCell.xib */, @@ -6606,6 +6619,9 @@ 3D1C4FF3221A9EDD0096AE43 /* P2PPlayingbackVC.m */, 3D1C4FEF221A9EDD0096AE43 /* PlayBaseViewController.h */, 3D1C4FF5221A9EDD0096AE43 /* PlayBaseViewController.m */, + C072196F253C054D0065CF17 /* PlayBackViewController.h */, + C0721970253C054D0065CF17 /* PlayBackViewController.m */, + C0721971253C054D0065CF17 /* PlayBackViewController.xib */, ); path = IfishP2PPlayBack; sourceTree = ""; @@ -10156,6 +10172,8 @@ 883E79771D48B0280030E075 /* mypicView */ = { isa = PBXGroup; children = ( + C072196B253B1F4F0065CF17 /* DatePickerCustomView.h */, + C072196C253B1F4F0065CF17 /* DatePickerCustomView.m */, 883E79781D48B0280030E075 /* Box.png */, 883E79791D48B0280030E075 /* MydatePickerView.h */, 883E797A1D48B0280030E075 /* MydatePickerView.m */, @@ -12875,6 +12893,7 @@ C0873EF62491060000D47D34 /* ESPTools.h in Headers */, CB8B6468230F7F980032EB24 /* IfishMainInfoCell.h in Headers */, C0EA8A2A23AF74F4003DC53B /* SDWebImageOperation.h in Headers */, + C072196D253B1F4F0065CF17 /* DatePickerCustomView.h in Headers */, CB484E1122B8C8C90075F050 /* version.h in Headers */, 3D1C5122221A9EE00096AE43 /* IfishRecVideoViewCell.h in Headers */, CB48207C2334E99700A50C92 /* IQTextView.h in Headers */, @@ -13107,6 +13126,7 @@ 3D1C50D3221A9EE00096AE43 /* UIScrollView+SVInfiniteScrolling.h in Headers */, CBA61655228F9A6C00ED380D /* YYModel.h in Headers */, CB484DFE22B8C8C80075F050 /* cpu.h in Headers */, + C0721972253C054D0065CF17 /* PlayBackViewController.h in Headers */, C0EA8A2F23AF74F4003DC53B /* UIImage+MultiFormat.h in Headers */, CB4820882334E99700A50C92 /* IQKeyboardManagerConstants.h in Headers */, 3D1C5089221A9EDF0096AE43 /* KTPhotoView.h in Headers */, @@ -14242,6 +14262,7 @@ 883E788C1D48A5E50030E075 /* infoSureBtnCell.xib in Resources */, 882956881DBDA3A200E9DDD7 /* ifish_hold_headerImg@2x.png in Resources */, 882956EF1DBDA3A300E9DDD7 /* bubble@1x.png in Resources */, + C0721974253C054D0065CF17 /* PlayBackViewController.xib in Resources */, 882957601DBDA3A300E9DDD7 /* icon2.png in Resources */, 8829570E1DBDA3A300E9DDD7 /* ifish_shareblog.png in Resources */, 886D15871E6066D20085F7D6 /* introlImage_1.png in Resources */, @@ -14533,6 +14554,7 @@ 882956DD1DBDA3A300E9DDD7 /* ifishdropview_add_device@3x.png in Resources */, 881478241E712A2700BFB79C /* task_openShareCamera@3x.png in Resources */, 887492511E7BB58A00CDA284 /* gold_background@3x.png in Resources */, + C072196A253AE2290065CF17 /* IfishP2PPlayBackListViewController.xib in Resources */, 882957961DBDA3A400E9DDD7 /* xutobtn2_on@3x.png in Resources */, 885606AC1E32081C0002C17C /* sharing_v_attestation@3x.png in Resources */, 881A1D331DD2C31500BA1AF4 /* kankanlook_icon_sentiment@2x.png in Resources */, @@ -14628,6 +14650,7 @@ 883E78621D48A5E50030E075 /* RightViewController.m in Sources */, CBA61675228F9AB100ED380D /* NSLayoutConstraint+MASDebugAdditions.m in Sources */, 886FB1A11E5A9D0A00256332 /* FishDocSection0ViewImgCell.m in Sources */, + C072196E253B1F4F0065CF17 /* DatePickerCustomView.m in Sources */, 881672381EA5DE2B00BEBF23 /* UMComSimpleAssociatedFeedTableViewCell.m in Sources */, 883E76431D4897570030E075 /* TwoControlBackmsgmodel.m in Sources */, 3D3512DB2159C172009DDB0F /* IfishHotBarModifyNameVc.m in Sources */, @@ -15527,6 +15550,7 @@ 8876A5881BB83447007A4B54 /* main.m in Sources */, 889133071ECE999A00F52EBC /* LXCompressionVideo.m in Sources */, 886E3A0B1EEA44B5007C0B04 /* UserExtendataArchaver.m in Sources */, + C0721973253C054D0065CF17 /* PlayBackViewController.m in Sources */, 881F0F4F1D73DF4E0091507E /* BaoGaoViewFirstCell.m in Sources */, E51D7D5B208CF4E7001FF053 /* RuiMeiInputViewController.m in Sources */, 881672241EA5DE2B00BEBF23 /* UMComSelectTopicCell.m in Sources */, @@ -15753,7 +15777,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 29; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = WFX8GD5HFX; ENABLE_BITCODE = NO; ENABLE_TESTABILITY = YES; @@ -15828,7 +15852,7 @@ "$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl", "$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl", ); - MARKETING_VERSION = 4.7.4; + MARKETING_VERSION = 5.1.7; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", @@ -15871,7 +15895,7 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 29; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = WFX8GD5HFX; ENABLE_BITCODE = NO; ENABLE_TESTABILITY = YES; @@ -15946,7 +15970,7 @@ "$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl", "$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl", ); - MARKETING_VERSION = 4.7.4; + MARKETING_VERSION = 5.1.7; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-ObjC", diff --git a/Ifish.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Ifish.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings index 949b678..6b30c74 100644 --- a/Ifish.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ b/Ifish.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -4,5 +4,7 @@ BuildSystemType Original + PreviewsEnabled + diff --git a/Ifish/Common/CommonUtils.h b/Ifish/Common/CommonUtils.h index 37d9ead..bcf8b3c 100644 --- a/Ifish/Common/CommonUtils.h +++ b/Ifish/Common/CommonUtils.h @@ -159,4 +159,6 @@ typedef enum{ + (NSString *)getRandomStringWithNum:(NSInteger)num; CGAffineTransform GetCGAffineTransformRotateAroundPoint(float centerX, float centerY ,float x ,float y ,float angle); ++ (void)interfaceOrientation:(UIInterfaceOrientation)orientation; ++ (UIBarButtonItem*)ItemWithTitle:(NSString *)title target:(id)target action:(SEL)action titleColor:(UIColor*)titleColor; @end diff --git a/Ifish/Common/CommonUtils.m b/Ifish/Common/CommonUtils.m index ed4686d..88e4f8a 100644 --- a/Ifish/Common/CommonUtils.m +++ b/Ifish/Common/CommonUtils.m @@ -287,6 +287,31 @@ return timeString; } ++ (void)interfaceOrientation:(UIInterfaceOrientation)orientation +{ + if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { + SEL selector = NSSelectorFromString(@"setOrientation:"); + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]]; + [invocation setSelector:selector]; + [invocation setTarget:[UIDevice currentDevice]]; + int val = orientation; + // 从2开始是因为0 1 两个参数已经被selector和target占用 + [invocation setArgument:&val atIndex:2]; + [invocation invoke]; + } +} ++ (UIBarButtonItem*)ItemWithTitle:(NSString *)title target:(id)target action:(SEL)action titleColor:(UIColor*)titleColor +{ + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + if(title.length) [button setTitle:title forState:UIControlStateNormal]; + button.titleLabel.font = [UIFont systemFontOfSize:16]; + if (titleColor==nil) titleColor = [UIColor whiteColor]; + [button setTitleColor:titleColor forState:UIControlStateNormal]; + [button setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled]; + [button sizeToFit]; + [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; + return [[UIBarButtonItem alloc] initWithCustomView:button]; +} + (NSDictionary *)getSSIDInfo { NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces()); @@ -519,7 +544,7 @@ CGAffineTransform GetCGAffineTransformRotateAroundPoint(float centerX, float ce } + (BOOL)isIphoneX { if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { - return [[UIScreen mainScreen] bounds].size.height >= 812.0f; + return ([[UIApplication sharedApplication] statusBarFrame].size.height> 20); }else{ return NO; } diff --git a/Ifish/Info.plist b/Ifish/Info.plist index 13206fc..c2418a9 100644 --- a/Ifish/Info.plist +++ b/Ifish/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.1.5 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleURLTypes @@ -372,6 +372,8 @@ NSCameraUsageDescription 爱鱼奇需要您的同意,才能使用相机,以使用图片上传或扫一扫等功能 + NSLocalNetworkUsageDescription + 为给爱鱼奇智能硬件产品配置网络,发送指令等,需要使用本地网络 NSLocationAlwaysUsageDescription 为获取爱鱼奇智能硬件产品及用户的地址区域分布,以提供更好的特色服务,爱鱼奇将获取您的地址 NSLocationWhenInUseUsageDescription diff --git a/Ifish/UMCommunity/UMCommunitySDK/UMComModules/CommonLogin/UMComLoginViewController.xib b/Ifish/UMCommunity/UMCommunitySDK/UMComModules/CommonLogin/UMComLoginViewController.xib index be89668..cde5bf8 100644 --- a/Ifish/UMCommunity/UMCommunitySDK/UMComModules/CommonLogin/UMComLoginViewController.xib +++ b/Ifish/UMCommunity/UMCommunitySDK/UMComModules/CommonLogin/UMComLoginViewController.xib @@ -1,9 +1,10 @@ - - + + + - - + + @@ -20,22 +21,22 @@ - + - + - - + + - - + + - + @@ -53,7 +54,7 @@ - + @@ -71,14 +72,14 @@ - - + + - + @@ -112,38 +113,38 @@ - - + - + - + diff --git a/Ifish/Utinitys/Define.h b/Ifish/Utinitys/Define.h index 3a532ab..484e7c1 100644 --- a/Ifish/Utinitys/Define.h +++ b/Ifish/Utinitys/Define.h @@ -81,6 +81,10 @@ alpha:1.0] #define MAINSCREEN_SCALE [[UIScreen mainScreen] scale] #define KWidth_Scale [UIScreen mainScreen].bounds.size.width/375.0f +#define IS_iPhoneX [CommonUtils isIphoneX] +#define TabbarHeight (IS_iPhoneX?83:49) +#define MyNavBarHeight (IS_iPhoneX?88:64) +#define StatusBarHeight (IS_iPhoneX?[[UIApplication sharedApplication] statusBarFrame].size.height:20) #import "MyControl.h" #import "DataCenter.h" #import "UserModel.h" diff --git a/Ifish/Utinitys/EGOCache/EGOCache.h b/Ifish/Utinitys/EGOCache/EGOCache.h index ab84607..6490587 100755 --- a/Ifish/Utinitys/EGOCache/EGOCache.h +++ b/Ifish/Utinitys/EGOCache/EGOCache.h @@ -66,6 +66,7 @@ FOUNDATION_EXPORT const unsigned char EGOCacheVersionString[]; - (NSString* __nullable)stringForKey:(NSString* __nonnull)key; - (void)setString:(NSString* __nonnull)aString forKey:(NSString* __nonnull)key; +- (void)setSynString:(NSString*)aString forKey:(NSString*)key; - (void)setString:(NSString* __nonnull)aString forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; - (NSDate* __nullable)dateForKey:(NSString* __nonnull)key; diff --git a/Ifish/Utinitys/EGOCache/EGOCache.m b/Ifish/Utinitys/EGOCache/EGOCache.m index de8abda..262d966 100755 --- a/Ifish/Utinitys/EGOCache/EGOCache.m +++ b/Ifish/Utinitys/EGOCache/EGOCache.m @@ -274,6 +274,13 @@ static inline NSString* cachePathForKey(NSString* directory, NSString* key) { - (void)setString:(NSString*)aString forKey:(NSString*)key { [self setString:aString forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; } +- (void)setSynString:(NSString*)aString forKey:(NSString*)key { + CHECK_FOR_EGOCACHE_PLIST(); + NSString* cachePath = cachePathForKey(_directory, key); + [[aString dataUsingEncoding:NSUTF8StringEncoding] writeToFile:cachePath atomically:YES]; + [self setCacheTimeoutInterval:self.defaultTimeoutInterval forKey:key]; +} + - (void)setString:(NSString*)aString forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { [self setData:[aString dataUsingEncoding:NSUTF8StringEncoding] forKey:key withTimeoutInterval:timeoutInterval]; diff --git a/Ifish/Utinitys/IfishHttpRequest/AFNOHeaderHttpTool.m b/Ifish/Utinitys/IfishHttpRequest/AFNOHeaderHttpTool.m index c721128..83fd4e9 100644 --- a/Ifish/Utinitys/IfishHttpRequest/AFNOHeaderHttpTool.m +++ b/Ifish/Utinitys/IfishHttpRequest/AFNOHeaderHttpTool.m @@ -318,7 +318,11 @@ methodType url : (NSString *)url success:(void (^)(id response))success failure:(void (^)(NSError* err))failure { - + if ([deviceId isKindOfClass:[NSNumber class]]) + { + NSString*devid=[NSString stringWithFormat:@"%@",deviceId]; + deviceId=devid; + } NSString*macid=[[deviceId componentsSeparatedByString:@"_"] firstObject]; NSString*deviceType=[[deviceId componentsSeparatedByString:@"_"] lastObject]; diff --git a/Ifish/controllers/BaseVIewContorller/BaseViewController.m b/Ifish/controllers/BaseVIewContorller/BaseViewController.m index ee5526b..f17b149 100644 --- a/Ifish/controllers/BaseVIewContorller/BaseViewController.m +++ b/Ifish/controllers/BaseVIewContorller/BaseViewController.m @@ -131,15 +131,6 @@ // #ifdef IOS6 -- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation -{ - return UIInterfaceOrientationLandscapeRight; -} - -- (BOOL)shouldAutorotate { - return NO; -} - - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscapeRight; } diff --git a/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.m b/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.m index fae6f36..f337e3d 100644 --- a/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.m +++ b/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.m @@ -320,6 +320,11 @@ Copy NSString *deviceId; self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; self.HUD.mode = MBProgressHUDModeIndeterminate; self.HUD.labelText = msg; + if ([msg isEqualToString:@"Socket连接失败"]) + { + [self.HUD hide:YES afterDelay:3]; + [self endProgress]; + } } -(void)endProgress{ [self.progressView endProgressWithString:@"连接结束"]; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m index f23d97a..c094a00 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m @@ -26,6 +26,8 @@ #import "Xuanduo2TimerModel.h" #import "IfishDeviceInfo.h" #import "NSString+Add.h" +#import "XuToControlName.h" +#import "UserExtendataArchaver.h" #define kBtnTag 500 #define kSwitchBtnTag 600 @@ -120,11 +122,22 @@ static NSString *setTimerflag = @"SetTimerCell"; } - (void)setupTable { - _titieArr = @[@"循环泵",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"杀菌灯"]; + + XuToControlName *name = [UserExtendataArchaver currentNewXuToControlName:self.currentdevice.macAddress]; + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + name=[UserExtendataArchaver currentPetsXuToControlName:self.currentdevice.macAddress]; + } + // _titieArr = @[@"循环泵",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"杀菌灯"]; + _titieArr = @[name.xunhuanPump,name.zengyangPump,name.light1,name.light2,name.zaolangPump,name.shajunLight]; + _imgArr = @[@"xunhuan_big",@"gas_big",@"light_big",@"light_big",@"wave_big",@"shajun_big"]; + + + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { - _titieArr = @[@"照明",@"换气",@"杀菌"]; + _titieArr = @[name.xunhuanPump,name.zaolangPump,name.light1]; _imgArr = @[@"照明开",@"换气开",@"杀菌开"]; } @@ -706,14 +719,14 @@ static NSString *setTimerflag = @"SetTimerCell"; NSData*selctorData=[dataContorl stringToHexData:selectorString]; [[Socketsingleton sharedInstance] soketWriteData:selctorData]; - [_indicatorView startAnimating]; + // [_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]; + ; } else if ([group isKindOfClass: [XuanduoCycleModel class] ]) { @@ -1547,9 +1560,7 @@ static NSString *setTimerflag = @"SetTimerCell"; } NSLog(@"dataarr.count = %ld",dataArr.count); - [self.XuTohud hidmyHud]; - [self.indicatorView stopAnimating]; - [self.tableView reloadData]; + } else if (_selectSection-2<_titieArr.count && _selectSection-2>=0 && [readTimer isEqualToString:@"0119"]) { @@ -1561,17 +1572,16 @@ static NSString *setTimerflag = @"SetTimerCell"; [dataArr addObject:_cycleModel]; - [self.XuTohud hidmyHud]; - [self.indicatorView stopAnimating]; - [self.tableView reloadData]; + } if ([readTimer isEqualToString:@"0108"] || [readTimer isEqualToString:@"0105"]) { [Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentdevice.type]; [self refreshWithData:self.dataModel]; - [self.XuTohud hidmyHud]; - [self.indicatorView stopAnimating]; - [self.tableView reloadData]; + } + [self.XuTohud hidmyHud]; + [self.indicatorView stopAnimating]; + [self.tableView reloadData]; } -(void)ifishDeviceLogInFail{ diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m index 059cdd4..5ba0ab7 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m @@ -608,7 +608,7 @@ { status=((Xuanduo3fModel*)self.dataModel).constTmep; } - if ([status isKindOfClass:[NSNull class]]||status ) { + if ([status isKindOfClass:[NSNull class]]||!status ) { status = @"0000"; } diff --git a/Ifish/controllers/HotBar/IfishHotBarVc.m b/Ifish/controllers/HotBar/IfishHotBarVc.m index 1573393..5c7ede5 100644 --- a/Ifish/controllers/HotBar/IfishHotBarVc.m +++ b/Ifish/controllers/HotBar/IfishHotBarVc.m @@ -184,6 +184,12 @@ Assign BOOL isInitHostoryView; self.vo.wornCode=code; self.vo.upTeamp=up; self.vo.downTeamp=down; + IfishHotBarVo*vo1=self.datas[1]; + if (!IsEmptyStr(self.vo.upTeamp)) { + vo1.subTitle = [NSString stringWithFormat:@"%.1f°c~%.1f°c",[self.vo.downTeamp floatValue],[self.vo.upTeamp floatValue]]; + } + + [self.mainTableView reloadData]; [self setTeampletureWithUp:self.vo.upTeamp andDown:self.vo.downTeamp andHnum:0 andWarmC:self.vo.wornCode]; } diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m b/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m index e7ce529..aeacbc0 100644 --- a/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m @@ -25,7 +25,7 @@ // CFShow((__bridge CFTypeRef)(infoDic)); NSString *app_Version=[infoDic objectForKey:@"CFBundleShortVersionString"]; NSLog(@"app_Version%@",app_Version); - app_Version=@"4.7.5"; + app_Version=@"4.7.7"; NSString *versionStr = [NSString stringWithFormat:@"v%@",app_Version]; NSString *buildVersion = [infoDic objectForKey:@"CFBundleVersion"]; if (buildVersion.length > 0) { diff --git a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m index 201d9a5..637b789 100644 --- a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m +++ b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m @@ -1283,12 +1283,7 @@ Assign BOOL isPush; } else if ([model.type isEqualToString:@"camera"]){ - // self.hidesBottomBarWhenPushed = YES; - // IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init]; - // cameraShopVC.camera = model.camera; - // [self.navigationController pushViewController:cameraShopVC animated:YES]; - // self.hidesBottomBarWhenPushed = NO; - + //切换时主动 断开 soket [[Socketsingleton sharedInstance] cutOffSocket]; //进入摄像头页面 diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m index 5b4db33..66cbcf1 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m @@ -632,7 +632,7 @@ Strong UIImage *screenShotImage;//截图 //布防撤防、对讲、截图工具栏 ****** 云台 - CameraBottomHView *bottomToolHView = [[CameraBottomHView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame))]; + CameraBottomHView *bottomToolHView = [[CameraBottomHView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame)- MyNavBarHeight -10)]; bottomToolHView.cameraHViewDelegate = self; bottomToolHView.camera = self.contact; [self.view addSubview:bottomToolHView]; @@ -640,7 +640,7 @@ Strong UIImage *screenShotImage;//截图 self.bottomToolHView.hidden = NO; //底部view 水族箱view - UIView *bottomHView = [[UIView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame))]; + UIView *bottomHView = [[UIView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame)-10-MyNavBarHeight)]; bottomHView.backgroundColor = JWUIColorFromRGB(0xdddddd); [self.view addSubview:bottomHView]; self.bottomFishHView = bottomHView; @@ -4570,6 +4570,23 @@ GWP2PCallErrorNotSupport, }]; } + //视频录制 + else if (indexPath.row ==6){ + CameraRecordViewController*ca=[[CameraRecordViewController alloc]init]; + ca.camera=self.contact; + [self.navigationController pushViewController:ca animated:YES]; + + + } + + else if (indexPath.row ==7){ + + IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init]; + cameraShopVC.camera = self.contact; + [self.navigationController pushViewController:cameraShopVC animated:YES]; + + } + } diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m index b7b647d..9be5d95 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m @@ -22,7 +22,7 @@ if (self) { CGFloat viewH =200; - UIView *holdView = [[UIView alloc] initWithFrame:CGRectMake(0,frame.size.height/2 -viewH, kScreenSize.width, viewH)]; + UIView *holdView = [[UIView alloc] initWithFrame:self.bounds]; self.backgroundColor = TABLE_BACKGROUD_COLOR; holdView.backgroundColor = TABLE_BACKGROUD_COLOR; //self.backgroundColor = [UIColor redColor]; @@ -55,15 +55,15 @@ if (self.dataType == noDataViewTypeNOSDCard) { - CGFloat imgX = self.frame.size.width/2 - 110*KWidth_Scale/2; - self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,110*KWidth_Scale, 110*KWidth_Scale*0.82); + CGFloat imgX = self.frame.size.width/2 - 110/2; + self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82); self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 20 , self.frame.size.width,20); self.subTitle.frame = CGRectMake(0, CGRectGetMaxY(self.title.frame) + 10, self.frame.size.width,20); }else{ - CGFloat imgX = self.frame.size.width/2 - 90*KWidth_Scale/2; - self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,90*KWidth_Scale, 90*KWidth_Scale*0.86); + CGFloat imgX = self.frame.size.width/2 - 110/2; + self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82); self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 23 , self.frame.size.width,20); //self.backgroundColor = [UIColor blueColor]; } diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.h index b06616a..c3827f3 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.h @@ -11,5 +11,8 @@ #import "IfishCameraModel.h" @interface IfishP2PPlayBackListViewController : BaseViewController @property (nonatomic,strong) IfishCameraModel *camera; +@property (weak, nonatomic) IBOutlet UIButton *startBtn; +@property (weak, nonatomic) IBOutlet UIButton *endBtn; +@property (weak, nonatomic) IBOutlet UIButton *searchBtn; @end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.m index 6c29c4d..07ac4e4 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.m @@ -10,13 +10,16 @@ #import "CameraNoParyBackVideoView.h" #import "P2PClient.h" #import "IfishPlaybackViewCell.h" +#import +#import "DatePickerCustomView.h" +#import "PlayBackViewController.h" #define BACKVIEW_ROWH 60 #define ANIM_VIEW_WIDTH_AND_HEIGHT 80 //新 #import "P2PPlayingbackVC.h" @interface IfishP2PPlayBackListViewController () -@property(nonatomic,strong)UITableView *tableView; +@property(nonatomic,strong) IBOutlet UITableView *tableView; @property(retain, nonatomic) NSMutableArray *playbackFiles; @property(retain, nonatomic) NSMutableArray *playbackSize; @property(retain, nonatomic) NSMutableArray *timesData; @@ -26,24 +29,27 @@ @property(retain, nonatomic) NSMutableArray *timesDataMore; @property(nonatomic,strong) CameraNoParyBackVideoView *noDataView; @property(strong, nonatomic) NSString *nextEndDate; -@property (nonatomic) BOOL isloadMore;//是否更多 +@property (nonatomic) BOOL hasSDCard;//是否更多 @property(strong, nonatomic) UIView *movieView; @property (nonatomic) BOOL isInItDevice; //是否连接设备 +@property (nonatomic, strong) DatePickerCustomView *datePickView; +@property (nonatomic, strong) NSDate *startDate; +@property (nonatomic, strong) NSDate *endDate; @end @implementation IfishP2PPlayBackListViewController - (void)viewDidLoad { [super viewDidLoad]; - [[P2PClient sharedClient] setIsClearPlaybackFilesLength:YES];//isClearPlaybackFilesLength - // Do any additional setup after loading the view. - _isloadMore = NO; - _isInItDevice = NO; + + _hasSDCard = NO; + self.playbackFiles = [NSMutableArray arrayWithCapacity:0]; self.playbackSize = [NSMutableArray arrayWithCapacity:0]; self.playbackFilesMore = [NSMutableArray arrayWithCapacity:0]; self.playbackSizeMore = [NSMutableArray arrayWithCapacity:0]; - [self addTitleViewWithTitle:@"回放"]; + [self addTitleViewWithTitle:@"视频回放"]; + [self connectDevice]; [self initUI]; //[[P2PClient sharedClient] setPlaybackDelegate:self]; @@ -53,57 +59,36 @@ -(void)connectDevice{ - //LoginResult *loginResult = [UDManager getLoginInfo]; - //8225账号 - // NSString * P2PVerifyCode1 = @"1528438234"; - // NSString * P2PVerifyCode2 = @"992805759"; - // NSString *UserID = @"-2144354932"; - - UserModel *model=[[DataCenter defaultDtacenter] valueForKey:@"UserLogIn"]; + UserModel *model=[dataContorl getUserInfo]; NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; - - //初始化设备 - if (!_isInItDevice) { - NSLog(@"正在初始化设备"); - _isInItDevice = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2]; - - // _isInItDevice = [[P2PClient sharedClient] p2pConnectWithId:model.gwellUserID codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2]; - - } - - - if(_isInItDevice){ - - NSLog(@"p2pConnect success. 成功 可以操作设备了"); - //成功 可以操作设备了 - usleep(600000); - [self startMonitor]; - - }else{//new added - NSLog(@"p2pConnect failure.失败,不能操作设备"); - //[self connectDevice]; - return; - } - - -} --(void)startMonitor{ - - if (_isInItDevice) { - NSLog(@"发送呼叫命令"); - - [[P2PClient sharedClient] setIsBCalled:NO]; - [[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_CALLING]; - - - [[P2PClient sharedClient] p2pCallWithId:self.camera.cameraId password:self.camera.cameraPass callType:P2PCALL_TYPE_PLAYBACK]; + if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) { + NSLog(@"正在检查P2P连接状态"); + BOOL connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; + if (connectDevice) { + + [[GWP2PClient sharedClient] getDeviceStorageInfomationWithDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + if (success) + { + self.hasSDCard=YES; + [self initNoSDDataViewHidden:YES]; + } + else + { + [self initNoSDDataViewHidden:NO]; + } + }]; + }else{ + NSLog(@"p2pConnect failure.失败,不能操作设备"); + } } } + -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [AppDelegate sharedDefault].canFullScreen = YES; @@ -113,36 +98,16 @@ -(void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; - //[AppDelegate sharedDefault].canFullScreen = YES; - [[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:@"read_play_false" object:nil]; } -(void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(readPlayFalse:) name:@"read_play_false" object:nil]; - [[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass]; } --(void)readPlayFalse:(NSNotification*)noti{ - /// - dispatch_async(dispatch_get_main_queue(), ^{ - [UIView transitionWithView:self.movieView duration:0.3 options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self.movieView.alpha = 0.3; - } - - completion:^(BOOL finished){ - [self.movieView setHidden:YES]; - [self.view makeToast:NSLocalizedString(@"connection_failed_please_reconnect", nil)]; - } - ]; - }); -} + -(void)goBackAction{ @@ -152,114 +117,7 @@ } -- (void)receiveRemoteMessage:(NSNotification *)notification{ - - NSDictionary *parameter = [notification userInfo]; - int key = [[parameter valueForKey:@"key"] intValue]; - - switch (key) { - case RET_GET_PLAYBACK_FILES: - { - //回放文件名称 - NSArray *array = [NSArray arrayWithArray:(NSArray*)[parameter valueForKey:@"files"]]; - //回放文件的时间记录 - NSArray *times = [NSArray arrayWithArray:(NSArray*)[parameter valueForKey:@"times"]]; - //回放文件的播放时长 - NSArray *sizes = [NSArray arrayWithArray:(NSArray*)[parameter valueForKey:@"sizes"]]; - - - //若不是加载更多时,则往已playbackFiles数组存放回放文件 - //若是加载更多,则往playbackFilesMore的数组添加回放文件 - //若不是加载更多时,则往playbackSize数组存放回放文件的播放时长 - //若是上拉加载更多,则往playbackSizeMore数组末尾添加回放文件的播放时长 - if (_isloadMore) { - - for (NSString *file in array){ - [self.playbackFilesMore addObject:file]; - } - for (NSString *size in sizes){ - [self.playbackSizeMore addObject:size]; - } - //刷新表格 - dispatch_async(dispatch_get_main_queue(), ^{ - [self.tableView reloadData]; - if (self.playbackFilesMore.count < 1) { - //[self.view makeToast:NSLocalizedString(@"no_playback_file", nil)]; - [self.view makeToast:@"没有更多视频"]; - } - }); - self.timesDataMore = [NSMutableArray arrayWithArray:times]; - if (self.timesDataMore.count==0) { - return; - } - - //记录最近1天、3天...已显示文件里最后一个文件的时间(最早文件的时间) - //用于上拉加载时传入的结束时间 - self.nextEndDate = [self.timesDataMore lastObject]; - }else{ - - for (NSString *file in array){ - [self.playbackFiles addObject:file]; - } - for (NSString *size in sizes){ - [self.playbackSize addObject:size]; - } - //刷新表格 - dispatch_async(dispatch_get_main_queue(), ^{ - [self.tableView reloadData]; - if (self.playbackFiles.count < 1) { - //[self.view makeToast:NSLocalizedString(@"no_playback_file", nil)]; - [self initNoVideoDataViewHidden:NO]; - - } - }); - - self.timesData = [NSMutableArray arrayWithArray:times]; - if (self.timesData.count==0) { - return; - } - - //记录最近1天、3天...已显示文件里最后一个文件的时间(最早文件的时间) - //用于上拉加载时传入的结束时间 - self.nextEndDate = [self.timesData lastObject]; - - } - - } - break; - - case RET_GET_SDCARD_INFO: - - { - NSInteger result = [[parameter valueForKey:@"result"] intValue]; - - dispatch_async(dispatch_get_main_queue(), ^{ - if (result == 1) { - - //[self.view makeToast:@"sdk卡可使用"]; - [[P2PClient sharedClient] setCurrentLabel:1]; - [[P2PClient sharedClient] getPlaybackFilesWithId:self.camera.cameraId password:self.camera.cameraPass timeInterval:1]; - [[P2PClient sharedClient] setPlaybackDelegate:self]; - - }else{ - //sd卡不存在, - //[self.view makeToast:NSLocalizedString(@"no_storage", nil)]; - [self initNoSDDataViewHidden:NO]; - - } - }); - - } - break; - - - default: - break; - } - - -} -(void)initNoSDDataViewHidden:(BOOL)hidden @@ -273,7 +131,7 @@ if (!self.noDataView) { - self.noDataView = [[CameraNoParyBackVideoView alloc] initWithFrame:self.view.bounds]; + self.noDataView = [[CameraNoParyBackVideoView alloc] initWithFrame:self.tableView.frame]; [self.view addSubview:self.noDataView]; } @@ -288,7 +146,7 @@ { if (!self.noDataView) { //CGFloat viewH =200; - self.noDataView = [[CameraNoParyBackVideoView alloc] initWithFrame:self.view.bounds]; + self.noDataView = [[CameraNoParyBackVideoView alloc] initWithFrame:self.tableView.frame]; [self.view addSubview:self.noDataView]; } @@ -301,34 +159,96 @@ } -(void)initUI { - - - self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height) style:UITableViewStyleGrouped]; - self.tableView.delegate = self; - self.tableView.dataSource = self; - self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - self.tableView.showsVerticalScrollIndicator = NO; - self.tableView.backgroundColor = RGB(241, 241, 241); - [self.view addSubview:self.tableView]; - - UIView *movieView = [[UIView alloc] initWithFrame:CGRectMake(0, NAVIGATION_BAR_HEIGHT, self.view.frame.size.width, self.view.frame.size.height-NAVIGATION_BAR_HEIGHT)]; - [movieView setBackgroundColor:XBlack_128]; - - UIImageView *animView = [[UIImageView alloc] initWithFrame:CGRectMake((movieView.frame.size.width-ANIM_VIEW_WIDTH_AND_HEIGHT)/2, (movieView.frame.size.height-ANIM_VIEW_WIDTH_AND_HEIGHT)/2, ANIM_VIEW_WIDTH_AND_HEIGHT, ANIM_VIEW_WIDTH_AND_HEIGHT)]; - - NSArray *imagesArray = [NSArray arrayWithObjects:LXImageWithImageName(@"movie1.png"),LXImageWithImageName(@"movie2.png"),LXImageWithImageName(@"movie3.png"),nil]; - - animView.animationImages = imagesArray; - animView.animationDuration = ((CGFloat)[imagesArray count])*100.0f/1000.0f; - animView.animationRepeatCount = 0; - [animView startAnimating]; - [movieView addSubview:animView]; - [movieView setHidden:YES]; - [self.view addSubview:movieView]; - self.movieView = movieView; - - + NSDate *nowDate = [NSDate date]; // 当前时间 + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.dateFormat = @"yyyy-MM-dd HH:mm"; + NSString *string = [formatter stringFromDate:nowDate]; // + [self.startBtn setTitle:[formatter stringFromDate:[nowDate dateByAddingTimeInterval:-60*60]] forState:UIControlStateNormal]; + [self.endBtn setTitle:string forState:UIControlStateNormal]; + self.startDate=[nowDate dateByAddingTimeInterval:-60*60]; + self.endDate=nowDate; } + +- (IBAction)startTimeClick:(UIButton *)sender { + + [self.datePickView removeFromSuperview]; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier: @"zh_CN"]]; + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; + DatePickerCustomView* dateView = [DatePickerCustomView showInView:self.view Mode:UIDatePickerModeDateAndTime date:[dateFormatter dateFromString:[sender titleForState:UIControlStateNormal]]]; + dateView.datePicker.maximumDate=[NSDate date]; + + self.datePickView=dateView; + WEAK_SELF; + + __weak DatePickerCustomView* weakDateView =dateView; + dateView.dateChanged =^{ + + [sender setTitle:[dateFormatter stringFromDate:weakDateView.datePicker.date] forState:UIControlStateNormal]; + weakSelf.startDate=weakDateView.datePicker.date; + + }; + dateView.cancelBlock = ^{ + + }; +} +- (IBAction)endTimeClick:(UIButton *)sender { + + [self.datePickView removeFromSuperview]; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier: @"zh_CN"]]; + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"]; + DatePickerCustomView* dateView = [DatePickerCustomView showInView:self.view Mode:UIDatePickerModeDateAndTime date:[dateFormatter dateFromString:[sender titleForState:UIControlStateNormal]]]; + dateView.datePicker.maximumDate=[NSDate date]; + + self.datePickView=dateView; + + __weak DatePickerCustomView* weakDateView =dateView; + WEAK_SELF; + dateView.dateChanged =^{ + + [sender setTitle:[dateFormatter stringFromDate:weakDateView.datePicker.date] forState:UIControlStateNormal]; + weakSelf.endDate=weakDateView.datePicker.date; + }; + dateView.cancelBlock = ^{ + + }; +} +- (IBAction)searchClick:(UIButton *)sender { + + if ([self.startDate compare:self.endDate]==NSOrderedDescending) { + [self.view makeToast:@"开始时间必须小于结束时间"]; + return;; + } + [MBProgressHUD showHUDAddedTo:self.view animated:YES]; + [[GWP2PClient sharedClient] getDevicePlaybackFilesWithDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass startDate:self.startDate endDate:self.endDate completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + [MBProgressHUD hideHUDForView:self.view animated:YES]; + NSLog(@"dataDictionary=%@",dataDictionary); + [self.playbackFiles removeAllObjects]; + if (success&&[dataDictionary[@"error value"] intValue]==0) + { + + NSArray*files=dataDictionary[@"files"]; + if ([files isKindOfClass:[NSArray class]]&&files.count) + { + [self initNoVideoDataViewHidden:YES]; + [self.playbackFiles addObjectsFromArray:files]; + + [self.tableView reloadData]; + } + else + { + [self initNoVideoDataViewHidden:NO]; + } + } + else + { + [self initNoVideoDataViewHidden:NO]; + [self connectDevice]; + } + }]; +} + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. @@ -336,17 +256,12 @@ -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ - return 2; + return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - if (section ==0) { - - return [self.playbackFiles count]; - } - return [self.playbackFilesMore count]; - + return self.playbackFiles.count; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ @@ -359,68 +274,15 @@ IfishPlaybackViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishPlaybackViewCell"]; + GWPlaybackFileModel*model=[self.playbackFiles objectAtIndex:indexPath.row]; + if (!cell) { cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishPlaybackViewCell" owner:self options:nil]lastObject]; } + cell.model=model; + - //每一分区这里加载不同数据源 - if (indexPath.section ==0) { - if (self.playbackFiles.count!=0) { - - NSString* name = [self.playbackFiles objectAtIndex:indexPath.row]; - - int iSize = 0; - if ([self.playbackFiles count] == [self.playbackSize count]) //查询到了文件长度 - { - NSNumber* number = [self.playbackSize objectAtIndex:indexPath.row]; - iSize = [number intValue]; - } - if (iSize != 0) {//支持返回播放时长 - //cell.videoTime.text = [NSString stringWithFormat:@"%@ (%02d:%02d)", name, iSize/60, iSize%60]; - cell.videoTime.text = [NSString stringWithFormat:@"%@", name]; - cell.videoLongth.text = [NSString stringWithFormat:@"%02d分钟",iSize/60]; - if (iSize<60) { - - cell.videoLongth.text = [NSString stringWithFormat:@"%02d秒钟",iSize%60]; - } - - } - else - { - cell.videoTime.text = [NSString stringWithFormat:@"%@", name]; - cell.videoLongth.text = @"未知"; - } - - } - - }else{ - //更多 - if (self.playbackFilesMore.count !=0) { - - NSString* name = [self.playbackFilesMore objectAtIndex:indexPath.row]; - - int iSize = 0; - if ([self.playbackFilesMore count] == [self.playbackSizeMore count]) //查询到了文件长度 - { - NSNumber* number = [self.playbackSizeMore objectAtIndex:indexPath.row]; - iSize = [number intValue]; - } - if (iSize != 0) {//支持返回播放时长 - //cell.videoTime.text = [NSString stringWithFormat:@"%@ (%02d:%02d)", name, iSize/60, iSize%60]; - cell.videoTime.text = [NSString stringWithFormat:@"%@", name]; - cell.videoLongth.text = [NSString stringWithFormat:@"%02d分钟",iSize/60]; - - } - else - { - cell.videoTime.text = [NSString stringWithFormat:@"%@", name]; - cell.videoLongth.text = @"未知"; - } - - } - - } return cell; @@ -428,144 +290,133 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - [self.movieView setHidden:NO]; - self.movieView.alpha = 0.3; + GWPlaybackFileModel*model=[self.playbackFiles objectAtIndex:indexPath.row]; + PlayBackViewController*play=[[PlayBackViewController alloc]init]; + play.camera=self.camera; + play.model=model; - [UIView transitionWithView:self.movieView duration:0.3 options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self.movieView.alpha = 1.0; - } - - completion:^(BOOL finished){ - - } - ]; - if (indexPath.section ==0) { - - [[P2PClient sharedClient] p2pPlaybackCallWithId:self.camera.cameraId password:self.camera.cameraPass index:indexPath.row]; - - }else{ - [[P2PClient sharedClient] p2pPlaybackCallWithId:self.camera.cameraId password:self.camera.cameraPass index:indexPath.row + self.playbackFiles.count]; - } + + [self.navigationController pushViewController:play animated:YES]; + [tableView deselectRowAtIndexPath:indexPath animated:YES]; } - --(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ - - if (section==0) { - //描述 + 回放列表 + 今天 + 1 像素线 - return 50 +BACKVIEW_ROWH +BACKVIEW_ROWH + 1; - } - return 0.1; -} - --(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ - - if (section ==1) { - - return BACKVIEW_ROWH; - } - return 0.1; -} --(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ - - CGFloat space = 10; - - if (section ==0) { - - UIView *section0Header =[[UIView alloc] init]; - section0Header.frame = CGRectMake(0, 0, self.view.frame.size.width, 191); - - UILabel *describleLabe=[[UILabel alloc] init]; - describleLabe.frame = CGRectMake(0, 0,self.view.frame.size.width, 50); - describleLabe.textColor =RGB(102, 102, 102); - describleLabe.textAlignment = NSTextAlignmentCenter; - describleLabe.text = @"30分钟录制一次,录像最多存储7日"; - describleLabe.font = [UIFont systemFontOfSize:12]; - describleLabe.backgroundColor = RGB(241, 245, 246); - - [section0Header addSubview:describleLabe]; - - UIView *listLabeBack =[[UIView alloc] init]; - listLabeBack.frame = CGRectMake(0,CGRectGetMaxY(describleLabe.frame), self.view.frame.size.width,BACKVIEW_ROWH); - listLabeBack.backgroundColor = [UIColor whiteColor]; - - [section0Header addSubview:listLabeBack]; - - UILabel *listLabe=[[UILabel alloc] init]; - listLabe.frame = CGRectMake(space,CGRectGetHeight(listLabeBack.frame)/2,200, 20); - listLabe.textColor =RGB(102, 102, 102); - listLabe.font = [UIFont systemFontOfSize:15]; - listLabe.text = @"回放列表"; - [listLabeBack addSubview:listLabe]; - CGFloat listlW = 50; - UILabel *listl=[[UILabel alloc] init]; - listl.frame = CGRectMake(self.view.frame.size.width - space -listlW -4,CGRectGetHeight(listLabeBack.frame)/2,listlW, 20); - listl.textColor =RGB(102, 102, 102); - listl.font = [UIFont systemFontOfSize:14]; - listl.text = @"时长"; - listl.textAlignment = NSTextAlignmentRight; - [listLabeBack addSubview:listl]; - - - //一像素分割线 - UIView *lineView =[[UIView alloc] init]; - lineView.frame = CGRectMake(0, CGRectGetMaxY(listLabeBack.frame), self.view.frame.size.width,1); - lineView.backgroundColor = RGB(241, 241, 241); - [section0Header addSubview:lineView]; - //今天 - UIView *todayLabeBack =[[UIView alloc] init]; - todayLabeBack.frame = CGRectMake(0,CGRectGetMaxY(lineView.frame),self.view.frame.size.width, BACKVIEW_ROWH); - todayLabeBack.backgroundColor = [UIColor whiteColor]; - - [section0Header addSubview:todayLabeBack]; - UILabel *todayLabe=[[UILabel alloc] init]; - todayLabe.frame = CGRectMake(space,0,self.view.frame.size.width, BACKVIEW_ROWH); - todayLabe.textColor =RGB(153, 153, 153); - todayLabe.font = [UIFont systemFontOfSize:14]; - todayLabe.text = @"最近24小时"; - todayLabe.backgroundColor = [UIColor whiteColor]; - //todayLabe.text. - [todayLabeBack addSubview:todayLabe]; - - - - return section0Header; - } - - return nil; - -} - --(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ - CGFloat space = 10; - - if (section ==1) { - //更多 - UIView *moreLabeBack =[[UIView alloc] init]; - moreLabeBack.frame = CGRectMake(0,0,self.view.frame.size.width, BACKVIEW_ROWH); - moreLabeBack.backgroundColor = [UIColor whiteColor]; - UILabel *moreLabe=[[UILabel alloc] init]; - moreLabe.frame = CGRectMake(space,0,self.view.frame.size.width, BACKVIEW_ROWH); - moreLabe.textColor =RGB(153, 153, 153); - moreLabe.font = [UIFont systemFontOfSize:14]; - moreLabe.text = @"查看更多"; - moreLabe.backgroundColor = [UIColor whiteColor]; - [moreLabeBack addSubview:moreLabe]; - moreLabe.userInteractionEnabled = YES; - UITapGestureRecognizer *moreGesture =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(moreDataRequset)]; - [moreLabe addGestureRecognizer:moreGesture]; - - return moreLabeBack; - - } - return nil; -} +// +//-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ +// +// if (section==0) { +// //描述 + 回放列表 + 今天 + 1 像素线 +// return 50 +BACKVIEW_ROWH +BACKVIEW_ROWH + 1; +// } +// return 0.1; +//} +// +//-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ +// +// if (section ==1) { +// +// return BACKVIEW_ROWH; +// } +// return 0.1; +//} +//-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ +// +// CGFloat space = 10; +// +// if (section ==0) { +// +// UIView *section0Header =[[UIView alloc] init]; +// section0Header.frame = CGRectMake(0, 0, self.view.frame.size.width, 191); +// +// UILabel *describleLabe=[[UILabel alloc] init]; +// describleLabe.frame = CGRectMake(0, 0,self.view.frame.size.width, 50); +// describleLabe.textColor =RGB(102, 102, 102); +// describleLabe.textAlignment = NSTextAlignmentCenter; +// describleLabe.text = @"30分钟录制一次,录像最多存储7日"; +// describleLabe.font = [UIFont systemFontOfSize:12]; +// describleLabe.backgroundColor = RGB(241, 245, 246); +// +// [section0Header addSubview:describleLabe]; +// +// UIView *listLabeBack =[[UIView alloc] init]; +// listLabeBack.frame = CGRectMake(0,CGRectGetMaxY(describleLabe.frame), self.view.frame.size.width,BACKVIEW_ROWH); +// listLabeBack.backgroundColor = [UIColor whiteColor]; +// +// [section0Header addSubview:listLabeBack]; +// +// UILabel *listLabe=[[UILabel alloc] init]; +// listLabe.frame = CGRectMake(space,CGRectGetHeight(listLabeBack.frame)/2,200, 20); +// listLabe.textColor =RGB(102, 102, 102); +// listLabe.font = [UIFont systemFontOfSize:15]; +// listLabe.text = @"回放列表"; +// [listLabeBack addSubview:listLabe]; +// CGFloat listlW = 50; +// UILabel *listl=[[UILabel alloc] init]; +// listl.frame = CGRectMake(self.view.frame.size.width - space -listlW -4,CGRectGetHeight(listLabeBack.frame)/2,listlW, 20); +// listl.textColor =RGB(102, 102, 102); +// listl.font = [UIFont systemFontOfSize:14]; +// listl.text = @"时长"; +// listl.textAlignment = NSTextAlignmentRight; +// [listLabeBack addSubview:listl]; +// +// +// //一像素分割线 +// UIView *lineView =[[UIView alloc] init]; +// lineView.frame = CGRectMake(0, CGRectGetMaxY(listLabeBack.frame), self.view.frame.size.width,1); +// lineView.backgroundColor = RGB(241, 241, 241); +// [section0Header addSubview:lineView]; +// //今天 +// UIView *todayLabeBack =[[UIView alloc] init]; +// todayLabeBack.frame = CGRectMake(0,CGRectGetMaxY(lineView.frame),self.view.frame.size.width, BACKVIEW_ROWH); +// todayLabeBack.backgroundColor = [UIColor whiteColor]; +// +// [section0Header addSubview:todayLabeBack]; +// UILabel *todayLabe=[[UILabel alloc] init]; +// todayLabe.frame = CGRectMake(space,0,self.view.frame.size.width, BACKVIEW_ROWH); +// todayLabe.textColor =RGB(153, 153, 153); +// todayLabe.font = [UIFont systemFontOfSize:14]; +// todayLabe.text = @"最近24小时"; +// todayLabe.backgroundColor = [UIColor whiteColor]; +// //todayLabe.text. +// [todayLabeBack addSubview:todayLabe]; +// +// +// +// return section0Header; +// } +// +// return nil; +// +//} +// +//-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ +// CGFloat space = 10; +// +// if (section ==1) { +// //更多 +// UIView *moreLabeBack =[[UIView alloc] init]; +// moreLabeBack.frame = CGRectMake(0,0,self.view.frame.size.width, BACKVIEW_ROWH); +// moreLabeBack.backgroundColor = [UIColor whiteColor]; +// UILabel *moreLabe=[[UILabel alloc] init]; +// moreLabe.frame = CGRectMake(space,0,self.view.frame.size.width, BACKVIEW_ROWH); +// moreLabe.textColor =RGB(153, 153, 153); +// moreLabe.font = [UIFont systemFontOfSize:14]; +// moreLabe.text = @"查看更多"; +// moreLabe.backgroundColor = [UIColor whiteColor]; +// [moreLabeBack addSubview:moreLabe]; +// moreLabe.userInteractionEnabled = YES; +// UITapGestureRecognizer *moreGesture =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(moreDataRequset)]; +// [moreLabe addGestureRecognizer:moreGesture]; +// +// return moreLabeBack; +// +// } +// return nil; +//} #pragma mark - moreDataRequset -(void)moreDataRequset{ - _isloadMore =YES; + // //today NSDate *nowDate = [NSDate date]; NSInteger interval =31; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.xib b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.xib new file mode 100644 index 0000000..d522aaa --- /dev/null +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.xib @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.h index df189b2..0012375 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.h @@ -7,11 +7,12 @@ // #import +#import @interface IfishPlaybackViewCell : UITableViewCell -@property (weak, nonatomic) IBOutlet UIImageView *palybackVideo; - -@property (weak, nonatomic) IBOutlet UILabel *videoLongth; -@property (weak, nonatomic) IBOutlet UILabel *videoTime; +@property (weak, nonatomic) IBOutlet UIImageView *playImageView; +@property (weak, nonatomic) IBOutlet UILabel *startTimeLabel; +@property (weak, nonatomic) IBOutlet UILabel *endTimeLabel; +@property (nonatomic, strong) GWPlaybackFileModel *model; @end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.m index a2f5fb7..3fe7805 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.m @@ -13,7 +13,7 @@ - (void)awakeFromNib { [super awakeFromNib]; // Initialization code - self.palybackVideo.image = LXImageWithImageName(@"playback_iocn_video"); + self.playImageView.image = LXImageWithImageName(@"playBackIcon"); } @@ -22,5 +22,36 @@ // Configure the view for the selected state } +-(void)setModel:(GWPlaybackFileModel *)model +{ + _model=model; + + NSString*start=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute]; + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.dateFormat = @"yyyyMMddHHmmss"; + NSDate*date=model.date; + if (!date + ) { + date= [formatter dateFromString:[start stringByAppendingFormat:@"%02ld",model.second]]; + + } + + NSString*end=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute]; + if (date) + { + + date=[date dateByAddingTimeInterval:model.time]; + + formatter.dateFormat=@"yyyyMMddHHmm"; + end=[formatter stringFromDate:date]; + } + else + { + + } + self.startTimeLabel.text=start; + self.endTimeLabel.text=end; + +} @end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.xib b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.xib index e7cb869..db22efe 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.xib +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishPlaybackViewCell.xib @@ -1,60 +1,78 @@ - - - - - + + + - + + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.h new file mode 100644 index 0000000..da44f2a --- /dev/null +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.h @@ -0,0 +1,21 @@ +// +// PlayBackViewController.h +// Ifish +// +// Created by 祝发冬 on 2020/10/18. +// Copyright © 2020 lianlian. All rights reserved. +// + +#import "BaseViewController.h" +#import "IfishCameraModel.h" +#import +NS_ASSUME_NONNULL_BEGIN + +@interface PlayBackViewController : BaseViewController +@property (nonatomic,strong) IfishCameraModel *camera; +@property (weak, nonatomic) IBOutlet UIView *playView; +@property (weak, nonatomic) IBOutlet UIButton *retryBtn; +@property (nonatomic,strong) GWPlaybackFileModel *model; +@end + +NS_ASSUME_NONNULL_END diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.m new file mode 100644 index 0000000..364cce4 --- /dev/null +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.m @@ -0,0 +1,215 @@ +// +// PlayBackViewController.m +// Ifish +// +// Created by 祝发冬 on 2020/10/18. +// Copyright © 2020 lianlian. All rights reserved. +// + +#import "PlayBackViewController.h" + +@interface PlayBackViewController () +@property (nonatomic, strong) GWP2PPlaybackPlayer *player;//摄像头页面 +@property (nonatomic) BOOL isReject; +@end + +@implementation PlayBackViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.navigationController.navigationBar.hidden=YES; + [[UIApplication sharedApplication] setStatusBarHidden:YES]; + [AppDelegate sharedDefault].canFullScreen = YES; + + [self setTitleString:@"视频回放"]; + UIBarButtonItem*bat=[CommonUtils ItemWithTitle:@"切换" target:self action:@selector(varyOritation) titleColor:[UIColor whiteColor]]; + self.navigationItem.rightBarButtonItems=nil; + self.navigationItem.rightBarButtonItem=bat; + self.view.backgroundColor=[UIColor blackColor]; + UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(taptochange)]; + + [self.view addGestureRecognizer:tap]; + [CommonUtils interfaceOrientation:UIDeviceOrientationLandscapeRight]; + [self connectDevice]; + + // Do any additional setup after loading the view from its nib. +} + +-(void)viewDidLayoutSubviews +{ + [super viewDidLayoutSubviews]; + +} +-(void)playFiles +{ + //添加播放器VC + + self.player = [[GWP2PPlaybackPlayer alloc] init]; + + self.player.mute = YES; + self.player.delegate=self; + self.player.viewController.view.backgroundColor = [UIColor clearColor]; + self.player.viewController.view.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; + + self.player.viewController.view.frame=self.playView.bounds; + [self addChildViewController:self.player.viewController]; + [self.playView addSubview:self.player.viewController.view]; + [MBProgressHUD showHUDAddedTo:self.view animated:YES]; + WEAK_SELF; + [self.player p2pCallPlaybackFileWithDeviceId:self.camera.cameraId password:self.camera.cameraPass playbackFile:self.model calling:^(NSDictionary *parameters) { + + } accept:^(NSDictionary *parameters) { + + } reject:^(GWP2PCallError error, NSString *errorCode) { + + dispatch_async(dispatch_get_main_queue(), ^{ + [MBProgressHUD hideHUDForView:weakSelf.view animated:YES]; + [weakSelf.view makeToast:@"连接失败请重试!"]; + + weakSelf.retryBtn.hidden=NO; + [AppDelegate sharedDefault].canFullScreen = NO; + + + [CommonUtils interfaceOrientation:UIDeviceOrientationPortrait]; + + }); + + + } ready:^{ + + dispatch_async(dispatch_get_main_queue(), ^{ + [MBProgressHUD hideHUDForView:weakSelf.view animated:YES]; + + weakSelf.retryBtn.hidden=YES; + }); + }] ; + + ; + +} + +-(void)connectDevice{ + + UserModel *model=[dataContorl getUserInfo]; + NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; + //初始化设备 + if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) { + NSLog(@"正在检查P2P连接状态"); + BOOL connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; + + if (connectDevice) { + + [self playFiles]; + + }else{ + [self retry:nil]; + } + } + else + { + [self playFiles]; + } + +} +-(BOOL)p2pPlayer:(GWP2PPlayer *)player shouldHandlerSwipeGesture:(UIGestureRecognizer *)gesture +{ + return YES;; +} +-(void)goBackAction{ + + [self.player p2pPause]; + self.player=nil; + [self.navigationController popViewControllerAnimated:YES]; +} +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ +- (IBAction)retry:(UIButton *)sender { + + [self.player p2pStop]; + [self.player.viewController.view removeFromSuperview]; + self.player=nil; + [self connectDevice]; +} +-(void)taptochange +{ + self.navigationController.navigationBar.hidden=!self.navigationController.navigationBar.hidden; + [[UIApplication sharedApplication] setStatusBarHidden:self.navigationController.navigationBar.isHidden]; +} + +-(void)dealloc +{ + self.navigationController.navigationBar.hidden=NO; + [[UIApplication sharedApplication] setStatusBarHidden:NO]; + [AppDelegate sharedDefault].canFullScreen = NO; + [CommonUtils interfaceOrientation:UIInterfaceOrientationPortrait]; +} + +-(UIInterfaceOrientationMask)supportedInterfaceOrientations{ + + return UIInterfaceOrientationMaskAll; +} + +#pragma mark 一开始希望的屏幕方向 +-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{ + return UIDeviceOrientationLandscapeRight; +} + +#pragma mark - 屏幕旋转 +-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration +{ + + + if (toInterfaceOrientation == UIInterfaceOrientationPortrait) + { + + } + else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) { + + } + else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) + { + + + } +} +-(BOOL)shouldAutorotate +{ + return YES;; +} +-(BOOL)prefersStatusBarHidden + +{ + return self.navigationController.isNavigationBarHidden; + +} + + +-(void)varyOritation +{ + UIInterfaceOrientation statusBarOrientation = [UIApplication sharedApplication].statusBarOrientation; + if (statusBarOrientation==UIInterfaceOrientationPortrait) + { + [AppDelegate sharedDefault].canFullScreen = YES; + + [CommonUtils interfaceOrientation:UIDeviceOrientationLandscapeRight]; + } + else + { + [AppDelegate sharedDefault].canFullScreen = NO; + + + [CommonUtils interfaceOrientation:UIDeviceOrientationPortrait]; + + + } + +} + +@end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.xib b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.xib new file mode 100644 index 0000000..faeaeaf --- /dev/null +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/PlayBackViewController.xib @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraBottomHView.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraBottomHView.m index 960311a..90c4170 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraBottomHView.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraBottomHView.m @@ -68,10 +68,10 @@ static NSString *bootomRecCellIdentifier = @"IfishRecVideoViewCell"; ////录制回放功能打开 //_dataImgArray = @[LXImageWithImageName(@"devicename_iocn_screenshots.png"),LXImageWithImageName(@"devicename_iocn_gallery.png"),LXImageWithImageName(@"devicename_iocn_rec.png"),LXImageWithImageName(@"devicename_iocn_playback.png"),LXImageWithImageName(@"devicename_iocn_care.png"),LXImageWithImageName(@"devicename_iocn_look.png"),LXImageWithImageName(@"devicename_iocn_Ilookat.png"),LXImageWithImageName(@"devicename_iocn_look.png"),LXImageWithImageName(@"devicename_iocn_look.png")]; //equipment_iocn_playback - _dataImgArray = @[LXImageWithImageName(@"equipment_iocn_printscreen"),LXImageWithImageName(@"equipment_iocn_gallery"),LXImageWithImageName(@"equipment_iocn_care"),LXImageWithImageName(@"equipment_iocn_look"),LXImageWithImageName(@"equipment_iocn_mylook"),LXImageWithImageName(@"equipment_iocn_share")]; + _dataImgArray = @[LXImageWithImageName(@"equipment_iocn_printscreen"),LXImageWithImageName(@"equipment_iocn_gallery"),LXImageWithImageName(@"equipment_iocn_care"),LXImageWithImageName(@"equipment_iocn_look"),LXImageWithImageName(@"equipment_iocn_mylook"),LXImageWithImageName(@"equipment_iocn_share"),LXImageWithImageName(@"equipment_iocn_videorecord"),LXImageWithImageName(@"equipment_iocn_videoback")]; //_dataNameArray = @[@"截图",@"图库",@"录制",@"回放",@"我的看护",@"爱鱼看看",@"我的看看",@"",@""]; - _dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇"]; + _dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇",@"视频录制",@"视频回放"]; } #pragma mark - UICollectionViewDataSource @@ -84,7 +84,7 @@ static NSString *bootomRecCellIdentifier = @"IfishRecVideoViewCell"; - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ //return 9; - return 6; + return 8; } #pragma mark 设置item内容 diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraRecordViewController.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraRecordViewController.h index 172aa7b..8b03ef1 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraRecordViewController.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraRecordViewController.h @@ -9,7 +9,11 @@ #import "BaseViewController.h" #import "IfishCameraModel.h" #import "MBProgressHUD.h" +#import + + @interface CameraRecordViewController : BaseViewController @property (nonatomic,strong) IfishCameraModel *camera; +@property (nonatomic, strong) GWP2PVideoPlayer *player;//摄像头页面 @property (strong, nonatomic) MBProgressHUD *progressAlert; @end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraRecordViewController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraRecordViewController.m index 391e087..3b33254 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraRecordViewController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishcameraBottomHView/CameraRecordViewController.m @@ -11,6 +11,9 @@ #import "IfishCameraRecordfirstCell.h" #import "IfishCameraRecordSecondCell.h" #import "IfishCameraRecordThirdCell.h" +#import "TemperatureSetModel.h" +#import "TemperatureSetCell.h" +#import "MydatePickerView.h" #define RECODIEECELL_TIME 911 #define RECODIEECELL_BTN 922 #define RECODIEECELL_SWiTCH 933 @@ -25,15 +28,16 @@ static const CGFloat ToastFade = 0.2; @property(nonatomic) NSInteger minute; @property(nonatomic,strong) NSTimer*timer; @property(nonatomic,copy) NSString *timestr; - +@property (nonatomic, assign) BOOL isConnectCamera; @property(nonatomic) BOOL isRecording; @property(nonatomic) NSIndexPath *timerIndex; @property(nonatomic) NSIndexPath *switchIndex; @property(nonatomic) NSIndexPath *buttonIndex; @property(assign) unsigned int remoteRecordState; //本app 需求模式 非摄像头模式 -@property(nonatomic) BOOL isManual; - +@property(nonatomic,strong) NSMutableArray*array; +@property(nonatomic,strong) NSString*recordType; +@property (nonatomic, strong)MydatePickerView *mydatepicView; @end @@ -41,43 +45,23 @@ static const CGFloat ToastFade = 0.2; - (void)viewDidLoad { [super viewDidLoad]; + [self connectDevice]; + // Do any additional setup after loading the view. - [self addTitleViewWithTitle:@"手动录制"]; - _timestr= @"00:00"; - _isRecording = NO; - _isManual = NO; - + [self addTitleViewWithTitle:@"录制视频"]; + self.recordType=[[DataCenter defaultDtacenter].cache stringForKey:@"recordType"]; + if (!self.recordType.length) + { + self.recordType=@"0"; + } [self creatUI]; - self.view.backgroundColor = RGB(242, 242, 242); + // self.view.backgroundColor = RGB(242, 242, 242); } -(void)goBackAction{ - - if (_isRecording) { - - UIAlertController*ac=[UIAlertController alertControllerWithTitle:@"" message:@"是否结束手动录制" preferredStyle:UIAlertControllerStyleAlert]; - - [self presentViewController:ac animated:YES completion:nil]; - [ac addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction*action){ - - - - }]]; - - [ac addAction:[UIAlertAction actionWithTitle:@"结束" style:UIAlertActionStyleDefault handler:^(UIAlertAction*action){ - [[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId - password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF]; - [self.navigationController popViewControllerAnimated:YES]; - - }]]; - - - }else{ - [self.navigationController popViewControllerAnimated:YES]; - } - + [self.navigationController popViewControllerAnimated:YES]; } -(void)creatUI{ @@ -88,10 +72,39 @@ static const CGFloat ToastFade = 0.2; self.tab.separatorStyle = UITableViewCellSeparatorStyleNone; self.tab.showsVerticalScrollIndicator = NO; self.tab.scrollEnabled = NO; - self.tab.backgroundColor = RGB(242, 242, 242); + //self.tab.backgroundColor = RGB(242, 242, 242); [self.view addSubview:self.tab]; + [self.tab reloadData]; } +-(void)connectDevice{ + + UserModel *model=[dataContorl getUserInfo]; + NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; + //初始化设备 + if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) { + NSLog(@"正在检查P2P连接状态"); + BOOL connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; + + if (connectDevice) { + [[GWP2PClient sharedClient] setDeviceRecordDefinition:GWP2PRecordDefinitionStandardDefinition withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + }else{ + + [self.view makeToast:@"p2pConnect failure.失败,不能操作设备,请重试"]; + } + } + else + { + [[GWP2PClient sharedClient] setDeviceRecordDefinition:GWP2PRecordDefinitionStandardDefinition withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + } + +} + + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; @@ -100,574 +113,276 @@ static const CGFloat ToastFade = 0.2; -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ack_receiveRemoteMessage:) name:ACK_RECEIVE_REMOTE_MESSAGE object:nil]; - [[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass]; - // [[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass]; + } -(void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:ACK_RECEIVE_REMOTE_MESSAGE object:nil]; + } #pragma mark - receiveRemoteMessage -- (void)receiveRemoteMessage:(NSNotification *)notification -{ - NSDictionary *parameter = [notification userInfo]; - int key = [[parameter valueForKey:@"key"] intValue]; - switch (key) { - - case RET_GET_SDCARD_INFO: - { - NSInteger result = [[parameter valueForKey:@"result"] intValue]; - - dispatch_async(dispatch_get_main_queue(), ^{ - if (result == 1) { - - //[self.view makeToast:@"sdk卡可使用"]; - //获取状态信息 - // [[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass]; - - if (_isManual) { - if (self.remoteRecordState ==1){ - //[self.view makeToast:@"请先关闭自动录制"]; - [self showLableAction:@"请先关闭自动录制"]; - dispatch_async(dispatch_get_main_queue(), ^{ - [self hiddenTostVIew]; - - }); - [self resetTimerlabel]; - - return ; - - } - - NSArray *buttonindex =@[self.buttonIndex]; - [self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone]; - - [[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId - password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON]; - }else{ - - [self showLableAction:@"请先关闭自动录制"]; - dispatch_async(dispatch_get_main_queue(), ^{ - [self hiddenTostVIew]; - - }); - [self resetTimerlabel]; - } - - - }else{ - //sd卡不存在, - //停止计时 - - dispatch_async(dispatch_get_main_queue(), ^{ - [self hiddenTostVIew]; - - }); - [self resetTimerlabel]; - [self.view makeToast:NSLocalizedString(@"no_storage", nil)]; - - - } - }); - - } - break; - case RET_GET_NPCSETTINGS_PRERECORD: //预录像开关 获取时 - { - - NSInteger state = [[parameter valueForKey:@"state"] intValue]; - - NSLog(@"预录像开关 获取时state%ld",(long)state); - } - break; - - case RET_SET_NPCSETTINGS_PRERECORD: //预录像开关 设置时 - { - NSInteger result = [[parameter valueForKey:@"result"] intValue]; - - if(result==0){ - - NSLog(@"预录像开关设置result%ld",(long)result); - - }else{ - - NSLog(@"预录像开关设置result%ld",(long)result); - - } - } - break; - - case RET_SET_NPCSETTINGS_REMOTE_RECORD: - { - NSInteger result = [[parameter valueForKey:@"result"] integerValue]; - - - if(result==0){ - //设置成功主动获取一次状态 刷新 - dispatch_async(dispatch_get_main_queue(), ^{ - [self hiddenTostVIew]; - - }); - - [[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass]; - - - }else{ - - NSLog(@"设置失败:%li",(long)result); - } - - - } - break; - case RET_GET_NPCSETTINGS_REMOTE_RECORD: - { - // - - NSInteger state = [[parameter valueForKey:@"state"] intValue]; - self.remoteRecordState = (unsigned int)state; - - if (state ==0) { - - dispatch_async(dispatch_get_main_queue(), ^{ - - - [self resetTimerlabel]; - - }); - - }else{ - - - } - - if (_isManual) { - //手动模式开启不刷新switch按钮状态 - - return; - } - NSLog(@"获取 remote record state:%li",(long)state); - - dispatch_async(dispatch_get_main_queue(), ^{ - NSArray *index =@[self.switchIndex]; - [self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone]; - // NSArray *buttonindex =@[self.buttonIndex]; - // [self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone]; - }); - - } - - case RET_GET_NPCSETTINGS_RECORD_TYPE: - { - NSInteger type = [[parameter valueForKey:@"type"] intValue]; - //0手动模式 摄像头模式 - - NSLog(@"获取录像模式类型type%ld",(long)type); - - } - break; - - case RET_SET_NPCSETTINGS_RECORD_TYPE: - { - NSInteger result = [[parameter valueForKey:@"result"] intValue]; - //0类型设置成功 - if (result==0) { - //[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId - // password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON]; - } - - NSLog(@"设置录像模式类型result%ld",(long)result); - - - } - break; - - default: - break; - } - -} - -#pragma mark -ack_receiveRemoteMessage -- (void)ack_receiveRemoteMessage:(NSNotification *)notification{ - NSDictionary *parameter = [notification userInfo]; - int key = [[parameter valueForKey:@"key"] intValue]; - int result = [[parameter valueForKey:@"result"] intValue]; - switch (key) { - case ACK_RET_GET_SDCARD_INFO: - { - dispatch_async(dispatch_get_main_queue(), ^{ - if(result==1){ - - [self.view makeToast:NSLocalizedString(@"device_password_error", nil)]; -// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ -// usleep(800000); -// -// -// }); - - }else if(result==2){ - DLog(@"resend do device update"); - - } - - - }); - - DLog(@"ACK_RET_GET_SDCARD_INFO:%i",result); - } - break; - case ACK_RET_SET_SDCARD_INFO: - { - dispatch_async(dispatch_get_main_queue(), ^{ - if(result==1){ - - [self.view makeToast:NSLocalizedString(@"device_password_error", nil)]; -// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ -// usleep(800000); -// dispatch_async(dispatch_get_main_queue(), ^{ -// }); -// }); - - }else if(result==2){ - DLog(@"resend do device update"); - - } - - }); - - } - break; - - - default: - break; - } - -} -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - if (section ==2) { - - return 2; - } return 1; } -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ - return 3; + return 2; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + TemperatureSetCell*cell=[tableView dequeueReusableCellWithIdentifier:@"TemperatureSetCell"]; + if (cell==nil) { + cell=[[[NSBundle mainBundle]loadNibNamed:@"TemperatureSetCell" owner:self options:nil]lastObject]; + } + cell.backgroundView=nil; + cell.backgroundColor= RGB(242, 242, 242); if (indexPath.section ==0 && indexPath.row ==0) { - IfishCameraRecordfirstCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordfirstCell"]; - if (!cell) { - cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordfirstCell" owner:self options:nil]lastObject]; + + + TemperatureSetModel*model=[[TemperatureSetModel alloc]init]; + model.title=@"即时录制"; + model.temperatureLabel=@""; + model.status=self.recordType;; + cell.titleLabel.text=model.title; + + cell.temperaturelabel.text=model.temperatureLabel; + [cell.temPSwitch addTarget:self action:@selector(nowRecordBtnAction:) forControlEvents:UIControlEventTouchUpInside]; + [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateSelected]; + [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal]; + + cell.temPSwitch.selected=[model.status isEqualToString:@"1"]; - } - cell.selectionStyle = UITableViewCellSelectionStyleNone; - return cell; - - }else if (indexPath.section ==2 && indexPath.row ==0){ - IfishCameraRecordSecondCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordSecondCell"]; - if (!cell) { - cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordSecondCell" owner:self options:nil]lastObject]; - } - cell.selectionStyle = UITableViewCellSelectionStyleNone; - cell.tag = RECODIEECELL_TIME; - self.timerIndex = indexPath; - cell.timeLabe.text = _timestr; - _isRecording ? [cell.timeLabe setTextColor:RGB(51, 51, 51)] : [cell.timeLabe setTextColor:RGB(153, 153, 153)]; - [cell cellRecordBViewCorner]; - return cell; - - }else if (indexPath.section ==2 && indexPath.row ==1){ - - IfishCameraRecordThirdCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordThirdCell"]; - if (!cell) { - cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordThirdCell" owner:self options:nil]lastObject]; - - } - cell.tag = RECODIEECELL_BTN; - cell.selectionStyle = UITableViewCellSelectionStyleNone; - [cell.recordBtn addTarget:self action:@selector(recordBtnAction:) forControlEvents:UIControlEventTouchUpInside]; - - if (_isRecording) { - cell.recordBtn.selected = YES; - [cell.recordBtn setBackgroundColor:RGB(255,115,92)]; - [cell.recordBtn setTitle:@"结束录制" forState:UIControlStateNormal]; - }else{ - cell.recordBtn.selected = NO; - [cell.recordBtn setBackgroundColor:RGB(0,184,239)]; - [cell.recordBtn setTitle:@"开始录制" forState:UIControlStateNormal]; - } - self.buttonIndex =indexPath; - [cell cellSetRecordBtnBackViewCorner]; - return cell; + }else if (indexPath.section ==1 && indexPath.row ==0){ - self.switchIndex = indexPath; - IfishCameraRecordFourCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordFourCell"]; - if (!cell) { - cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordFourCell" owner:self options:nil]lastObject]; - - } - cell.tag = RECODIEECELL_SWiTCH; - cell.selectionStyle = UITableViewCellSelectionStyleNone; - [cell.zidongSw addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventTouchUpInside]; - if (self.remoteRecordState==1) { - - [cell.zidongSw setOn:YES]; - - }else{ - [cell.zidongSw setOn:NO]; - } - return cell; + TemperatureSetModel*model=[[TemperatureSetModel alloc]init]; + model.title=@"定时录制"; + model.temperatureLabel=[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"].length?[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"]:@"09:00-16:00"; + model.status=self.recordType;; + cell.titleLabel.text=model.title; + + cell.temperaturelabel.text=model.temperatureLabel; + [cell.temPSwitch addTarget:self action:@selector(schduleRecordAction:) forControlEvents:UIControlEventTouchUpInside]; + + [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateSelected]; + [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal]; + + cell.temPSwitch.selected=[model.status isEqualToString:@"2"]; + + + + } - - return nil; + return cell; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section ==0 && indexPath.row ==0) { - - return kScreenSize.width*0.516; - - }else if (indexPath.section ==2 && indexPath.row ==0){ - - return kScreenSize.width*0.357; - - }else if (indexPath.section ==1 && indexPath.row ==0){ - - return 46*KWidth_Scale; - }else if (indexPath.section ==2 && indexPath.row ==1){ - - return 76*KWidth_Scale; - } - return 0; + return 50; } -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ - if (section==0) { - return kScreenSize.width*0.213; - } - return 5; + return 5; } -(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ - if (section ==0) { - UIView *sectionV1=[[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width,kScreenSize.width*0.213)]; - sectionV1.backgroundColor = RGB(242, 242, 242); - return sectionV1; - - } + UIView *sectionV2=[[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width,5)]; - sectionV2.backgroundColor = RGB(242, 242, 242); + sectionV2.backgroundColor =[UIColor whiteColor]; return sectionV2; } +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.section==1) + { + if (!self.mydatepicView) { + _mydatepicView=[[MydatePickerView alloc]init]; + + _mydatepicView.frame=CGRectMake(0,0,kScreenSize.width,kScreenSize.height); + [_mydatepicView setIsNewXuanduo:YES]; + [_mydatepicView.picView reloadAllComponents]; + [_mydatepicView.cancleButton addTarget:self action:@selector(cancleButtonClick) forControlEvents:UIControlEventTouchUpInside]; + [_mydatepicView.sureButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside]; + NSString*time=[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"].length?[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"]:@"09:00-16:00"; + NSString*start=[[time componentsSeparatedByString:@"-"] firstObject]; + NSString*end=[[time componentsSeparatedByString:@"-"] lastObject]; + NSString*startHour=[[start componentsSeparatedByString:@":"] firstObject]; + NSString*startMin=[[start componentsSeparatedByString:@":"] lastObject]; + + NSString*endHour=[[end componentsSeparatedByString:@":"] firstObject]; + + NSString*endMin=[[end componentsSeparatedByString:@":"] lastObject]; + _mydatepicView.startString=startHour; + _mydatepicView.endString=startMin; + _mydatepicView.startString1=endHour; + _mydatepicView.endString1=endHour; + [_mydatepicView.picView selectRow:[(NSArray*)(_mydatepicView.dataArr[0]) indexOfObject:startHour] inComponent:0 animated:YES]; + [_mydatepicView.picView selectRow:[(NSArray*)(_mydatepicView.dataArr[1]) indexOfObject:startMin] inComponent:1 animated:YES]; + [_mydatepicView.picView selectRow:[(NSArray*)(_mydatepicView.dataArr[2]) indexOfObject:endHour] inComponent:2 animated:YES]; + [_mydatepicView.picView selectRow:[(NSArray*)(_mydatepicView.dataArr[3]) indexOfObject:endMin] inComponent:3 animated:YES]; + + + + } + + [self.view addSubview:_mydatepicView]; + } +} #pragma mark - recordBtnAction - --(void)recordBtnAction:(UIButton*)btn{ +#pragma mark 设置时间段 +-(void)doneButtonClick{ - if (btn.selected) { - [self resetTimerlabel]; - - _isManual = NO; - //停止录制 - [self startTostVIew]; - [[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId - password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF]; - - [self showLableAction:@"录制成功,请在回放中查看"]; - - }else{ - - - [self startRunTimerlabel]; - _isManual = YES; - //开始录制 - //获取SDCard状态 - [self startTostVIew]; - [[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass]; - } - - -} - --(void)startRunTimerlabel - -{ - //IfishCameraRecordThirdCell *cell=[self.view viewWithTag:RECODIEECELL_BTN]; - //cell.recordBtn.selected =YES; - _isRecording=YES; - __weak typeof(self)weakSelf=self; - NSInteger count = 30*60; - //NSInteger count = -1; - //NSInteger count = 60; - weakSelf.timer = [NSTimer scheduledTimerWithTimeInterval:1 count:count callback:^{ - weakSelf.second++; - if (weakSelf.second ==60) { - weakSelf.second = 0; - weakSelf.minute++; - } - if (weakSelf.minute ==30) { - weakSelf.minute =0; - weakSelf.second =0; - - [self resetTimerlabel]; - - _isManual = NO; - //停止录制 - [self startTostVIew]; - [[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId - password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF]; - [self showLableAction:@"录制成功,请在回放中查看"]; - return ; - - } - - _timestr= [IfishHelperUtils formatCameraPalybackTime:weakSelf.minute second:weakSelf.second]; - NSArray *index =@[self.timerIndex]; - [self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone]; - - }]; - - [[NSRunLoop currentRunLoop] addTimer: weakSelf.timer forMode:NSRunLoopCommonModes]; - - - // NSArray *buttonindex =@[self.buttonIndex]; - // [self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone]; - -} - --(void)resetTimerlabel -{ - - _isRecording=NO; - - if (_timer) { - [_timer unfireTimer]; - } - self.minute =0; - self.second =0; - _timestr = @"00:00"; - NSArray *index =@[self.timerIndex]; - [self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone]; - - NSArray *buttonindex =@[self.buttonIndex]; - [self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone]; - - -} - -#pragma mark -加载中 - --(void)startTostVIew{ - - self.progressAlert = [[MBProgressHUD alloc] initWithView:self.view]; - [self.view addSubview:self.progressAlert]; - self.progressAlert.mode=MBProgressHUDModeIndeterminate; - self.progressAlert.customView = [[UIView alloc] init]; - //self.progressAlert.labelText = [NSString stringWithFormat:@"%@...",NSLocalizedString(@"validating", nil)]; - [self.progressAlert show:YES]; - //设置5秒超时 - [self.progressAlert hide:YES afterDelay:5]; -} - --(void)hiddenTostVIew -{ - [self.progressAlert hide:YES]; - -} - -#pragma mark - switchAction: - --(void)switchAction:(UISwitch*)sender - -{ - - IfishCameraRecordFourCell *cell =[self.view viewWithTag:RECODIEECELL_SWiTCH]; - UISwitch* swt=(UISwitch*)sender; - cell.zidongSw = swt; - if (_isRecording) { - - dispatch_async(dispatch_get_main_queue(), ^{ - [cell.zidongSw setOn:NO]; - }); - //[self.view makeToast:@"请先结束手动录制"]; - [self showLableAction:@"请先结束手动录制"]; - return; - } - - [self startTostVIew]; - - if (swt.isOn) { - _isManual = YES; - [[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId - password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF]; + _mydatepicView.resultString=nil; + if (_mydatepicView.startString==nil||_mydatepicView.endString==nil) { + [self showTitle:@"" messsage:@"请选择时间"]; }else{ - _isManual = NO; - [[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId - password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON]; + _mydatepicView.resultString=[NSString stringWithFormat:@"%@:%@-%@:%@",_mydatepicView.startString,_mydatepicView.endString,_mydatepicView.startString1,_mydatepicView.endString1]; + [[DataCenter defaultDtacenter].cache setSynString:_mydatepicView.resultString forKey:@"schduleRecordTime"]; + + [_mydatepicView removeFromSuperview]; + + TemperatureSetCell*cell=[self.tab cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]]; + cell.temperaturelabel.text=_mydatepicView.resultString; + + } +} +-(void)cancleButtonClick{ + + + [_mydatepicView removeFromSuperview]; +} + +-(void)nowRecordBtnAction:(UIButton*)btn{ + + btn.selected=!btn.selected; + ; + if (btn.selected) + { + self.recordType=@"1"; + [[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"]; + + [[GWP2PClient sharedClient] setDeviceManuallyRecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + [[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeManual withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + if (success) + { + [self.view makeToast:@"设置成功"]; + } + else + { + [self.view makeToast:@"设置失败"]; + } + }]; + + [[GWP2PClient sharedClient] setDeviceManuallyRecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + + }else + { + self.recordType=@"0"; + [[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"]; + + [[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeAlarm withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + NSLog(@"data=%@",dataDictionary); + }]; + [[GWP2PClient sharedClient] setDevicePrerecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + [[GWP2PClient sharedClient] setDeviceAlarmRecordTime:3 withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + [[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; } + [self.tab reloadData]; } -- (void)showLableAction:(NSString *)str{ - - UILabel *laberAction =[[UILabel alloc]init]; - CGFloat labW = 200; - laberAction.frame =CGRectMake(kScreenSize.width/2 - labW/2,kScreenSize.height*3/4 - 50 , labW, 40); - laberAction.clipsToBounds =YES; - laberAction.layer.cornerRadius =5; - laberAction.layer.backgroundColor = [UIColor blackColor].CGColor; - laberAction.alpha =1; - laberAction.text =str; - laberAction.textAlignment =NSTextAlignmentCenter; - //laberAction.backgroundColor =IndicatorBack_COLOR; - laberAction.font=[UIFont systemFontOfSize:14]; - laberAction.textColor=[UIColor whiteColor]; - - [self.view addSubview:laberAction]; - - [UIView animateWithDuration:ToastFade - delay:0.0 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - laberAction.alpha = 1.0; - } completion:^(BOOL finished) { - [UIView animateWithDuration:ToastFade - delay:1.5 - options:UIViewAnimationOptionCurveEaseIn - animations:^{ - laberAction.alpha = 0.0; - } completion:^(BOOL finished) { - [laberAction removeFromSuperview]; - }]; - }]; + +-(void)schduleRecordAction:(UISwitch*)btn + +{ + + btn.selected=!btn.selected; + + + + if (btn.selected) { + + self.recordType=@"2"; + [[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"]; + [[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + [[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeSchedule withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + NSLog(@"data=%@",dataDictionary); + }]; + NSString*time=[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"].length?[[DataCenter defaultDtacenter].cache stringForKey:@"schduleRecordTime"]:@"09:00-16:00"; + NSString*start=[[time componentsSeparatedByString:@"-"] firstObject]; + NSString*end=[[time componentsSeparatedByString:@"-"] lastObject]; + NSString*startHour=[[start componentsSeparatedByString:@":"] firstObject]; + NSString*startMin=[[start componentsSeparatedByString:@":"] lastObject]; + + NSString*endHour=[[end componentsSeparatedByString:@":"] firstObject]; + + NSString*endMin=[[end componentsSeparatedByString:@":"] lastObject]; + [[GWP2PClient sharedClient] setDevicePlanedRecordTimeWithFromHour:startHour.integerValue fromMinute:startMin.integerValue toHour:endHour.integerValue toMinute:endMin.integerValue deviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + if (success) + { + [self.view makeToast:@"设置成功"]; + } + else + { + [self.view makeToast:@"设置失败"]; + } + }]; + + + }else{ + self.recordType=@"0"; + [[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"]; + + [[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeAlarm withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + NSLog(@"data=%@",dataDictionary); + }]; + [[GWP2PClient sharedClient] setDevicePrerecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + [[GWP2PClient sharedClient] setDeviceAlarmRecordTime:3 withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + [[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; + } + [self.tab reloadData]; + } + + @end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback new file mode 100644 index 0000000..3c8ef5c Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback.png new file mode 100644 index 0000000..2e765fe Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback.png differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback@2x.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback@2x.png new file mode 100644 index 0000000..3a1e311 Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback@2x.png differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback@3x.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback@3x.png new file mode 100644 index 0000000..3c8ef5c Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videoback@3x.png differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord.png new file mode 100644 index 0000000..2483687 Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord.png differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord@2x.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord@2x.png new file mode 100644 index 0000000..7edd4d6 Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord@2x.png differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord@3x.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord@3x.png new file mode 100644 index 0000000..cea0376 Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/equipment_iocn_videorecord@3x.png differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon.png new file mode 100644 index 0000000..7b87f9b Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon.png differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon@2x.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon@2x.png new file mode 100644 index 0000000..a32db01 Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon@2x.png differ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon@3x.png b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon@3x.png new file mode 100644 index 0000000..818fe68 Binary files /dev/null and b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/IFISHYooseeImg.bundle/images/playBackIcon@3x.png differ diff --git a/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m index c1870c9..9f2c573 100644 --- a/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m +++ b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m @@ -166,7 +166,7 @@ -(void)onUdpSocket:(AsyncUdpSocket *)sock didNotReceiveDataWithTag:(long)tag dueToError:(NSError *)error{ NSLog(@"dueToError%@",error); - [self postmsg:error.localizedDescription]; + [self postmsg:@"Socket连接失败"]; } diff --git a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m index 0c8a5d1..01f5862 100644 --- a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m +++ b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m @@ -287,7 +287,7 @@ extern BOOL isfromCameraView; [self.view addSubview:_maclabel]; [self.view bringSubviewToFront:_maclabel]; self.bakbutton.userInteractionEnabled=YES; - [self mmPogressHUDdismiss]; + [self connectNormalView]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.view makeToast:@"设备类型不匹配,请重新选择入口绑定"]; diff --git a/Ifish/controllers/logAddRegistController/XWCountryCode/XWCountryCodeController.m b/Ifish/controllers/logAddRegistController/XWCountryCode/XWCountryCodeController.m index 0f9130e..69335a8 100755 --- a/Ifish/controllers/logAddRegistController/XWCountryCode/XWCountryCodeController.m +++ b/Ifish/controllers/logAddRegistController/XWCountryCode/XWCountryCodeController.m @@ -12,11 +12,11 @@ #define CURR_LANG ([[NSLocale preferredLanguages] objectAtIndex:0]) #define LanguageIsEnglish ([CURR_LANG isEqualToString:@"en-US"] || [CURR_LANG isEqualToString:@"en-CA"] || [CURR_LANG isEqualToString:@"en-GB"] || [CURR_LANG isEqualToString:@"en-CN"] || [CURR_LANG isEqualToString:@"en"]) -@interface XWCountryCodeController(){ +@interface XWCountryCodeController(){ //国际代码主tableview UITableView *countryCodeTableView; //搜索 - UISearchDisplayController *searchController; + UISearchController *searchController; // UISearchController *searchController; UISearchBar *searchBar; //代码字典 @@ -53,7 +53,7 @@ -(void)creatSubviews{ searchResultValuesArray = [[NSMutableArray alloc] init]; - countryCodeTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, self.view.bounds.size.width, self.view.bounds.size.height-20) style:UITableViewStylePlain]; + countryCodeTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, self.view.bounds.size.width, self.view.bounds.size.height-40) style:UITableViewStylePlain]; [self.view addSubview:countryCodeTableView]; //自动调整自己的宽度,保证与superView左边和右边的距离不变。 [countryCodeTableView setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; @@ -61,18 +61,15 @@ [countryCodeTableView setDelegate:self]; [countryCodeTableView setSectionIndexBackgroundColor:[UIColor clearColor]]; - searchBar = [[UISearchBar alloc] init]; - [searchBar sizeToFit]; - [searchBar setDelegate:self]; - //关闭系统自动联想和首字母大写功能 - [searchBar setAutocapitalizationType:UITextAutocapitalizationTypeNone]; - [countryCodeTableView setTableHeaderView:searchBar]; - - searchController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self]; - [searchController setDelegate:self]; - searchController.searchResultsDataSource = self; - searchController.searchResultsDelegate = self; + + searchController = [[UISearchController alloc]initWithSearchResultsController:nil]; + [searchController setSearchResultsUpdater:self]; + searchController.dimsBackgroundDuringPresentation=NO; + searchController.definesPresentationContext=NO; + searchController.searchBar.delegate=self; + countryCodeTableView.tableHeaderView=searchController.searchBar; + searchBar=searchController.searchBar; NSString *plistPathCH = [[NSBundle mainBundle] pathForResource:@"sortedChnames" ofType:@"plist"]; NSString *plistPathEN = [[NSBundle mainBundle] pathForResource:@"sortedEnames" ofType:@"plist"]; @@ -91,25 +88,29 @@ } -//搜索 --(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ +-(void)updateSearchResultsForSearchController:(UISearchController *)searchController +{ NSLog(@"%s",__FUNCTION__); [searchResultValuesArray removeAllObjects]; for (NSArray *array in [sortedNameDict allValues]) { for (NSString *value in array) { - if ([value containsString:searchBar.text]) { + if ([value containsString:searchController.searchBar.text]) { [searchResultValuesArray addObject:value]; } } } - [searchController.searchResultsTableView reloadData]; + + + [countryCodeTableView reloadData]; } + + #pragma mark - UITableView //section -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ - if (tableView == countryCodeTableView) { + if (!searchController.isActive) { return [sortedNameDict allKeys].count; }else{ return 1; @@ -117,7 +118,7 @@ } //row -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - if (tableView == countryCodeTableView) { + if (!searchController.isActive) { NSArray *array = [sortedNameDict objectForKey:[indexArray objectAtIndex:section]]; return array.count; @@ -134,7 +135,7 @@ //初始化cell -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ - if (tableView == countryCodeTableView) { + if (!searchController.isActive) { static NSString *ID1 = @"cellIdentifier1"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID1]; if (!cell) { @@ -164,7 +165,7 @@ //indexTitle -(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{ - if (tableView == countryCodeTableView) { + if (!searchController.isActive) { return indexArray; }else{ return nil; @@ -172,7 +173,7 @@ } // -(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index{ - if (tableView == countryCodeTableView) { + if (!searchController.isActive) { return index; }else{ return 0; @@ -181,7 +182,7 @@ - (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - if (tableView == countryCodeTableView) { + if (!searchController.isActive) { if (section == 0) { return 0; } @@ -212,6 +213,9 @@ if (self.returnCountryCodeBlock != nil) { self.returnCountryCodeBlock(cell.textLabel.text); } + if (searchController.isActive) { + [searchController dismissViewControllerAnimated:YES completion:nil]; + } [self dismissViewControllerAnimated:YES completion:nil]; } diff --git a/Ifish/models/ifishUserModel/TemperatureSetModel.h b/Ifish/models/ifishUserModel/TemperatureSetModel.h index 56544c1..96f7339 100644 --- a/Ifish/models/ifishUserModel/TemperatureSetModel.h +++ b/Ifish/models/ifishUserModel/TemperatureSetModel.h @@ -11,5 +11,5 @@ @interface TemperatureSetModel : NSObject @property(nonatomic,copy)NSString*title; @property(nonatomic,copy)NSString*temperatureLabel; -//@property(nonatomic); +@property(nonatomic,copy)NSString*status;//开关状态,新增 @end diff --git a/Ifish/views/mypicView/DatePickerCustomView.h b/Ifish/views/mypicView/DatePickerCustomView.h new file mode 100644 index 0000000..d63e15b --- /dev/null +++ b/Ifish/views/mypicView/DatePickerCustomView.h @@ -0,0 +1,16 @@ +// +// DatePickerCustomView.h +// E-Mobile +// +// Created by Yang on 15/9/18. +// +// + +#import + +@interface DatePickerCustomView : UIView +@property(nonatomic,copy)dispatch_block_t dateChanged; +@property(nonatomic,copy)dispatch_block_t cancelBlock; +@property(nonatomic,strong)UIDatePicker* datePicker; ++(instancetype)showInView:(UIView*)view Mode:(UIDatePickerMode)mode date:(NSDate*)date; +@end diff --git a/Ifish/views/mypicView/DatePickerCustomView.m b/Ifish/views/mypicView/DatePickerCustomView.m new file mode 100644 index 0000000..0c910fe --- /dev/null +++ b/Ifish/views/mypicView/DatePickerCustomView.m @@ -0,0 +1,114 @@ +// +// DatePickerCustomView.m +// E-Mobile +// +// Created by Yang on 15/9/18. +// +// +#import "DatePickerCustomView.h" + +@interface DatePickerCustomView(){ + +} +@property(nonatomic,strong)UIButton* timePickerCancelBtn; +@property(nonatomic,strong)UIView* buttonView; +@end + +@implementation DatePickerCustomView + ++(instancetype)showInView:(UIView*)view Mode:(UIDatePickerMode)mode date:(NSDate*)date +{ + DatePickerCustomView* customView = [[self alloc] initWithFrame:CGRectMake(0, 0, view.frame.size.width, view.frame.size.height)]; + if (customView) { + customView.backgroundColor=RGBA(0, 0, 0, 0.3); + + UIButton* timePickerCancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + customView.timePickerCancelBtn = timePickerCancelBtn; + timePickerCancelBtn.tag = 100; + timePickerCancelBtn.frame = customView.bounds; + [timePickerCancelBtn addTarget:customView action:@selector(datePickerCancelBtnPressed:) forControlEvents:UIControlEventTouchUpInside]; + [customView addSubview:timePickerCancelBtn]; + + UIDatePicker* datePicker = [[UIDatePicker alloc] initWithFrame: CGRectMake(0, customView.frame.size.height+40, customView.frame.size.width, 216)]; + customView.datePicker = datePicker; + [datePicker setLocale:[NSLocale autoupdatingCurrentLocale]]; + [datePicker setDatePickerMode:mode]; + datePicker.backgroundColor=[UIColor whiteColor]; + datePicker.tag = 101; + if (date) { + [datePicker setDate:date]; + } +// [datePicker addTarget:customView action:@selector(datePickerChanged:) forControlEvents:UIControlEventValueChanged]; + [customView addSubview:datePicker]; + + UIView *buttonView = [[UIView alloc] initWithFrame:CGRectMake(0, customView.frame.size.height, customView.frame.size.width, 40)]; + customView.buttonView = buttonView; + buttonView.backgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1]; + [customView addSubview:buttonView]; + + UIButton *cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 40)]; + [cancelBtn addTarget:customView action:@selector(datePickerCancelBtnPressed:) forControlEvents:UIControlEventTouchUpInside]; + [cancelBtn setTitle:NSLocalizedString(@"取消", nil) forState:UIControlStateNormal]; + [cancelBtn setTitle:NSLocalizedString(@"取消", nil) forState:UIControlStateSelected]; + cancelBtn.titleLabel.font = [UIFont systemFontOfSize:15]; + [cancelBtn setTitleColor:[UIColor colorWithRed:21.0/255 green:126.0/255 blue:251.0/255 alpha:1] forState:UIControlStateNormal]; + [cancelBtn setTitleColor:[UIColor colorWithRed:21.0/255 green:126.0/255 blue:251.0/255 alpha:1] forState:UIControlStateSelected]; + [buttonView addSubview:cancelBtn]; + + UIButton *commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(customView.frame.size.width-60, 0, 60, 40)]; + [commitBtn addTarget:customView action:@selector(datePickerCommitBtnPressed:) forControlEvents:UIControlEventTouchUpInside]; + [commitBtn setTitle:NSLocalizedString(@"确定", nil) forState:UIControlStateNormal]; + [commitBtn setTitle:NSLocalizedString(@"确定", nil) forState:UIControlStateSelected]; + commitBtn.titleLabel.font = [UIFont systemFontOfSize:15]; + [commitBtn setTitleColor:[UIColor colorWithRed:21.0/255 green:126.0/255 blue:251.0/255 alpha:1] forState:UIControlStateNormal]; + [commitBtn setTitleColor:[UIColor colorWithRed:21.0/255 green:126.0/255 blue:251.0/255 alpha:1] forState:UIControlStateSelected]; + [buttonView addSubview:commitBtn]; + + [customView showDatePickerInView:view]; + } + return customView; +} + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + /*init code*/ + } + return self; +} + +-(void)datePickerCancelBtnPressed:(UIButton*)btn{ + [UIView animateWithDuration:0.2 animations:^{ + self.datePicker.frame = CGRectMake(0, self.frame.size.height+40, self.frame.size.width, 216); + self.buttonView.frame = CGRectMake(0, self.frame.size.height, self.frame.size.width, 40); + }completion:^(BOOL finished) { + if (self.cancelBlock) { + self.cancelBlock(); + } + [self removeFromSuperview]; + }]; +} + +-(void)datePickerCommitBtnPressed:(UIButton*)btn { + [UIView animateWithDuration:0.2 animations:^{ + self.datePicker.frame = CGRectMake(0, self.frame.size.height+40, self.frame.size.width, 216); + self.buttonView.frame = CGRectMake(0, self.frame.size.height, self.frame.size.width, 40); + }completion:^(BOOL finished) { + self.dateChanged(); + [self removeFromSuperview]; + }]; +} + +-(void)showDatePickerInView:(UIView*)view{ + [view addSubview:self]; + [UIView animateWithDuration:0.2 animations:^{ + self.datePicker.frame = CGRectMake(0, self.frame.size.height-216, self.frame.size.width, 216); + self.buttonView.frame = CGRectMake(0, self.frame.size.height-216-40, self.frame.size.width, 40); + }]; +} + +-(void)datePickerChanged:(id)sender{ + self.dateChanged(); +} +@end