宠物店修改

This commit is contained in:
kai60
2020-05-02 14:56:49 +08:00
parent 8fca79324a
commit 53f06fcf43
100 changed files with 2672 additions and 198 deletions
@@ -124,7 +124,7 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi
[self.view makeToast:@"请先连接设备热点"];
return;
}
if ([wifiName rangeOfString:@"ifish"].location!=NSNotFound||[wifiName rangeOfString:@"GW"].location!=NSNotFound) {
if ([wifiName rangeOfString:@"ifish"].location!=NSNotFound||[wifiName rangeOfString:@"GW"].location!=NSNotFound||[wifiName isEqualToString:@"WLAN"]) {
//wifi正确,则尝试连接设备
if(self.deviceType==DEVICECAMERA)
{
@@ -141,6 +141,7 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi
connecting.bssid = self.bssid;
connecting.wifiName = self.wifiName;
connecting.wifiPassword = self.wifiPwd;
connecting.deviceType=self.deviceType;
[self.navigationController pushViewController:connecting animated:YES];
}
@@ -79,7 +79,7 @@ Strong UILabel *subTitleLabel;
-(void)buttonClick:(UIButton *)sender{
self.hidesBottomBarWhenPushed = YES;
if (sender.tag==0) {
//智能连接
if (self.deviceType==DEVICECAMERA)
{
YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init];
@@ -95,7 +95,7 @@ Strong UILabel *subTitleLabel;
[self.navigationController pushViewController:wifivc animated:YES];
}
//热点链接
}else{
ConAquarNowWiFiPwdVC *vc = InitObject(ConAquarNowWiFiPwdVC);
vc.deviceType=self.deviceType;
@@ -7,6 +7,8 @@
//
#import "BaseViewController.h"
#import "StoreNameView.h"
#import "DXPopover.h"
NS_ASSUME_NONNULL_BEGIN
@@ -20,6 +22,9 @@ Copy NSString *ssid;
Copy NSString *bssid;
//界面复用 设备类型
@property (assign, nonatomic) SmartDeviceType deviceType;
@property (nonatomic, strong) UIView *mask;
@property (nonatomic, strong) StoreNameView *storeNameView;
@property (nonatomic, strong) NSString *storeName;
@end
NS_ASSUME_NONNULL_END
@@ -14,6 +14,7 @@
#import "ESPTouchResult.h"
#import "ESPTouchTask.h"
#import "IfishDataUnity.h"
#import "MyMD5.h"
#import <GWP2P/GWP2P.h>
@interface ConnectingAquarVC ()<IFishHotpotUDPHelperDelegate>
Strong HKPieChartView *progressView;
@@ -67,6 +68,7 @@ Copy NSString *deviceId;
// // Do any additional setup after loading the view.
self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
[self showStoreNameView];
}
//AP模式配网
@@ -263,7 +265,7 @@ Copy NSString *deviceId;
BOOL networkOk = NO;
AFNetworkReachabilityStatus status = [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus;
if (status == AFNetworkReachabilityStatusReachableViaWiFi) {
if (status == AFNetworkReachabilityStatusReachableViaWiFi||status == AFNetworkReachabilityStatusUnknown) {
if (![[self currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) {
networkOk = YES;
}
@@ -285,9 +287,20 @@ Copy NSString *deviceId;
self.bindTimer = nil;
}
self.retryTimes = 0;
[self bindDeviceWithSsid:self.macAddress];
if (self.deviceType==DEVICEPETS)
{
[self showStoreNameView];
}
else
{
[self bindDeviceWithSsid:self.macAddress];
}
}
- (void)udpHelperMessage:(NSString *)msg {
self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
self.HUD.mode = MBProgressHUDModeIndeterminate;
@@ -298,6 +311,55 @@ Copy NSString *deviceId;
[self.timer invalidate];
self.timer = nil;
}
-(UIView *)mask
{
if (!_mask)
{
UIView*mask=[[UIView alloc]initWithFrame:self.view.bounds];
mask.backgroundColor=[UIColor lightGrayColor];
mask.alpha=0.5;
_mask=mask;
UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissStore)];
[mask addGestureRecognizer:tap];
}
return _mask;
}
-(void)dismissStore
{
[self.storeNameView removeFromSuperview];
[self.mask removeFromSuperview];
[self.progressView endProgressWithString:@"绑定已经取消..."];
}
-(void)showStoreNameView
{
[self.HUD hide:YES];
[self.storeNameView removeFromSuperview];
StoreNameView*store=[[[NSBundle mainBundle] loadNibNamed:@"StoreNameView" owner:self options:nil] lastObject];
store.frame=CGRectMake((SCREEN_WIDTH-280)/2.0, 100, 280, 280);
self.storeNameView=store;
WEAK_SELF;
store.cancelBlock=^(){
[weakSelf.mask removeFromSuperview];
[weakSelf.storeNameView removeFromSuperview];
[weakSelf.HUD show:YES];
[weakSelf.progressView endProgressWithString:@"绑定已经取消..."];
};
store.sureBlock=^(NSString*name)
{
[weakSelf.mask removeFromSuperview];
[weakSelf.storeNameView removeFromSuperview];
weakSelf.storeName=name;
[self bindDeviceWithSsid:self.macAddress];
[weakSelf.HUD show:YES];
};
[self.view addSubview:self.mask];
[self.view addSubview:self.storeNameView];
}
#pragma mark - bind
-(void)bindDeviceWithSsid:(NSString*)bssid{
NSLog(@"设备bssid_%@",bssid);
@@ -306,7 +368,21 @@ Copy NSString *deviceId;
self.HUD.labelText = @"正在绑定设备";
[self appendTrakContent:[NSString stringWithFormat:@"绑定参数 userID:%@", userId]];
[self appendTrakContent:[NSString stringWithFormat:@"绑定参数 macaddress:%@", bssid]];
[AFHttpTool bindDeviceWithUserId:userId macAddress:bssid success:^(id response) {
NSString*url=[NSString stringWithFormat:@"%@%@",kBindDevice,userId];
NSMutableDictionary*bind=[[NSMutableDictionary alloc]initWithDictionary:@{@"macAddress":bssid}];
NSString* timestamp=[NSString stringWithFormat:@"%lld",[[NSDate date] timeIntervalSince1970]*1000];
NSString*token=[MyMD5 md5:[NSString stringWithFormat:@"%@%@ifish8",userId,timestamp]];
if (self.deviceType==DEVICEPETS)
{
url=[NSString stringWithFormat:@"%@",[NSString stringWithFormat:@"%@/api/user/bindPetDevice.do",JIEKOUPORT]];
bind[@"token"]=token;
bind[@"timestamp"]=timestamp;
bind[@"storeName"]=self.storeName.length?self.storeName:@"宠物店";
bind[@"userId"]=userId;
}
[AFHttpTool requestWihtMethod:RequestMethodTypePost url:url params:bind success:^(id response) {
[self endProgress];
self.isBindingDevice = NO;
self.macAddress = nil;
@@ -10,5 +10,6 @@
@interface RuSunChangeNameTitleViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UITextField *deviceName;
@property (weak, nonatomic) IBOutlet UILabel *cNTitle;
@end
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -27,7 +26,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="水族箱" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dae-FO-MMJ">
<rect key="frame" x="58" y="14" width="54" height="21"/>
<rect key="frame" x="58" y="14.5" width="54" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="avD-IG-wRe"/>
<constraint firstAttribute="width" constant="54" id="ex7-wD-xWL"/>
@@ -37,7 +36,7 @@
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="我的水族箱" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="cgK-Ks-2s1">
<rect key="frame" x="173" y="0.0" width="122" height="50"/>
<rect key="frame" x="173" y="-0.5" width="122" height="50.5"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="2zD-xY-XTZ"/>
</constraints>
@@ -57,6 +56,7 @@
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="cNTitle" destination="Dae-FO-MMJ" id="U2e-nu-70l"/>
<outlet property="deviceName" destination="cgK-Ks-2s1" id="n3G-VN-O4U"/>
</connections>
</tableViewCell>
@@ -559,8 +559,12 @@ typedef NS_ENUM(NSInteger,ThreeControBackMsgTape){
[DeviceCommunicateDataUnity resetThreeControlButtonState:_light1Button addlight2:_light2Button addpump:_pumpButton withBackModel:_backmodel];
// 实时刷新设置界面 时间设置
_SetTimeVC.timeArr=[DeviceCommunicateDataUnity refreshThreeControlTimerAddTemperatureWithBackMassageModel:_backmodel];
[_SetTimeVC.tableView reloadData];
if (_SetTimeVC)
{
_SetTimeVC.timeArr=[DeviceCommunicateDataUnity refreshThreeControlTimerAddTemperatureWithBackMassageModel:_backmodel];
[_SetTimeVC.tableView reloadData];
}
}
@@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
@interface XuToControlName : NSObject
@interface XuToControlName : NSObject<NSCoding>
@property(nonatomic,copy) NSString *airPump;
@property(nonatomic,copy) NSString *light1;
@property(nonatomic,copy) NSString *light2;
@@ -21,6 +21,8 @@
@property(nonatomic,copy) NSString *zengyangPump;
@property(nonatomic,copy) NSString *zaolangPump;
@property(nonatomic,copy) NSString *xunhuanPump;
@property(nonatomic,copy) NSString *type;
@@ -24,6 +24,7 @@
[aCoder encodeObject:_zengyangPump forKey:@"zengyangPump"];
[aCoder encodeObject:_zaolangPump forKey:@"zaolangPump"];
[aCoder encodeObject:_xunhuanPump forKey:@"xunhuanPump"];
[aCoder encodeObject:_type forKey:@"type"];
}
@@ -43,6 +44,7 @@
self.zengyangPump = [aDecoder decodeObjectForKey:@"zengyangPump"];
self.zaolangPump = [aDecoder decodeObjectForKey:@"zaolangPump"];
self.xunhuanPump = [aDecoder decodeObjectForKey:@"xunhuanPump"];
self.type = [aDecoder decodeObjectForKey:@"type"];
}
return self;
@@ -7,9 +7,12 @@
//
#import "IfishDeviceControlNameBaseController.h"
#import "IfishDeviceInfo.h"
#import "DeviceModel.h"
@interface XuToControlNameViewController : IfishDeviceControlNameBaseController
@property (nonatomic,assign) BOOL isNewdevice;
@end
@@ -10,6 +10,7 @@
#import "XuToControlName.h"
#import "UserExtendataArchaver.h"
#import "RuSunChangeNameTextViewCell.h"
#import "RuSunChangeNameTitleViewCell.h"
#define XUTOCHCELL_AIR 50000
#define XUTOCHCELL_LIANGHT1 50001
#define XUTOCHCELL_LIANGHT2 50002
@@ -36,14 +37,28 @@
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
NSInteger count=0;
if (section==0) {
return 1;
count=1;
}else{
return _isNewdevice?8:6;
if (self.isNewdevice)
{
count=8;
if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) {
count=4;
}
}
else
{
count=6;
}
}
return count;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
@@ -55,7 +70,11 @@
if (indexPath.section==0) {
return [super baseViewLoadDeviceNameCell:indexPath intable:tableView];
RuSunChangeNameTitleViewCell*cell= (RuSunChangeNameTitleViewCell*)[super baseViewLoadDeviceNameCell:indexPath intable:tableView];
if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) {
cell.cNTitle.text=@"宠物笼";
}
return cell;
}
RuSunChangeNameTextViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"RuSunChangeNameTextViewCell"];
@@ -72,6 +91,9 @@
NSArray *titles;
if (_isNewdevice) {
titles = @[@"杀菌灯",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"护理灯",@"循环泵",@"加热棒"];
if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) {
titles = @[@"照明",@"换气",@"杀菌",@"恒温"];
}
}else {
titles = @[@"气泵",@"灯1",@"灯2",@"护理灯",@"水泵",@"加热棒"];
}
@@ -83,6 +105,9 @@
XuToControlName *name;
if (_isNewdevice) {
name = [UserExtendataArchaver currentNewXuToControlName:self.device.macAddress];
if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) {
name = [UserExtendataArchaver currentPetsXuToControlName:self.device.macAddress];
}
}else {
name = [UserExtendataArchaver currentXuToControlName:self.device.macAddress];
}
@@ -92,6 +117,9 @@
if ((cell.chName.text.length>0) & ![cell.chName.text isEqualToString:@"控制名"] & ![cell.chName.text isEqualToString:name.shajunLight]) {
}else {
cell.chName.text = name.shajunLight;
if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) {
cell.chName.text = name.xunhuanPump;
}
}
}else {
cell.chName.text = name.airPump;
@@ -157,6 +185,95 @@
//RunSunCHNameCustom 本地处理 保存按钮名称 不与服务器交互
XuToControlName *name = [[XuToControlName alloc] init];
if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
name=[UserExtendataArchaver currentXuToControlName:self.device.macAddress];
for (RuSunChangeNameTextViewCell*cell in [self.tableView visibleCells]) {
if (![cell isKindOfClass:[RuSunChangeNameTextViewCell class]]) {
continue;
}
if ([cell.chTitle.text isEqualToString:@"照明"]) {
if (cell.chName.text.length>3)
{
[self.view makeToast:@"照明不能超过3个字"];
return;
}
else if (cell.chName.text.length==0)
{
[self.view makeToast:@"照明不能为空"];
return;
}
else
{
name.xunhuanPump=cell.chName.text;
}
}
else if ([cell.chTitle.text isEqualToString:@"换气"]) {
if (cell.chName.text.length>3)
{
[self.view makeToast:@"换气不能超过3个字"];
return;
}
else if (cell.chName.text.length==0)
{
[self.view makeToast:@"换气不能为空"];
return;
}
else
{
name.zengyangPump=cell.chName.text;
}
}
else if ([cell.chTitle.text isEqualToString:@"杀菌"]) {
if (cell.chName.text.length>3)
{
[self.view makeToast:@"杀菌不能超过3个字"];
return;
}
else if (cell.chName.text.length==0)
{
[self.view makeToast:@"杀菌不能为空"];
return;
}
else
{
name.light1=cell.chName.text;
}
}
else if ([cell.chTitle.text isEqualToString:@"恒温"]) {
if (cell.chName.text.length>3)
{
[self.view makeToast:@"恒温不能超过3个字"];
return;
}
else if (cell.chName.text.length==0)
{
[self.view makeToast:@"恒温不能为空"];
return;
}
else
{
name.light2=cell.chName.text;
}
}
}
[UserExtendataArchaver saveNewXuToControlName:name];
[self upLoadDeviceName];
return;
}
RuSunChangeNameTextViewCell*cell1 = [self.view viewWithTag:XUTOCHCELL_AIR];
if (cell1.chName.text.length>3) {
if (_isNewdevice) {
@@ -849,7 +849,8 @@ Strong XuToControlName *xutoName;//水族箱内各种名字
NSLog(@"ni hua dong tai kuai");
str=[NSString stringWithFormat:@"%ld",(long)self.waterInfmodel.remindcycle];
[_remindPic makeToast:@"请设置换水天数"];
NSString*title=@"请设置换水天数";
[_remindPic makeToast:title];
return;
}
@@ -9,16 +9,18 @@
#import <Foundation/Foundation.h>
#import "Xuanduo2Model.h"
#import "Xuanduo2TimerModel.h"
#import "IfishDeviceInfo.h"
#import "xuanduo3fModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface Xuanduo2DataUtility : NSObject
+(void)readSocketDataWithBackMsgModel:(Xuanduo2Model*)xuanduoModel addWithBackData:(NSData*)data;
+(void)readSocketDataWithBackMsgModel:(id)xuanduoModel addWithBackData:(NSData*)data type:(NSString*)type;
+(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr;
+(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr type:(NSString*)type;
+(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(Xuanduo2Model*)backModel;
+(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(id)backModel type:(NSString*)type;
@end
NS_ASSUME_NONNULL_END
@@ -8,11 +8,17 @@
#import "Xuanduo2DataUtility.h"
@implementation Xuanduo2DataUtility
+(void)readSocketDataWithBackMsgModel:(Xuanduo2Model*)xuanduoModel addWithBackData:(NSData*)data{
+(void)readSocketDataWithBackMsgModel:(id)model addWithBackData:(NSData*)data type:(nonnull NSString *)type{
NSString *dataString = [dataContorl dataToHexString:data];// 转十六进制
@try {
if ([type isEqualToString:DECICE_TYPE_XUANDUO2F]&&[model isKindOfClass:[Xuanduo2Model class]])
{
Xuanduo2Model*xuanduoModel=model;
xuanduoModel.gasPump = [dataString substringWithRange:NSMakeRange(30, 4)];
xuanduoModel.light1 = [dataString substringWithRange:NSMakeRange(34, 4)];
xuanduoModel.light2 = [dataString substringWithRange:NSMakeRange(38, 4)];
@@ -28,6 +34,23 @@
xuanduoModel.alarmSwitch = [dataString substringWithRange:NSMakeRange(74, 2)];
xuanduoModel.miniTemp = [dataString substringWithRange:NSMakeRange(76, 4)];
xuanduoModel.maxTemp = [dataString substringWithRange:NSMakeRange(80, 4)];
}
else if ([type isEqualToString:DECICE_TYPE_XUANDUO3F]&&[model isKindOfClass:[Xuanduo3fModel class]])
{
Xuanduo3fModel*xuanduoModel=model;
xuanduoModel.light = [dataString substringWithRange:NSMakeRange(30, 4)];
xuanduoModel.gasPump = [dataString substringWithRange:NSMakeRange(34, 4)];
xuanduoModel.uvLamp = [dataString substringWithRange:NSMakeRange(38, 4)];
xuanduoModel.constTmep = [dataString substringWithRange:NSMakeRange(42, 4)];
xuanduoModel.temperature = [dataString substringWithRange:NSMakeRange(46, 4)];
xuanduoModel.heatingTemperature = [dataString substringWithRange:NSMakeRange(50, 4)];
xuanduoModel.vuPHstatus = [dataString substringWithRange:NSMakeRange(54, 4)];
xuanduoModel.alarmSwitch = [dataString substringWithRange:NSMakeRange(58, 2)];
xuanduoModel.miniTemp = [dataString substringWithRange:NSMakeRange(60, 4)];
xuanduoModel.maxTemp = [dataString substringWithRange:NSMakeRange(64, 4)];
}
} @catch (NSException *exception) {
} @finally {
@@ -36,7 +59,12 @@
}
+(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(Xuanduo2Model*)backModel{
+(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(Xuanduo2Model*)model type:(nonnull NSString *)type{
if ([type isEqualToString:DECICE_TYPE_XUANDUO2F])
{
Xuanduo2Model*backModel=model;
// 杀菌灯
NSString *stateString1 = [backModel.uvLamp substringWithRange:NSMakeRange(2, 2)];
if ([stateString1 isEqualToString:@"01"]) {
@@ -91,9 +119,46 @@
}else{
heatLightBtn.selected = NO;
}
}
else if ([type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
// 杀菌
Xuanduo3fModel*backModel=model;
NSString *stateString1 = [backModel.uvLamp substringWithRange:NSMakeRange(2, 2)];
if ([stateString1 isEqualToString:@"01"]) {
light1Btn.selected = YES;
}else{
light1Btn.selected = NO;
}
// 换气
NSString *stateString2 = [backModel.gasPump substringWithRange:NSMakeRange(2, 2)];
if ([stateString2 isEqualToString:@"01"]) {
gasLightBtn.selected = YES;
}else{
gasLightBtn.selected = NO;
}
// 灯
NSString *stateString3 = [backModel.light substringWithRange:NSMakeRange(2, 2)];
if ([stateString3 isEqualToString:@"01"]) {
waterLightBtn.selected = YES;
}else{
waterLightBtn.selected = NO;
}
// 恒温
NSString *stateString4 = [backModel.constTmep substringWithRange:NSMakeRange(2, 2)];
if ([stateString4 isEqualToString:@"01"]) {
light2Btn.selected = YES;
}else{
light2Btn.selected = NO;
}
}
}
+(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr {
+(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr type:(nonnull NSString *)type{
xuanduoTimerModel.lightNumber = [dataStr substringWithRange:NSMakeRange(30, 2)];
xuanduoTimerModel.groupSum = [dataStr substringWithRange:NSMakeRange(32, 2)];
UInt64 sum = [dataContorl hexToTen:xuanduoTimerModel.groupSum];
@@ -7,6 +7,8 @@
//
#import "FatherController.h"
#import "IfishDeviceInfo.h"
#include "xuanduo3fModel.h"
NS_ASSUME_NONNULL_BEGIN
@@ -15,10 +17,10 @@ NS_ASSUME_NONNULL_BEGIN
@interface Xuanduo2SettingController : FatherController
@property (nonatomic,strong) UIActivityIndicatorView*indicatorView;
@property (nonatomic ,strong) Xuanduo2Model *dataModel;
@property (nonatomic ,strong) id dataModel;
@property(nonatomic,strong) DeviceModel* currentdevice;
- (void)refreshWithData:(Xuanduo2Model *)model;
- (void)refreshWithData:(id)model;
@end
@@ -24,6 +24,8 @@
#import "ReadTimerModel.h"
#import "Xuanduo2DataUtility.h"
#import "Xuanduo2TimerModel.h"
#import "IfishDeviceInfo.h"
#import "NSString+Add.h"
#define kBtnTag 500
#define kSwitchBtnTag 600
@@ -54,6 +56,7 @@ static NSString *setTimerflag = @"SetTimerCell";
BOOL _huanShuiSwitchIsOn;
NSInteger _selectSection;
MydatePickerView*_mydatepicView;
}
- (void)viewWillAppear:(BOOL)animated {
@@ -86,14 +89,25 @@ static NSString *setTimerflag = @"SetTimerCell";
- (void)setup {
[self.navigationController.navigationBar resetBackgroundImage];
[self addTitleViewWithTitle:@"水族箱设置"];
NSString*title=@"水族箱设置";
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
title = @"水族箱设置";
}
else if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
title = @"宠物笼设置";
}
[self addTitleViewWithTitle:title];
[self refreshWithData:self.dataModel];
[self setupTable];
[self creatIndicatorView];
[Socketsingleton sharedInstance].communiteDelegate = self;
}
- (void)refreshWithData:(Xuanduo2Model *)model {
- (void)refreshWithData:(Xuanduo3fModel*)model {
NSString*low = model.miniTemp;
NSString*heigh = model.maxTemp;
UInt64 lowten = [dataContorl hexToTen:low];
@@ -106,6 +120,14 @@ static NSString *setTimerflag = @"SetTimerCell";
- (void)setupTable {
_titieArr = @[@"循环泵",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"杀菌灯"];
_imgArr = @[@"xunhuan_big",@"gas_big",@"light_big",@"light_big",@"wave_big",@"shajun_big"];
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
_titieArr = @[@"照明",@"换气",@"杀菌"];
_imgArr = @[@"照明开",@"换气开",@"杀菌开"];
}
_selectSection = -1;
for (int i = 0; i<_titieArr.count; i++) {
NSMutableArray *dataArr = [NSMutableArray arrayWithCapacity:0];
@@ -123,7 +145,7 @@ static NSString *setTimerflag = @"SetTimerCell";
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2 + self.timeDic.allKeys.count;
return 2 + self.timeDic.allKeys.count+([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]?1:0);
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
@@ -136,6 +158,13 @@ static NSString *setTimerflag = @"SetTimerCell";
NSArray *dataArr = [self.timeDic objectForKey:_titieArr[section-2]];
return dataArr.count;
}
else
{
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
return 1;
}
}
return 0;
}
@@ -150,7 +179,8 @@ static NSString *setTimerflag = @"SetTimerCell";
cell.temperaturelabel.text = model.temperatureLabel;
[cell.temPSwitch addTarget:self action:@selector(xuTotempSwitchAction:) forControlEvents:UIControlEventTouchUpInside];
if (self.dataModel) {
if ([self.dataModel.alarmSwitch isEqualToString:@"01"]) {
Xuanduo2Model*model=self.dataModel;
if ([model.alarmSwitch isEqualToString:@"01"]) {
[cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateNormal];
cell.temPSwitch.selected = NO;
@@ -185,6 +215,11 @@ static NSString *setTimerflag = @"SetTimerCell";
if (self.waterInfmodel.remindcycle == 0) {
//在未获取换水信息时暂时显示
cell.huanshuiDaylabel.text=@"换水时间";
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
cell.huanshuiDaylabel.text=@"杀菌时间";
cell.titleLabel.text=@"杀菌提醒";
}
}else{
cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%ld天",(long)self.waterInfmodel.remindcycle];
@@ -210,19 +245,55 @@ static NSString *setTimerflag = @"SetTimerCell";
if (!self.waterInfmodel.remindDate) {
cell.textLabel.text=[NSString stringWithFormat:@"下次换水时间:%@",self.nextChangeDateLabel];
}
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
cell.textLabel.text=[NSString stringWithFormat:@"下次杀菌时间:%@",self.waterInfmodel.remindDate];
if (!self.waterInfmodel.remindDate) {
cell.textLabel.text=[NSString stringWithFormat:@"下次杀菌时间:%@",self.nextChangeDateLabel];
}
}
cell.textLabel.font=[UIFont systemFontOfSize:15];
[cell.textLabel sizeToFit];
cell.textLabel.textColor =[UIColor colorWithRed:146.0/256.0 green:146.0/256.0 blue:146.0/256.0 alpha:1];
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"secondSetCell"]];
}else{
}
else{
cell.textLabel.text=@"";
}
cell.userInteractionEnabled = NO;
return cell;
}else {
}else if(indexPath.section -2== _titieArr.count && indexPath.row == 0&&[self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]){
TemperatureSetCell *cell = [tableView dequeueReusableCellWithIdentifier:temperatureCellid];
TemperatureSetModel *model=[[TemperatureSetModel alloc]init];
model.title = @"恒温设置";
cell.titleLabel.text = model.title;
NSLog(@"wendu str = %@",_wenduString);
model.temperatureLabel = _wenduString;
cell.temPSwitch.hidden=YES;
cell.temperaturelabel.frame=cell.temPSwitch.frame;
Xuanduo3fModel*model3=self.dataModel;
int mac=[dataContorl hexToTen:model3.temperature];
//float TPlabel=mac/10+(mac%10)*0.1;
float temp = mac/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp];
cell.temperaturelabel.textAlignment=NSTextAlignmentRight;
[cell.temperaturelabel setAttributedText:[NSString ls_changeFontAndColor:[UIFont systemFontOfSize:15] Color:nil TotalString:stringTemp SubStringArray:@[@""]]];
return cell;
}
else {
if (indexPath.section - 2 < _titieArr.count && _selectSection == indexPath.section) {
NSArray *dataArr = [self.timeDic objectForKey:_titieArr[indexPath.section-2]];
BOOL havePlus = [dataArr containsObject:plusflag];
@@ -272,6 +343,10 @@ static NSString *setTimerflag = @"SetTimerCell";
return 0;
}
}
else if(indexPath.section - 2 ==_titieArr.count&&[self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
return 50;
}
return 0;
}
@@ -281,13 +356,14 @@ static NSString *setTimerflag = @"SetTimerCell";
if (section == 0) {
return 5;
}else if (section == 2){
return 80;
return 40;
}else if (section == 3){
return 40;
}else if (section == 4){
return 40;
}else if (section == 5){
return 40;
return [self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]?0:40;
}else if (section == 6){
return 40;
}else if (section == 7){
@@ -304,14 +380,14 @@ static NSString *setTimerflag = @"SetTimerCell";
oneHeader.backgroundColor = COLOR_MIAN;
return oneHeader;
}else if(section == 2){
XuanduoSectionHeaderView *section1HeaderView = [XuanduoSectionHeaderView shareHeaderView];
section1HeaderView.arrowBtn.tag = kBtnTag + section;
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
headerView.controlBtn.tag = kBtnTag + section;
if (_selectSection == section) {
section1HeaderView.arrowBtn.selected = YES;
headerView.controlBtn.selected = YES;
}
section1HeaderView.titleLabel.text = _titieArr[section-2];
[section1HeaderView.arrowBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
return section1HeaderView;
[headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
return headerView;
}else if(section == 3){
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
headerView.controlBtn.tag = kBtnTag + section;
@@ -331,14 +407,24 @@ static NSString *setTimerflag = @"SetTimerCell";
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
return headerView;
}else if(section == 5){
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
headerView.controlBtn.tag = kBtnTag + section;
if (_selectSection == section) {
headerView.controlBtn.selected = YES;
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
UIView *oneHeader = [[UIView alloc] init];
oneHeader.backgroundColor = COLOR_MIAN;
return oneHeader;
}
[headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
return headerView;
else
{
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
headerView.controlBtn.tag = kBtnTag + section;
if (_selectSection == section) {
headerView.controlBtn.selected = YES;
}
[headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside];
[headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]];
return headerView;
}
}else if(section == 6){
XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView];
headerView.controlBtn.tag = kBtnTag + section;
@@ -378,6 +464,16 @@ static NSString *setTimerflag = @"SetTimerCell";
//换水提醒日期选择
_remindPic=[[remindCyclePic alloc]init];
_remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height);
_remindPic.type=self.currentdevice.type;
[self.view.window addSubview:_remindPic];
[_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside];
[self huanShuiMainQueue];
}else if(indexPath.section-2==_titieArr.count){
//恒温设置
_remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:@"temp"];
_remindPic.type=@"temp";
_remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height);
[self.view.window addSubview:_remindPic];
[_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside];
@@ -438,14 +534,26 @@ static NSString *setTimerflag = @"SetTimerCell";
readModel.resavemacId = self.currentdevice.macAddress;
readModel.crc16str=@"0000";
switch (_selectSection - 2) {
case 0: //循环泵
case 0: //循环泵 或 照明
readModel.selectorNumber = @"04";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
readModel.selectorNumber=@"01";
}
break;
case 1: //增氧
readModel.selectorNumber = @"01";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
readModel.selectorNumber=@"02";
}
break;
case 2: //灯光1
readModel.selectorNumber = @"02";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
readModel.selectorNumber=@"03";
}
break;
case 3: //灯光2
readModel.selectorNumber = @"03";
@@ -494,16 +602,32 @@ static NSString *setTimerflag = @"SetTimerCell";
case 0: //循环泵
{
timerModel.selectorNumber = @"04";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"01";
}
}
break;
case 1: //增氧
{
timerModel.selectorNumber = @"01";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"02";
}
}
break;
case 2: //灯光1
{
timerModel.selectorNumber = @"02";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"03";
}
}
break;
case 3: //灯光2
@@ -648,16 +772,32 @@ static NSString *setTimerflag = @"SetTimerCell";
case 0: //循环泵
{
timerModel.selectorNumber = @"04";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"01";
}
}
break;
case 1: //增氧
{
timerModel.selectorNumber = @"01";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"02";
}
}
break;
case 2: //灯光1
{
timerModel.selectorNumber = @"02";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"03";
}
}
break;
case 3: //灯光2
@@ -724,16 +864,28 @@ static NSString *setTimerflag = @"SetTimerCell";
case 0: //循环泵
{
timerModel.selectorNumber = @"04";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"01";
}
}
break;
case 1: //增氧
{
timerModel.selectorNumber = @"01";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"02";
}
}
break;
case 2: //灯光1
{
timerModel.selectorNumber = @"02";
if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
timerModel.selectorNumber=@"03";
}
}
break;
case 3: //灯光2
@@ -901,7 +1053,23 @@ static NSString *setTimerflag = @"SetTimerCell";
#pragma mark 默认换水时间
-(void)huanShuiMainQueue{
if (_remindPic.picViewResultString !=nil || (_remindPic.picViewResultString ==nil && self.waterInfmodel.remindcycle !=0 )) {
if (_indexPath.section-2==_titieArr.count)
{
Xuanduo3fModel*model3=self.dataModel;
int mac=[dataContorl hexToTen:model3.temperature];
//float TPlabel=mac/10+(mac%10)*0.1;
NSInteger temp = mac/10.0;
if (temp<1)
{
temp=1;
}
[_remindPic.pic selectRow:temp-1 inComponent:0 animated:NO];
return;
}
else if (_remindPic.picViewResultString !=nil || (_remindPic.picViewResultString ==nil && self.waterInfmodel.remindcycle !=0 )) {
NSArray*shijianArr=[_remindPic.picArr objectAtIndex:0];
NSLog(@"a");
for (NSInteger k=0; k<shijianArr.count; k++) {
@@ -944,14 +1112,19 @@ static NSString *setTimerflag = @"SetTimerCell";
NSLog(@"ni hua dong tai kuai");
str=[NSString stringWithFormat:@"%ld",(long)self.waterInfmodel.remindcycle];
[_remindPic makeToast:@"请设置换水天数"];
NSString*title=@"请设置换水天数";
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
title=@"请设置杀菌天数";
}
[_remindPic makeToast:title];
return;
}
cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%@天",str];
//设置换水日期
[IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId
[IFISHHTTPTOOL setRemindWaterInfWith:[NSString stringWithFormat:@"%@_%@",self.currentdevice.deviceId,self.currentdevice.type]
waterRemind:@"1" remindCycle:str
huishuiShiJian:^(setRemindWaterModel *remindModel) {
@@ -967,6 +1140,49 @@ static NSString *setTimerflag = @"SetTimerCell";
[_remindPic removeFromSuperview];
}
else if (_indexPath.section-2==_titieArr.count)
{
TemperatureSetCell*cell=[self.tableView cellForRowAtIndexPath:_indexPath];
NSString *str=_remindPic.picViewResultString;
if (str==nil) {
//str=@"1";
NSLog(@"ni hua dong tai kuai");
str=[NSString stringWithFormat:@"%ld",(long)self.waterInfmodel.remindcycle];
NSString*title=@"请设置换水天数";
if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
title=@"请设置杀菌天数";
}
[_remindPic makeToast:title];
return;
}
cell.temperaturelabel.text=[NSString stringWithFormat:@"%.1f℃",str.floatValue];
//设置换水日期
;
[_remindPic removeFromSuperview];
baseModel*tempModel=[[baseModel alloc]init];
tempModel.sendmacId =self.currentdevice.macAddress;
tempModel.resavemacId =self.currentdevice.macAddress;
tempModel.functionCode=@"0E";
tempModel.massagelegth=@"13";
int intString = [str intValue];
int newIntString=intString*10;
NSString*temp =[dataContorl tpIntStringToFourHex:newIntString];
NSString*minString=[NSString stringWithFormat:@"%@%@%%@",tempModel.description,temp,@"0000"];
NSLog(@"minstring = %@",minString);
NSData*tempData=[dataContorl stringToHexData:minString];
[[Socketsingleton sharedInstance] soketWriteData:tempData];
}
}
@@ -1028,7 +1244,7 @@ static NSString *setTimerflag = @"SetTimerCell";
if (huanShuiSwitch.selected ==YES) {
//开
huanShuiSwitch.selected =NO;
[IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId
[IFISHHTTPTOOL setRemindWaterInfWith:[NSString stringWithFormat:@"%@_%@",self.currentdevice.deviceId,self.currentdevice.type]
waterRemind:@"1" remindCycle:picResult
huishuiShiJian:^(setRemindWaterModel *remindModel) {
self.nextChangeDateLabel=remindModel.remindDate;
@@ -1042,7 +1258,7 @@ static NSString *setTimerflag = @"SetTimerCell";
}else{
//关
huanShuiSwitch.selected =YES;
[IFISHHTTPTOOL setRemindWaterInfWith:self.currentdevice.deviceId
[IFISHHTTPTOOL setRemindWaterInfWith:[NSString stringWithFormat:@"%@_%@",self.currentdevice.deviceId,self.currentdevice.type]
waterRemind:@"0" remindCycle:picResult
huishuiShiJian:^(setRemindWaterModel *remindModel) {
@@ -1159,7 +1375,7 @@ static NSString *setTimerflag = @"SetTimerCell";
}else {
[_timerModel.groupModelArr removeAllObjects];
}
[Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1];
[Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1 type:self.currentdevice.type];
NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection-2]];
[dataArr removeAllObjects];
[dataArr addObject:plusflag];
@@ -1177,7 +1393,7 @@ static NSString *setTimerflag = @"SetTimerCell";
[self.tableView reloadData];
}
if ([readTimer isEqualToString:@"0108"] || [readTimer isEqualToString:@"0105"]) {
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data];
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentdevice.type];
[self refreshWithData:self.dataModel];
[self.XuTohud hidmyHud];
[self.indicatorView stopAnimating];
@@ -7,11 +7,15 @@
//
#import "WhiteNavBaseViewController.h"
#import "IfishP2PMonitorController.h"
NS_ASSUME_NONNULL_BEGIN
@interface Xuanduo2fController : WhiteNavBaseViewController
@property(nonatomic,strong) DeviceModel* currentDevice;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *waterLightTop;
@property (weak, nonatomic) IBOutlet UIButton *controlBtn;
@property (weak, nonatomic) IBOutlet UIButton *cameraBtn;
@end
@@ -26,6 +26,7 @@
#import "JHRefreshAmazingAniView.h"
#import "JHRefresh.h"
#import "searchDeviceModel.h"
#import "PetStoresViewController.h"
#define kBtnTag 100
@@ -42,7 +43,7 @@
@property (weak, nonatomic) IBOutlet UILabel *jiareLabel;
@property (weak, nonatomic) IBOutlet UIButton *brandBtn;
@property (weak, nonatomic) IBOutlet UILabel *brandName;
@property (nonatomic ,strong) Xuanduo2Model *dataModel;
@property (nonatomic ,strong) Xuanduo2Model* dataModel;
@property (weak, nonatomic) IBOutlet UILabel *tempLabel;
@property (weak, nonatomic) IBOutlet UILabel *tipLabel;
@property (nonatomic, strong) NSTimer *switchTimer;
@@ -79,6 +80,7 @@
[super viewDidLoad];
[self setup];
[self connect];
// Do any additional setup after loading the view from its nib.
}
@@ -96,11 +98,52 @@
//
[_brandBtn sd_setBackgroundImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetLogUrl,self.currentDevice.logo]] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"brandLogo_hold"]];
_brandName.text = self.currentDevice.brandName;
self.dataModel=nil;
[self initCHNames];
[Socketsingleton sharedInstance].communiteDelegate = self;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tempSwitch)];
// [self.tempLabel addGestureRecognizer:tap];
[self creatRefreshView];
//
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
self.imageView.image=[UIImage imageNamed:@"pet"];
self.waterLightTop.constant=55;
//
[self.waterLight setBackgroundImage:[UIImage imageNamed:@"照明关"] forState:UIControlStateNormal];
[self.waterLight setBackgroundImage:[UIImage imageNamed:@"照明开"] forState:UIControlStateSelected];
// self.xunhuanLabel.text=@"照明";
//
[self.gasPumpLight setBackgroundImage:[UIImage imageNamed:@"换气关"] forState:UIControlStateNormal];
[self.gasPumpLight setBackgroundImage:[UIImage imageNamed:@"换气开"] forState:UIControlStateSelected];
// self.zengyangLabel.text=@"换气";
//
[self.light1 setBackgroundImage:[UIImage imageNamed:@"杀菌关"] forState:UIControlStateNormal];
[self.light1 setBackgroundImage:[UIImage imageNamed:@"杀菌开"] forState:UIControlStateSelected];
// self.light1Label.text=@"杀菌";
//
[self.light2 setBackgroundImage:[UIImage imageNamed:@"恒温关"] forState:UIControlStateNormal];
[self.light2 setBackgroundImage:[UIImage imageNamed:@"恒温开"] forState:UIControlStateSelected];
// self.light2Label.text=@"恒温";
self.tipLabel.text=@"宠物笼温度";
self.controlBtn.hidden=NO;
self.cameraBtn.hidden=NO;
self.waveLight.hidden=YES;
self.zaolangLabel.hidden=YES;
self.uvLight.hidden=YES;
self.shajunLight.hidden=YES;
self.huliLight.hidden=YES;
self.huliLabel.hidden=YES;
self.heatLight.hidden=YES;
self.jiareLabel.hidden=YES;
}
}
- (void)connect {
@@ -159,8 +202,9 @@
//[[Socketsingleton sharedInstance];
}
//
[[Socketsingleton sharedInstance] socketConnectHost];
[Socketsingleton sharedInstance].macAddress = self.currentDevice.macAddress;
[[Socketsingleton sharedInstance] socketConnectHost];
}
#pragma mark 通信监听communiteDelegate
@@ -211,16 +255,19 @@
[self.XuTohud hidmyHud];
[self endRefreshing];
NSLog(@"123124124");
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data];
if ([self.tipLabel.text isEqualToString:@"鱼缸温度"]) {
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentDevice.type];
[self setTemperature];
}
if (self.dataModel.gasPump) {
if (self.dataModel) {
_offLineLabel.hidden = YES;
}else {
_offLineLabel.hidden = NO;
}
[Xuanduo2DataUtility resetNewXuanduoButtonState:self.uvLight gasPumpLight:self.gasPumpLight light1:self.light1 light2:self.light2 waveLight:self.waveLight huliLight:self.huliLight waterLight:self.waterLight heatLight:self.heatLight withModel:self.dataModel];
[Xuanduo2DataUtility resetNewXuanduoButtonState:self.uvLight gasPumpLight:self.gasPumpLight light1:self.light1 light2:self.light2 waveLight:self.waveLight huliLight:self.huliLight waterLight:self.waterLight heatLight:self.heatLight withModel:self.dataModel type:self.currentDevice.type];
}
-(void)ifishDeviceLogInFail{
@@ -237,6 +284,70 @@
#pragma mark -- actions --
- (IBAction)cameraBtnClick:(id)sender {
NSMutableArray *guanxiiArr= [[DataCenter defaultDtacenter] valueForKey:@"devicamerArr"];
NSString*cameraId=nil;
for (DeviceCameraModel *model in guanxiiArr) {
if (model.deviceId == self.currentDevice.deviceId ) {
cameraId=model.cameraId;
break;
}
}
if (cameraId)
{
IfishCameraModel *camera;
NSArray*array=[[DataCenter defaultDtacenter]valueForKey:@"cameraArr"];
for (IfishCameraModel*model in array) {
if ([model.cameraId isEqualToString:cameraId])
{
camera=model;
break;
}
}
if (camera)
{
[[Socketsingleton sharedInstance] cutOffSocket];
//
IfishP2PMonitorController *p2pVC=[[IfishP2PMonitorController alloc] init];
p2pVC.contact = camera;
[self.navigationController pushViewController:p2pVC animated:YES];
}
else
{
[self.view makeToast:@"暂无关联的摄像头"];
}
}
else
{
[self.view makeToast:@"暂无关联的摄像头"];
}
}
- (IBAction)controlBtnClick:(id)sender {
FormatTankAddCamera*model=[[DataCenter defaultDtacenter] valueForKey:@"currentStore"];
if (model)
{
PetStoresViewController*store=[[PetStoresViewController alloc]init];
store.store=model;
;
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:store animated:YES];
}
}
- (IBAction)btnActions:(UIButton *)btn {
if (self.dataModel.gasPump) {
@@ -256,33 +367,56 @@
switch (btn.tag) {
case kBtnTag: //
{
if (btn.selected) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"确认关闭循环泵?" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self changLightStatus:lightModel withLightNumber:@"04" dataStr:switchString1];
}];
[alertController addAction:cancelAction];
[alertController addAction:sureAction];
[self.navigationController presentViewController:alertController animated:YES completion:nil];
}else {
[self changLightStatus:lightModel withLightNumber:@"04" dataStr:switchString1];
if([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
[self changLightStatus:lightModel withLightNumber:@"01" dataStr:switchString1];
}
else{
if (btn.selected) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"确认关闭循环泵?" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self changLightStatus:lightModel withLightNumber:@"04" dataStr:switchString1];
}];
[alertController addAction:cancelAction];
[alertController addAction:sureAction];
[self.navigationController presentViewController:alertController animated:YES completion:nil];
}else {
[self changLightStatus:lightModel withLightNumber:@"04" dataStr:switchString1];
}
}
}
break;
case kBtnTag + 1: //
{
[self changLightStatus:lightModel withLightNumber:@"01" dataStr:switchString1];
NSString*light=@"01";
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
light=@"02";
}
[self changLightStatus:lightModel withLightNumber:light dataStr:switchString1];
}
break;
case kBtnTag + 2: //1
{
[self changLightStatus:lightModel withLightNumber:@"02" dataStr:switchString1];
NSString*light=@"02";
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
light=@"03";
}
[self changLightStatus:lightModel withLightNumber:light dataStr:switchString1];
}
break;
case kBtnTag + 3: //2
{
[self changLightStatus:lightModel withLightNumber:@"03" dataStr:switchString1];
NSString*light=@"03";
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
light=@"04";
}
[self changLightStatus:lightModel withLightNumber:light dataStr:switchString1];
}
break;
case kBtnTag + 4: //
@@ -327,10 +461,21 @@
[self.view.window addSubview:_wenduPicview];
_wenduPicview.wenDuPicviewDelegate = self;
NSString *stateStr =nil;
if ([self.dataModel.status isKindOfClass:[NSNull class]]||!self.dataModel.status ) {
self.dataModel.status = @"0000";
NSString*status;
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F])
{
status=((Xuanduo2Model*)self.dataModel).status;
}
stateStr = [self.dataModel.status substringWithRange:NSMakeRange(2, 2)];
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
status=((Xuanduo3fModel*)self.dataModel).constTmep;
}
if ([status isKindOfClass:[NSNull class]]||status ) {
status = @"0000";
}
stateStr = [status substringWithRange:NSMakeRange(2, 2)];
[_wenduPicview initCateBtnSate:stateStr];
[self heatAction];
@@ -378,7 +523,17 @@
- (void)heatAction
{
UInt64 mac=[dataContorl hexToTen:self.dataModel.heatingTemperature];
UInt64 mac=0;
NSLog(@"%llu",mac);
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
Xuanduo2Model*model=(Xuanduo2Model*)self.dataModel;
mac=[dataContorl hexToTen:model.heatingTemperature];
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
Xuanduo3fModel*model=(Xuanduo3fModel*)self.dataModel;
mac=[dataContorl hexToTen:model.heatingTemperature];
}
NSLog(@"%llu",mac);
float TPlabel=mac/10;
int temp= (int)(TPlabel+0.5);
@@ -444,7 +599,15 @@
}else {
self.tipLabel.text = @"当月电量";
UInt64 mac = [dataContorl hexToTen:self.dataModel.electricity];
UInt64 mac = 0;
NSLog(@"%llu",mac);
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
Xuanduo2Model*model=(Xuanduo2Model*)self.dataModel;
mac=[dataContorl hexToTen:model.electricity];
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
}
NSString *stringTemp = [NSString stringWithFormat:@"%llukwh",mac/10.0];
[self.tempLabel setAttributedText:[NSString ls_changeFontAndColor:[UIFont systemFontOfSize:15] Color:nil TotalString:stringTemp SubStringArray:@[@"kwh"]]];
if (!_switchTimer) {
@@ -455,7 +618,15 @@
}
- (void)changeTemp {
self.tipLabel.text = @"鱼缸温度";
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
self.tipLabel.text = @"鱼缸温度";
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
self.tipLabel.text = @"宠物笼温度";
}
[self setTemperature];
[_switchTimer invalidate];
_switchTimer = nil;
@@ -478,6 +649,13 @@
titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"Ifish_share_device",@"ifishdropview_set_device"];
titles=@[@"修改名称",@"删除设备",@"分享设备",@"鱼缸设置"];
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) {
titles=@[@"修改名称",@"删除设备",@"分享设备",@"宠物笼设置"];
}
pop.delegate = self;
pop.backgroundImage =image
@@ -538,8 +716,18 @@
#pragma mark - 修改设备名
- (void)setTemperature {
UInt64 mac = [dataContorl hexToTen:self.dataModel.waterTemperature];
UInt64 mac = 0;
NSLog(@"%llu",mac);
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
Xuanduo2Model*model=(Xuanduo2Model*)self.dataModel;
mac=[dataContorl hexToTen:model.waterTemperature];
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
Xuanduo3fModel*model=(Xuanduo3fModel*)self.dataModel;
mac=[dataContorl hexToTen:model.temperature];
}
//float TPlabel=mac/10+(mac%10)*0.1;
float temp = mac/10.0;
NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp];
@@ -563,6 +751,10 @@
-(void)initCHNames{
XuToControlName *name = [UserExtendataArchaver currentNewXuToControlName:self.currentDevice.macAddress];
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
name=[UserExtendataArchaver currentPetsXuToControlName:self.currentDevice.macAddress];
}
self.shajunLight.text = name.shajunLight;
self.zengyangLabel.text = name.zengyangPump;
self.light1Label.text = name.light1;
@@ -719,9 +911,17 @@
}
- (Xuanduo2Model *)dataModel {
- (id)dataModel {
if (!_dataModel) {
_dataModel = [Xuanduo2Model new];
_dataModel = nil;
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) {
_dataModel=[[Xuanduo2Model alloc]init];
}
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
_dataModel=[[Xuanduo3fModel alloc]init];
}
}
return _dataModel;
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_0" orientation="portrait">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
@@ -14,7 +14,9 @@
<connections>
<outlet property="brandBtn" destination="KcF-jg-Mz2" id="90Z-SG-zCz"/>
<outlet property="brandName" destination="pjU-4c-KIu" id="7o4-eb-hHX"/>
<outlet property="cameraBtn" destination="iCh-CK-V5y" id="guD-Hq-sdu"/>
<outlet property="contentView" destination="aik-7S-q8v" id="uIf-SZ-FJV"/>
<outlet property="controlBtn" destination="ASo-hi-5ge" id="qfX-CB-Urm"/>
<outlet property="gasPumpLight" destination="ZVe-ED-kl7" id="mbB-kR-vdN"/>
<outlet property="heatLight" destination="fFJ-1w-2f5" id="SYo-Yn-tUf"/>
<outlet property="huliLabel" destination="7KA-Hc-54C" id="jOn-NM-fyy"/>
@@ -34,6 +36,7 @@
<outlet property="uvLight" destination="ucP-6q-kgn" id="h0M-05-ZQd"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
<outlet property="waterLight" destination="94R-4Q-SUx" id="sLi-lF-GPC"/>
<outlet property="waterLightTop" destination="kES-AW-PEh" id="AEG-4b-dSg"/>
<outlet property="waveLight" destination="83l-yl-ndR" id="Ppq-0b-uJB"/>
<outlet property="xunhuanLabel" destination="zRG-Xz-MbP" id="jCW-ap-zLb"/>
<outlet property="zaolangLabel" destination="BWx-iu-nY0" id="rxl-X0-mne"/>
@@ -42,29 +45,50 @@
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H1f-gs-HPh">
<rect key="frame" x="0.0" y="20" width="320" height="548"/>
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aik-7S-q8v" userLabel="Content View">
<rect key="frame" x="0.0" y="0.0" width="320" height="775"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="802.5"/>
<subviews>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ASo-hi-5ge">
<rect key="frame" x="20" y="280" width="80" height="20"/>
<color key="backgroundColor" red="0.96078431372549022" green="0.66666666666666663" blue="0.73725490196078436" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="JOT-JM-Hx8"/>
<constraint firstAttribute="height" constant="20" id="XQI-fM-m1M"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="切换控制器">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="controlBtnClick:" destination="-1" eventType="touchUpInside" id="3SB-mH-S1M"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="xuanduo_bg" translatesAutoresizingMaskIntoConstraints="NO" id="EVp-Sm-Feq">
<rect key="frame" x="0.0" y="0.0" width="320" height="300"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="300"/>
<constraints>
<constraint firstAttribute="height" constant="300" id="V9N-xo-Uzm"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="鱼缸温度" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vcu-MT-d6F">
<rect key="frame" x="129" y="314" width="62" height="18"/>
<rect key="frame" x="156.5" y="314" width="62" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" tag="100" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="94R-4Q-SUx">
<rect key="frame" x="30" y="372" width="35" height="35"/>
<rect key="frame" x="30" y="372" width="49" height="49"/>
<constraints>
<constraint firstAttribute="width" secondItem="94R-4Q-SUx" secondAttribute="height" multiplier="1:1" id="zkk-3F-Fut"/>
</constraints>
@@ -75,7 +99,7 @@
</connections>
</button>
<button opaque="NO" tag="101" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZVe-ED-kl7">
<rect key="frame" x="105" y="372" width="35" height="35"/>
<rect key="frame" x="119" y="372" width="48.5" height="49"/>
<constraints>
<constraint firstAttribute="width" secondItem="ZVe-ED-kl7" secondAttribute="height" multiplier="1:1" id="Nyb-kW-maB"/>
</constraints>
@@ -86,7 +110,7 @@
</connections>
</button>
<button opaque="NO" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WFc-cF-80l">
<rect key="frame" x="180" y="372" width="35" height="35"/>
<rect key="frame" x="207.5" y="372" width="49" height="49"/>
<constraints>
<constraint firstAttribute="width" secondItem="WFc-cF-80l" secondAttribute="height" multiplier="1:1" id="KNO-vi-GYn"/>
</constraints>
@@ -97,7 +121,7 @@
</connections>
</button>
<button opaque="NO" tag="103" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RHd-Xx-AyG">
<rect key="frame" x="255" y="372" width="35" height="35"/>
<rect key="frame" x="296.5" y="372" width="48.5" height="49"/>
<constraints>
<constraint firstAttribute="width" secondItem="RHd-Xx-AyG" secondAttribute="height" multiplier="1:1" id="npW-2w-QHd"/>
</constraints>
@@ -108,31 +132,31 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="循环泵" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zRG-Xz-MbP">
<rect key="frame" x="29" y="411" width="37" height="15"/>
<rect key="frame" x="36" y="425" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="增氧泵" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dse-Ih-U5R">
<rect key="frame" x="104" y="411" width="37" height="15"/>
<rect key="frame" x="124.5" y="425" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="灯光1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="w1W-F8-kDG">
<rect key="frame" x="182" y="411" width="31" height="15"/>
<rect key="frame" x="216.5" y="425" width="31" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="灯光2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k4O-MJ-aZd">
<rect key="frame" x="256.5" y="411" width="32" height="15"/>
<rect key="frame" x="304.5" y="425" width="32" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" tag="104" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="83l-yl-ndR">
<rect key="frame" x="30" y="451" width="35" height="35"/>
<rect key="frame" x="30" y="465" width="49" height="48.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="83l-yl-ndR" secondAttribute="height" multiplier="1:1" id="w6a-qu-5EK"/>
</constraints>
@@ -143,7 +167,7 @@
</connections>
</button>
<button opaque="NO" tag="105" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ucP-6q-kgn">
<rect key="frame" x="105" y="451" width="35" height="35"/>
<rect key="frame" x="119" y="465" width="48.5" height="48.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="ucP-6q-kgn" secondAttribute="height" multiplier="1:1" id="Vkv-7O-YZz"/>
</constraints>
@@ -154,7 +178,7 @@
</connections>
</button>
<button opaque="NO" tag="106" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wZH-6A-6dN">
<rect key="frame" x="180" y="451" width="35" height="35"/>
<rect key="frame" x="207.5" y="465" width="49" height="48.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="wZH-6A-6dN" secondAttribute="height" multiplier="1:1" id="526-Hn-VeS"/>
</constraints>
@@ -165,7 +189,7 @@
</connections>
</button>
<button opaque="NO" tag="107" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fFJ-1w-2f5">
<rect key="frame" x="255" y="451" width="35" height="35"/>
<rect key="frame" x="296.5" y="465" width="48.5" height="48.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="fFJ-1w-2f5" secondAttribute="height" multiplier="1:1" id="4jg-CV-sDI"/>
</constraints>
@@ -176,31 +200,31 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="造浪泵" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BWx-iu-nY0">
<rect key="frame" x="29" y="490" width="37" height="15"/>
<rect key="frame" x="36" y="517.5" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="杀菌灯" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OLb-WT-tQ0">
<rect key="frame" x="104" y="490" width="37" height="15"/>
<rect key="frame" x="124.5" y="517.5" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="护理灯" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7KA-Hc-54C">
<rect key="frame" x="179" y="490" width="37" height="15"/>
<rect key="frame" x="213.5" y="517.5" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="加热棒" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r24-bR-0zZ">
<rect key="frame" x="254" y="490" width="37" height="15"/>
<rect key="frame" x="302" y="517.5" width="37" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="G1c-II-WK8">
<rect key="frame" x="220" y="0.0" width="100" height="44"/>
<rect key="frame" x="275" y="0.0" width="100" height="44"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="cOL-94-UdY"/>
@@ -208,7 +232,7 @@
</constraints>
</view>
<label opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0 ℃" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="brS-3x-RcE">
<rect key="frame" x="115" y="209" width="90" height="90"/>
<rect key="frame" x="142.5" y="209" width="90" height="90"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="90" id="GQu-NL-cde"/>
@@ -240,7 +264,7 @@
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="设备已离线" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jp2-HW-vcX">
<rect key="frame" x="120" y="338" width="80" height="25"/>
<rect key="frame" x="147.5" y="338" width="80" height="25"/>
<color key="backgroundColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="gtN-UH-BAO"/>
@@ -254,15 +278,35 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
</label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iCh-CK-V5y" userLabel="切换摄像头">
<rect key="frame" x="275" y="280" width="80" height="20"/>
<color key="backgroundColor" red="0.96078431369999995" green="0.66666666669999997" blue="0.73725490199999999" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="切换摄像头">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="cameraBtnClick:" destination="-1" eventType="touchUpInside" id="xg3-9Y-gT8"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="WFc-cF-80l" firstAttribute="top" secondItem="ZVe-ED-kl7" secondAttribute="top" id="0BY-oG-gcd"/>
<constraint firstItem="ASo-hi-5ge" firstAttribute="top" secondItem="EVp-Sm-Feq" secondAttribute="bottom" constant="-20" id="0bJ-eb-80r"/>
<constraint firstItem="ZVe-ED-kl7" firstAttribute="width" secondItem="94R-4Q-SUx" secondAttribute="width" id="3se-2R-nR8"/>
<constraint firstItem="vcu-MT-d6F" firstAttribute="top" secondItem="brS-3x-RcE" secondAttribute="bottom" constant="15" id="4B2-Mr-ob3"/>
<constraint firstItem="OLb-WT-tQ0" firstAttribute="top" secondItem="ucP-6q-kgn" secondAttribute="bottom" constant="4" id="4Bf-gm-YTx"/>
<constraint firstItem="pjU-4c-KIu" firstAttribute="top" secondItem="KcF-jg-Mz2" secondAttribute="bottom" constant="8" id="4U0-5n-ux5"/>
<constraint firstItem="iCh-CK-V5y" firstAttribute="width" secondItem="ASo-hi-5ge" secondAttribute="width" id="4yK-Q4-cCT"/>
<constraint firstItem="k4O-MJ-aZd" firstAttribute="top" secondItem="RHd-Xx-AyG" secondAttribute="bottom" constant="4" id="6Bg-et-4ju"/>
<constraint firstItem="iCh-CK-V5y" firstAttribute="top" secondItem="ASo-hi-5ge" secondAttribute="top" id="7mh-MV-e13"/>
<constraint firstItem="G1c-II-WK8" firstAttribute="top" secondItem="aik-7S-q8v" secondAttribute="top" id="83E-pJ-8Fg"/>
<constraint firstItem="ucP-6q-kgn" firstAttribute="top" secondItem="83l-yl-ndR" secondAttribute="top" id="9Cs-Lk-q7I"/>
<constraint firstItem="RHd-Xx-AyG" firstAttribute="width" secondItem="94R-4Q-SUx" secondAttribute="width" id="A2B-qb-Kn1"/>
@@ -277,6 +321,7 @@
<constraint firstAttribute="bottom" secondItem="BWx-iu-nY0" secondAttribute="bottom" constant="270" id="Gmu-GA-a15"/>
<constraint firstItem="fFJ-1w-2f5" firstAttribute="centerY" secondItem="wZH-6A-6dN" secondAttribute="centerY" id="HUF-tX-xdo"/>
<constraint firstItem="94R-4Q-SUx" firstAttribute="leading" secondItem="aik-7S-q8v" secondAttribute="leading" constant="30" id="Hif-9z-wed"/>
<constraint firstAttribute="trailing" secondItem="iCh-CK-V5y" secondAttribute="trailing" constant="20" id="Ijl-Sy-Qe7"/>
<constraint firstItem="OLb-WT-tQ0" firstAttribute="centerX" secondItem="ucP-6q-kgn" secondAttribute="centerX" id="LF8-uL-oh2"/>
<constraint firstItem="BWx-iu-nY0" firstAttribute="centerX" secondItem="83l-yl-ndR" secondAttribute="centerX" id="LSK-ci-U11"/>
<constraint firstItem="WFc-cF-80l" firstAttribute="width" secondItem="94R-4Q-SUx" secondAttribute="width" id="LyZ-Sb-suz"/>
@@ -312,11 +357,13 @@
<constraint firstItem="fFJ-1w-2f5" firstAttribute="width" secondItem="fFJ-1w-2f5" secondAttribute="height" multiplier="1:1" id="ns1-lf-YQG"/>
<constraint firstItem="Jp2-HW-vcX" firstAttribute="top" secondItem="vcu-MT-d6F" secondAttribute="bottom" constant="6" id="pYZ-Gz-Cgr"/>
<constraint firstItem="ucP-6q-kgn" firstAttribute="width" secondItem="ucP-6q-kgn" secondAttribute="height" multiplier="1:1" id="q0b-Ok-bD1"/>
<constraint firstItem="iCh-CK-V5y" firstAttribute="height" secondItem="ASo-hi-5ge" secondAttribute="height" id="qYH-W0-hlN"/>
<constraint firstAttribute="trailing" secondItem="fFJ-1w-2f5" secondAttribute="trailing" constant="30" id="s7v-x0-Wl5"/>
<constraint firstItem="KcF-jg-Mz2" firstAttribute="top" secondItem="aik-7S-q8v" secondAttribute="top" constant="18" id="tdu-Q3-j07"/>
<constraint firstAttribute="trailing" secondItem="G1c-II-WK8" secondAttribute="trailing" id="teN-7B-Npa"/>
<constraint firstItem="RHd-Xx-AyG" firstAttribute="centerY" secondItem="WFc-cF-80l" secondAttribute="centerY" id="tpr-qz-KT0"/>
<constraint firstItem="vcu-MT-d6F" firstAttribute="centerX" secondItem="aik-7S-q8v" secondAttribute="centerX" id="uKM-H9-GFY"/>
<constraint firstItem="ASo-hi-5ge" firstAttribute="leading" secondItem="aik-7S-q8v" secondAttribute="leading" constant="20" id="vtm-ny-RWe"/>
<constraint firstItem="ucP-6q-kgn" firstAttribute="width" secondItem="83l-yl-ndR" secondAttribute="width" id="wEN-Jf-FpP"/>
<constraint firstItem="brS-3x-RcE" firstAttribute="top" secondItem="EVp-Sm-Feq" secondAttribute="bottom" constant="-91" id="wy8-b5-lgU"/>
<constraint firstItem="wZH-6A-6dN" firstAttribute="width" secondItem="83l-yl-ndR" secondAttribute="width" id="x5W-Jy-Jg5"/>
@@ -0,0 +1,55 @@
//
// xuanduo3fModel.h
// Ifish
//
// Created by 祝发冬 on 2020/4/6.
// Copyright © 2020 lianlian. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
#if 0
01
08
bcddc2450947
bcddc2450947
24 36
0101
0201
0301
0401
024e
0140
007d
01
00c8
012c
2244 crc16校验码
#endif
@interface Xuanduo3fModel : NSObject
/// 换气 -- 气泵
@property (nonatomic, strong) NSString *gasPump;
/// 灯1
@property (nonatomic, strong) NSString *light;
/// 杀菌灯
@property (nonatomic, strong) NSString *uvLamp;
/// 杀菌倒计时PH
@property (nonatomic, strong) NSString *vuPHstatus;
/// 恒温
@property (nonatomic, strong) NSString *constTmep;
///温度
@property (nonatomic, strong) NSString *temperature;
/// 加热温度
@property (nonatomic, strong) NSString *heatingTemperature;
/// 报警开关
@property (nonatomic, strong) NSString *alarmSwitch;
/// 最低温
@property (nonatomic, strong) NSString *miniTemp;
/// 最高温
@property (nonatomic, strong) NSString *maxTemp;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,13 @@
//
// xuanduo3fModel.m
// Ifish
//
// Created by on 2020/4/6.
// Copyright © 2020 lianlian. All rights reserved.
//
#import "xuanduo3fModel.h"
@implementation Xuanduo3fModel
@end
@@ -7,6 +7,7 @@
//
#import "BaseViewController.h"
#import "IfishDeviceInfo.h"
//修改设备名 及控制名 子类实现DataSource即可
typedef void (^deviceNameBlock)(NSString *);
@@ -160,7 +160,12 @@
[para setValue: cell.deviceName.text forKey:@"showName"];
if (cell.deviceName.text.length <= 6) {
[mannager POST:kUpdateDeviceUser parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSString*url=kUpdateDeviceUser;
if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F])
{
url=[NSString stringWithFormat:@"%@/api/user/updatePetDeviceUser.do",JIEKOUPORT];
}
[mannager POST:url parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) {
if (responseObject) {
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
NSLog(@"result:%@",resultDic[@"result"]);
@@ -168,7 +173,7 @@
if ([resultDic[@"result"] isEqualToString:@"100"]) {
[self.view makeToast:@"修改成功"];
[[NSNotificationCenter defaultCenter]postNotificationName:@"updateUserInfobyValidation" object:nil];
NSString *strName =[NSString stringWithFormat:@"%@",cell.deviceName.text];
+10 -1
View File
@@ -175,6 +175,7 @@ Assign BOOL isInitHostoryView;
vo.subTitle=[NSString stringWithFormat:@"%.1f°c",[self.vo.heaterNum floatValue]];
[self.mainTableView reloadData];
[self setHeatTeapWith:temp];
[[DataCenter defaultDtacenter].cache setString:[NSString stringWithFormat:@"%.1f°c",[self.vo.heaterNum floatValue]] forKey:@"heaterTemperature"];
}
//
-(void)didSelectTeamptrue:(NSString *)up andDown:(NSString *)down andWarnCode:(NSString *)code{
@@ -195,7 +196,7 @@ Assign BOOL isInitHostoryView;
vo.title=@"设置水温";
vo.iconUrl=@"温度图标";
vo.isShowArrow=YES;
vo.subTitle=@"";
vo.subTitle=[CommonUtils getNotNilStr:[[DataCenter defaultDtacenter].cache stringForKey:@"heaterTemperature"]];
[_datas addObject:vo];
// add V5.0.0
@@ -355,6 +356,9 @@ Assign BOOL isInitHostoryView;
[SVProgressHUD dismiss];
if ([result integerValue]==100) {
self.vo=[IfishHotBarVo mj_objectWithKeyValues:dict[@"data"]];
if (!self.vo) {
self.vo=self.datas[0];
}
if (self.vo.phs.count>0) {
NSDate *curDate = [NSDate dateWithTimeInterval:self.curDay*60*60*-24 sinceDate:[NSDate date]];
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];//
@@ -412,6 +416,11 @@ Assign BOOL isInitHostoryView;
self.historyView.hidden=NO;
}else{
NSLog(@"index%ld___%ld",indexPath.section,indexPath.row);
if (!self.vo)
{
self.vo=self.datas[indexPath.row];
}
[self changeWaterView];
self.changeWaterView.hotVo=self.vo;
self.changeWaterView.viewType=indexPath.row;
@@ -25,7 +25,7 @@
// CFShow((__bridge CFTypeRef)(infoDic));
NSString *app_Version=[infoDic objectForKey:@"CFBundleShortVersionString"];
NSLog(@"app_Version%@",app_Version);
app_Version=@"4.7.4";
app_Version=@"4.7.5";
NSString *versionStr = [NSString stringWithFormat:@"v%@",app_Version];
NSString *buildVersion = [infoDic objectForKey:@"CFBundleVersion"];
if (buildVersion.length > 0) {
@@ -15,6 +15,7 @@
@property (nonatomic,copy) NSString *imgeaName;
@property (nonatomic,copy) NSString *deviceName;
@property (nonatomic,strong) DeviceModel *device;
@property (nonatomic,strong) NSMutableArray *list;//设备列表
@property (nonatomic,strong) IfishCameraModel *camera;
@end
@@ -26,6 +26,9 @@
self.deviceImg.image = [UIImage imageNamed:@"加热系统"];
}
else if (indexPath.row ==3){
self.deviceImg.image = [UIImage imageNamed:@"智能宠物系统"];
}
else if (indexPath.row ==4){
self.deviceImg.image = [UIImage imageNamed:@"敬请期待"];
}
@@ -86,7 +86,7 @@ extern BOOL isfromCameraView;
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 4;
return 5;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
@@ -102,7 +102,7 @@ extern BOOL isfromCameraView;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 378/2.0;
return 278/2.0;
}
- (void)didReceiveMemoryWarning {
@@ -126,10 +126,10 @@ extern BOOL isfromCameraView;
{
//
NSArray * cameraArr =[[DataCenter defaultDtacenter]valueForKey:@"cameraArr"];
if ([cameraArr count]>=5) {
[self.view makeToast:@"设备已达上限"];
return;
}
// if ([cameraArr count]>=5) {
// [self.view makeToast:@"设备已达上限"];
// return;
// }
if ( [GWP2PClient sharedClient].linkStatus==P2PLinkStatusOK) {
@@ -156,12 +156,12 @@ extern BOOL isfromCameraView;
//
NSArray * deviceArr =[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
if ([deviceArr count]>=5) {
[self.view makeToast:@"设备已达上限"];
return;
}
// if ([deviceArr count]>=5) {
//
// [self.view makeToast:@"设备已达上限"];
// return;
//
// }
self.hidesBottomBarWhenPushed = YES;
ConAquarMethodVC *methodVC = InitObject(ConAquarMethodVC);
methodVC.deviceType=DEVICEAQUARIUM;
@@ -190,6 +190,25 @@ extern BOOL isfromCameraView;
//[self.view makeToast:@"敬请期待"];
}
break;
case 3:
{
self.hidesBottomBarWhenPushed = YES;
ConAquarMethodVC *methodVC = InitObject(ConAquarMethodVC);
methodVC.deviceType=DEVICEPETS;
methodVC.titleString=@"连接宠物笼";
[self.navigationController pushViewController:methodVC animated:YES];
// SecondConnectWifiController *wifivc=[[SecondConnectWifiController alloc]init];
// wifivc.vcTitle=@"连接加热器";
// [self.navigationController pushViewController:wifivc animated:YES];
// [wifivc addTitleViewWithTitle:@"连接加热器"];
//[self.view makeToast:@"敬请期待"];
}
break;
@@ -43,6 +43,10 @@
#import "PushMessageModel.h"
#import "IfishInformationListViewCell.h"//资讯
#import "JHRefresh.h"//refresh
#import "PetStoresViewController.h"
#import "StoreNameView.h"
#import "ConnectingAquarVC.h"
#import "SecondConnectWifiController.h"
@interface IfishDeviceViewController ()<UITableViewDelegate,UITableViewDataSource,LxPopViewDelegate,ShopTtemListDelegate>
@property(nonatomic,strong)UITableView *tableView;
@@ -52,6 +56,7 @@
@property(nonatomic,strong) DXPopover *popover;
@property(nonatomic,strong) NSArray *cameraArr;
@property(nonatomic,strong) NSMutableDictionary *petStores;
@property(nonatomic,strong) UIButton*rightButton;
@@ -373,18 +378,40 @@ Assign BOOL isPush;
//
NSArray*deviceArray=dataDic[@"device"];
NSArray*cameraA=dataDic[@"camera"];
//
NSMutableDictionary*petStores=[NSMutableDictionary dictionary];
NSMutableArray *deviceArr = [[NSMutableArray alloc] init];
if ([deviceArray count]!=0) {
for (NSDictionary*deviceDic in deviceArray) {
DeviceModel*devicemodel=[[DeviceModel alloc] initWithDict:deviceDic];
[deviceArr insertObject:devicemodel atIndex:0];
if (devicemodel.storeName.length)//
{
NSString*storeName=devicemodel.storeName;
NSMutableArray*array=petStores[storeName];
if (!array) {
array=[NSMutableArray array];
}
[array insertObject:devicemodel atIndex:0];
petStores[storeName]=array;
}
else {
[deviceArr insertObject:devicemodel atIndex:0];
}
}
}
[[DataCenter defaultDtacenter]setValue:deviceArr forKey:@"deviceInfo"];
self.petStores=petStores;
[[DataCenter defaultDtacenter]setValue:petStores forKey:@"petStores"];
//
NSMutableArray *camras = [[NSMutableArray alloc] init];
if (cameraA .count !=0) {
@@ -805,6 +832,7 @@ Assign BOOL isPush;
self.deviceArr =[dataContorl getallDevices];
self.cameraArr =[dataContorl getallCameras];
self.petStores= [[DataCenter defaultDtacenter]valueForKey:@"petStores"];
[self getTotalDeviceArrWith:self.deviceArr addCameraArr:self.cameraArr];
[self.tableView reloadData];
@@ -839,6 +867,16 @@ Assign BOOL isPush;
[self.totalArr addObject:deviceListModel];
}
for (NSString *store in self.petStores) {
FormatTankAddCamera *deviceListModel =[[FormatTankAddCamera alloc] init];
deviceListModel.list = self.petStores[store];
deviceListModel.type = @"pets";
deviceListModel.deviceName = store;
deviceListModel.imgeaName = @"petsImage";
[self.totalArr addObject:deviceListModel];
}
}
@@ -1184,7 +1222,48 @@ Assign BOOL isPush;
[[Socketsingleton sharedInstance] cutOffSocket];
[[IfishDataUnity shareDataInstance] initAppCenterVcWith:model.device addWithdissMisVc:nil];
}else if ([model.type isEqualToString:@"camera"]){
}
else if ([model.type isEqualToString:@"pets"])
{
// PetStoresViewController*store=[[PetStoresViewController alloc]init];
// store.store=model;
[[DataCenter defaultDtacenter] setValue:model forKey:@"currentStore"];
DeviceModel*pushDevice=nil;
NSString*macid=[[DataCenter defaultDtacenter].cache stringForKey:@"currentPetDevice"];
if (macid.length)
{
BOOL find=NO;
for (DeviceModel*de in model.list) {
if ([macid isEqualToString:de.macAddress])
{
find=YES;
pushDevice=de;
break;
}
}
if (find)
{
}
else
{
pushDevice=model.list.firstObject;
}
}
else
{
pushDevice=model.list.firstObject;
}
[[DataCenter defaultDtacenter].cache setString:pushDevice.macAddress forKey:@"currentPetDevice"];
[[Socketsingleton sharedInstance] cutOffSocket];
[[IfishDataUnity shareDataInstance] initAppCenterVcWith:pushDevice addWithdissMisVc:nil];
}
else if ([model.type isEqualToString:@"camera"]){
// self.hidesBottomBarWhenPushed = YES;
// IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init];
@@ -1547,7 +1626,7 @@ Assign BOOL isPush;
}
NSIndexSet *asset = [NSIndexSet indexSetWithIndex:2];
[weskSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationNone];
[weskSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationAutomatic];
}
[weskSelf.progressHud hide:YES];
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -20,14 +19,14 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="THd-Bu-zD5">
<rect key="frame" x="17" y="10" width="89" height="75"/>
<rect key="frame" x="25" y="10" width="89" height="75"/>
<constraints>
<constraint firstAttribute="width" constant="89" id="0Pc-4E-ufb"/>
<constraint firstAttribute="height" constant="75" id="KcI-Vb-QWI"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="内容摘要" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j2f-hz-gt7">
<rect key="frame" x="114" y="33" width="198" height="15"/>
<rect key="frame" x="122" y="33" width="182" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="Mem-ah-ew5"/>
</constraints>
@@ -36,7 +35,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="标题栏" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JgQ-HP-X5l">
<rect key="frame" x="114" y="10" width="198" height="21"/>
<rect key="frame" x="122" y="10" width="182" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="BEA-GV-KLN"/>
</constraints>
@@ -45,21 +44,21 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="21M-GY-1ue">
<rect key="frame" x="0.0" y="94" width="320" height="1"/>
<rect key="frame" x="0.0" y="93.5" width="320" height="1"/>
<color key="backgroundColor" red="0.83529411764705885" green="0.83529411764705885" blue="0.83529411764705885" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Swk-c6-aZl"/>
</constraints>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="informationlist_view.png" translatesAutoresizingMaskIntoConstraints="NO" id="4WM-Lf-mP1">
<rect key="frame" x="208" y="69" width="20" height="12"/>
<rect key="frame" x="200" y="66.5" width="20" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="5Q6-5Z-GhG"/>
<constraint firstAttribute="width" constant="20" id="kt8-Rt-4lN"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1000" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8BV-KU-YQ2">
<rect key="frame" x="234.5" y="64" width="28.5" height="20"/>
<rect key="frame" x="226.5" y="61.5" width="28.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="CWc-Pp-MZi"/>
</constraints>
@@ -68,7 +67,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="10" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tos-bK-aju">
<rect key="frame" x="298.5" y="65" width="13.5" height="20"/>
<rect key="frame" x="290.5" y="62.5" width="13.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="aPb-az-2hG"/>
</constraints>
@@ -77,7 +76,7 @@
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="informationlist_comment.png" translatesAutoresizingMaskIntoConstraints="NO" id="akZ-xg-M7C">
<rect key="frame" x="278" y="69" width="16" height="13"/>
<rect key="frame" x="270" y="66.5" width="16" height="13"/>
<constraints>
<constraint firstAttribute="height" constant="13" id="jI9-LF-fAx"/>
<constraint firstAttribute="width" constant="16" id="jlO-wX-UXc"/>
@@ -105,6 +104,11 @@
<constraint firstItem="j2f-hz-gt7" firstAttribute="top" secondItem="JgQ-HP-X5l" secondAttribute="bottom" constant="2" id="fgL-3A-GSX"/>
<constraint firstAttribute="trailingMargin" secondItem="JgQ-HP-X5l" secondAttribute="trailing" id="vgK-9J-52g"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</tableViewCellContentView>
<connections>
<outlet property="detailLabe" destination="j2f-hz-gt7" id="Qgk-YF-MRi"/>
@@ -2211,7 +2211,15 @@ Strong UIImage *screenShotImage;//截图
[[Socketsingleton sharedInstance] cutOffSocket];
[AppDelegate sharedDefault].canFullScreen = NO;
// tab
[self setAppTabRoot];
if ([self.navigationController.viewControllers firstObject]==self)
{
[self setAppTabRoot];
}
else
{
[self.navigationController popViewControllerAnimated:YES];
}
}
@@ -1799,7 +1799,7 @@
if (!_xuanduoBack) {
_xuanduoBack = [[Xuanduo2Model alloc] init];
}
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data];
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:DECICE_TYPE_XUANDUO2F];
self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO2F];
[self.collectionView reloadData];
}else{
@@ -197,7 +197,8 @@ typedef NS_ENUM(NSUInteger, SmartDeviceType) {
DEVICEAQUARIUM ,
/// 加热
DEVICEHEATING
DEVICEHEATING,
DEVICEPETS
};
#define Ali_Push_APPKey @"26007228"
#define Ali_Push_APPSecret @"87c9206424399968ba11a56a9a979cfe"
@@ -8,12 +8,16 @@
#import "BaseViewController.h"
#import "LXWaveProgressView.h"
#import "StoreNameView.h"
@interface SecondConnectWifiController : BaseViewController
@property (weak, nonatomic) IBOutlet UIImageView *wifigifImgView;
@property (weak, nonatomic) IBOutlet UILabel *wifiNamelabel;
@property (weak, nonatomic) IBOutlet UITextField *wifiTextFiled;
@property (weak, nonatomic) IBOutlet UILabel *redTextLable;
@property (nonatomic, strong) UIView *mask;
@property (nonatomic, strong) StoreNameView *storeNameView;
@property (nonatomic, strong) NSString *storeName;
- (IBAction)makeSureButton:(id)sender;
@@ -16,7 +16,7 @@
#import "ESPTouchTask.h"
#import "ESPTouchResult.h"
#import "ESPTouchDelegate.h"
#import "MyMD5.h"
#import "ChatroomModel.h"
#import "MMProgressHUD.h"
#import "MMProgressHUDOverlayView.h"
@@ -135,6 +135,7 @@ extern BOOL isfromCameraView;
[self creatConnectStateUI];
//WiFi名称
[self getSSid];
[self showStoreNameView];
}
- (void)updateUI {
@@ -565,7 +566,7 @@ extern BOOL isfromCameraView;
NSUInteger count = 0;
// max results to be displayed, if it is more than maxDisplayCount,
// just show the count of redundant ones
const int maxDisplayCount = 5;
const int maxDisplayCount = 100000;
if ([firstResult isSuc])
{
@@ -573,7 +574,8 @@ extern BOOL isfromCameraView;
NSArray*arry=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
DeviceModel*model=[[DeviceModel alloc]init];
if (arry.count<5) {
//if (arry.count<5)
{
NSMutableArray*macdressArr=[[NSMutableArray alloc]init];
for (model in arry) {
@@ -592,17 +594,25 @@ extern BOOL isfromCameraView;
}else{
[self bindDeviceWithSsid:_deviceBssid];
if (self.deviceType==DEVICEPETS) {
[self showStoreNameView];
}
else
{
[self bindDeviceWithSsid:_deviceBssid];
}
}
}else{
[self.view makeToast:@"您的设备数量已超过限制"];
[self mmPogressHUDdismiss];
[self connectNormalView];
}
}
// else{
//
// [self.view makeToast:@"您的设备数量已超过限制"];
// [self mmPogressHUDdismiss];
// [self connectNormalView];
//
// }
for (int i = 0; i < [esptouchResultArray count]; ++i)
@@ -660,11 +670,76 @@ extern BOOL isfromCameraView;
}
-(UIView *)mask
{
if (!_mask)
{
UIView*mask=[[UIView alloc]initWithFrame:self.view.bounds];
mask.backgroundColor=[UIColor lightGrayColor];
mask.alpha=0.5;
_mask=mask;
UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissStore)];
[mask addGestureRecognizer:tap];
}
return _mask;
}
-(void)dismissStore
{
[self.storeNameView removeFromSuperview];
[self.mask removeFromSuperview];
}
-(void)showStoreNameView
{
[self.storeNameView removeFromSuperview];
StoreNameView*store=[[[NSBundle mainBundle] loadNibNamed:@"StoreNameView" owner:self options:nil] lastObject];
store.frame=CGRectMake((SCREEN_WIDTH-280)/2.0, 100, 280, 280);
self.storeNameView.center=self.mask.center;
self.storeNameView=store;
WEAK_SELF;
store.cancelBlock=^(){
[weakSelf.mask removeFromSuperview];
[weakSelf.storeNameView removeFromSuperview];
};
store.sureBlock=^(NSString*name)
{
[weakSelf.mask removeFromSuperview];
[weakSelf.storeNameView removeFromSuperview];
weakSelf.storeName=name;
[weakSelf bindDeviceWithSsid:_deviceBssid];
};
[self.view addSubview:self.mask];
[self.view addSubview:self.storeNameView];
}
#pragma mark 绑定设备
-(void)bindDeviceWithSsid:(NSString*)bssid{
NSLog(@"设备bssid_%@",bssid);
NSString *userId = [dataContorl dataControlGetUserIdInfo];
[AFHttpTool bindDeviceWithUserId:userId macAddress:bssid success:^(id response) {
[AFHttpTool requestWihtMethod:RequestMethodTypePost url:@"" params:@{} success:^(id response) {
} failure:^(NSError *err) {
}];
NSString*url=[NSString stringWithFormat:@"%@%@",kBindDevice,userId];
NSMutableDictionary*bind=[[NSMutableDictionary alloc]initWithDictionary:@{@"macAddress":bssid}];
NSString* timestamp=[NSString stringWithFormat:@"%lld",[[NSDate date] timeIntervalSince1970]*1000];
NSString*token=[MyMD5 md5:[NSString stringWithFormat:@"%@%@ifish8",userId,timestamp]];
if (self.deviceType==DEVICEPETS)
{
url=[NSString stringWithFormat:@"%@%@",[NSString stringWithFormat:@"%@/api/user/bindPetDevice.do/",JIEKOUPORT],userId];
bind[@"token"]=token;
bind[@"timestamp"]=timestamp;
bind[@"storeName"]=[NSString stringWithFormat:@"宠物笼%lld",[[NSDate date] timeIntervalSince1970]];
}
[AFHttpTool requestWihtMethod:RequestMethodTypePost url:url params:bind success:^(id response) {
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSLog(@"data:%@",resultDic[@"data"]);
if ([resultDic[@"result"] isEqualToString:@"100"]) {
@@ -0,0 +1,19 @@
//
// PetStoresViewController.h
// Ifish
//
// Created by 祝发冬 on 2020/4/19.
// Copyright © 2020 lianlian. All rights reserved.
//
#import "BaseViewController.h"
#import "FormatTankAddCamera.h"
NS_ASSUME_NONNULL_BEGIN
@interface PetStoresViewController : BaseViewController<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, strong) FormatTankAddCamera *store;//一个商店的
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,134 @@
//
// PetStoresViewController.m
// Ifish
//
// Created by on 2020/4/19.
// Copyright © 2020 lianlian. All rights reserved.
//
#import "PetStoresViewController.h"
#import "IfishDataUnity.h"
#import "IfishDeviceInfo.h"
@interface PetStoresViewController ()
@end
@implementation PetStoresViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self addTitleViewWithTitle:self.store.deviceName];
// Do any additional setup after loading the view from its nib.
}
-(void)addTitleViewWithTitle:(NSString *)title
{
UIButton*button=[UIButton buttonWithType:UIButtonTypeCustom];
button.frame=CGRectMake(0, 0, kSizeFrom750(300), 44);
[button setTitle:title forState:UIControlStateNormal];
button.titleLabel.font=[UIFont systemFontOfSize:19];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button addTarget:self action:@selector(changeStoreName:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.titleView=button;
}
-(void)changeStoreName:(UIButton*)button
{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"修改名称" message:nil preferredStyle:UIAlertControllerStyleAlert];
//
[alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//1
UITextField *passTextField = alertController.textFields.firstObject;
NSString*name=passTextField.text;
if (name.length)
{
NSString*url=[NSString stringWithFormat:@"%@/api/user/updatePetStore.do",JIEKOUPORT];
UserModel*model=[dataContorl getUserInfo];
[AFHttpTool requestWihtMethod:RequestMethodTypePost url:url params:@{@"userId":model.userId,@"oldName":self.store.deviceName,@"newName":name} success:^(id response) {
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSLog(@"data:%@",resultDic[@"data"]);
;
if ([resultDic[@"result"] isEqualToString:@"100"]) {
[self.view makeToast:@"修改成功"];
self.store.deviceName=name;
[self addTitleViewWithTitle:name];
[[NSNotificationCenter defaultCenter]postNotificationName:@"updateUserInfobyValidation" object:nil];
}
else
{
[self.view makeToast:@"修改失败"];
}
} failure:^(NSError *err) {
[self.view makeToast:@"修改失败"];
}];
}
else
{
[self.view makeToast:@"名字不能为空"];
}
}]];
[alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}]];
[alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.text = self.store.deviceName;
}];
[self presentViewController:alertController animated:true completion:nil];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.store.list.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"pets"];
DeviceModel*model= self.store.list[indexPath.row];
if (!cell)
{
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"pets"];
}
cell.textLabel.text=model.showName;
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DeviceModel*model= self.store.list[indexPath.row];
[[Socketsingleton sharedInstance] cutOffSocket];
[[IfishDataUnity shareDataInstance] initAppCenterVcWith:model addWithdissMisVc:nil];
[[DataCenter defaultDtacenter].cache setString:model.macAddress forKey:@"currentPetDevice"];
[tableView deselectRowAtIndexPath:indexPath animated: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.
}
*/
@end
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PetStoresViewController">
<connections>
<outlet property="tableView" destination="dhT-8j-hrA" id="VhX-4j-Uvk"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="dhT-8j-hrA">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="dataSource" destination="-1" id="UHm-GH-hbe"/>
<outlet property="delegate" destination="-1" id="Ys8-LQ-Ktl"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="dhT-8j-hrA" secondAttribute="bottom" id="DcW-H0-oBU"/>
<constraint firstItem="dhT-8j-hrA" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" id="NkU-Tn-cRf"/>
<constraint firstItem="dhT-8j-hrA" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="PqU-7d-pW9"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="dhT-8j-hrA" secondAttribute="trailing" id="W0H-iW-gLe"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
</view>
</objects>
</document>