parent
e1103b04af
commit
083bbf164a
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "right@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
|
|
@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
+(void)readSocketDataWithBackMsgModel:(Xuanduo2Model*)xuanduoModel addWithBackData:(NSData*)data;
|
||||
|
||||
+(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;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
|||
|
|
@ -29,4 +29,61 @@
|
|||
xuanduoModel.maxTemp = [dataString substringWithRange:NSMakeRange(80, 4)];
|
||||
}
|
||||
|
||||
+(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{
|
||||
// 杀菌灯
|
||||
NSString *stateString1 = [backModel.uvLamp substringWithRange:NSMakeRange(2, 2)];
|
||||
if ([stateString1 isEqualToString:@"01"]) {
|
||||
uvLightBtn.selected = YES;
|
||||
}else{
|
||||
uvLightBtn.selected = NO;
|
||||
}
|
||||
// 气泵
|
||||
NSString *stateString2 = [backModel.gasPump substringWithRange:NSMakeRange(2, 2)];
|
||||
if ([stateString2 isEqualToString:@"01"]) {
|
||||
gasLightBtn.selected = YES;
|
||||
}else{
|
||||
gasLightBtn.selected = NO;
|
||||
}
|
||||
// 灯1
|
||||
NSString *stateString3 = [backModel.light1 substringWithRange:NSMakeRange(2, 2)];
|
||||
if ([stateString3 isEqualToString:@"01"]) {
|
||||
light1Btn.selected = YES;
|
||||
}else{
|
||||
light1Btn.selected = NO;
|
||||
}
|
||||
// 灯2
|
||||
NSString *stateString4 = [backModel.light2 substringWithRange:NSMakeRange(2, 2)];
|
||||
if ([stateString4 isEqualToString:@"01"]) {
|
||||
light2Btn.selected = YES;
|
||||
}else{
|
||||
light2Btn.selected = NO;
|
||||
}
|
||||
// 造浪
|
||||
NSString *stateString5 = [backModel.waveMakingPump substringWithRange:NSMakeRange(2, 2)];
|
||||
if ([stateString5 isEqualToString:@"01"]) {
|
||||
waveLightBtn.selected = YES;
|
||||
}else{
|
||||
waveLightBtn.selected = NO;
|
||||
}
|
||||
// 护理灯
|
||||
NSString *stateString6 = backModel.huliLight;
|
||||
if ([stateString6 isEqualToString:@"01"]) {
|
||||
huliLightBtn.selected = YES;
|
||||
}else{
|
||||
huliLightBtn.selected = NO;
|
||||
}
|
||||
NSString *stateString7 = [backModel.waterPump substringWithRange:NSMakeRange(2, 2)];
|
||||
if ([stateString7 isEqualToString:@"01"]) {
|
||||
waveLightBtn.selected = YES;
|
||||
}else{
|
||||
waveLightBtn.selected = NO;
|
||||
}
|
||||
NSString *stateString8 = backModel.heatStatus;
|
||||
if ([stateString8 isEqualToString:@"01"]) {
|
||||
heatLightBtn.selected = YES;
|
||||
}else{
|
||||
heatLightBtn.selected = NO;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -40,6 +40,14 @@
|
|||
@property (weak, nonatomic) IBOutlet UILabel *tempLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *tipLabel;
|
||||
@property (nonatomic, strong) NSTimer *switchTimer;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *uvLight;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *gasPumpLight;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *light1;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *light2;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *waveLight;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *huliLight;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *waterLight;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *heatLight;
|
||||
|
||||
@end
|
||||
|
||||
|
|
@ -60,7 +68,7 @@
|
|||
- (void)setup{
|
||||
self.title = self.currentDevice.showName;
|
||||
//右侧菜单
|
||||
UIImage *MyEquipmentImage = [UIImage imageNamed:@"ifishnav_dropview_list"];
|
||||
UIImage *MyEquipmentImage = [UIImage imageNamed:@"right"];
|
||||
UIButton *rightPopButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[rightPopButton setImage:MyEquipmentImage forState:UIControlStateNormal];
|
||||
rightPopButton.frame=CGRectMake(kScreenWidth-60,0,60,44);
|
||||
|
|
@ -140,9 +148,11 @@
|
|||
|
||||
-(void)socketDidGetBackmsgData:(NSData *)data onsoket:(AsyncSocket *)sock{
|
||||
[Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data];
|
||||
if ([self.tipLabel.text isEqualToString:@"当月电量"]) {
|
||||
if ([self.tipLabel.text isEqualToString:@"鱼缸温度"]) {
|
||||
[self setTemperature];
|
||||
}
|
||||
[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];
|
||||
|
||||
}
|
||||
-(void)ifishDeviceLogInFail{
|
||||
|
||||
|
|
@ -185,9 +195,20 @@
|
|||
UInt64 mac = [dataContorl hexToTen:self.dataModel.electricity];
|
||||
NSString *stringTemp = [NSString stringWithFormat:@"%llukwh",mac];
|
||||
[self.tempLabel setAttributedText:[NSString ls_changeFontAndColor:[UIFont systemFontOfSize:15] Color:nil TotalString:stringTemp SubStringArray:@[@"kwh"]]];
|
||||
if (!_switchTimer) {
|
||||
_switchTimer = [NSTimer timerWithTimeInterval:3.0 target:self selector:@selector(changeTemp) userInfo:nil repeats:YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer:_switchTimer forMode:NSRunLoopCommonModes];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)changeTemp {
|
||||
self.tipLabel.text = @"鱼缸温度";
|
||||
[self setTemperature];
|
||||
[_switchTimer invalidate];
|
||||
_switchTimer = nil;
|
||||
}
|
||||
|
||||
- (void)goBackAction{
|
||||
[[Socketsingleton sharedInstance] cutOffSocket];
|
||||
[[IfishDataUnity shareDataInstance] setAppTabRoot];
|
||||
|
|
|
|||
|
|
@ -14,15 +14,23 @@
|
|||
<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="gasPumpLight" destination="ZVe-ED-kl7" id="mbB-kR-vdN"/>
|
||||
<outlet property="heatLight" destination="fFJ-1w-2f5" id="SYo-Yn-tUf"/>
|
||||
<outlet property="huliLabel" destination="OLb-WT-tQ0" id="zfj-0D-wQW"/>
|
||||
<outlet property="huliLight" destination="ucP-6q-kgn" id="88Z-Hm-G7b"/>
|
||||
<outlet property="jiareLabel" destination="r24-bR-0zZ" id="1FX-Ye-0ju"/>
|
||||
<outlet property="light1" destination="WFc-cF-80l" id="KWL-WD-5Ce"/>
|
||||
<outlet property="light1Label" destination="w1W-F8-kDG" id="9Tm-jx-s9C"/>
|
||||
<outlet property="light2" destination="RHd-Xx-AyG" id="9hu-GA-aKN"/>
|
||||
<outlet property="light2Label" destination="k4O-MJ-aZd" id="dsc-dG-n76"/>
|
||||
<outlet property="positionView" destination="G1c-II-WK8" id="4Cm-FT-QIK"/>
|
||||
<outlet property="shajunLight" destination="zRG-Xz-MbP" id="LTQ-hk-FrW"/>
|
||||
<outlet property="tempLabel" destination="brS-3x-RcE" id="eAw-p5-o08"/>
|
||||
<outlet property="tipLabel" destination="vcu-MT-d6F" id="f4o-WG-803"/>
|
||||
<outlet property="uvLight" destination="94R-4Q-SUx" id="Lja-bT-2GS"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
<outlet property="waterLight" destination="wZH-6A-6dN" id="kyb-Lh-sdc"/>
|
||||
<outlet property="waveLight" destination="83l-yl-ndR" id="F0p-IN-WSs"/>
|
||||
<outlet property="xunhuanLabel" destination="7KA-Hc-54C" id="QRq-jP-IC4"/>
|
||||
<outlet property="zaolangLabel" destination="BWx-iu-nY0" id="rxl-X0-mne"/>
|
||||
<outlet property="zengyangLabel" destination="Dse-Ih-U5R" id="sjC-JB-eMQ"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue