一键喂鱼开关
This commit is contained in:
parent
20d110de4a
commit
e906be6c71
|
|
@ -183,6 +183,7 @@
|
||||||
[self.controlBtn setTitle:@"一键喂鱼" forState:UIControlStateNormal];
|
[self.controlBtn setTitle:@"一键喂鱼" forState:UIControlStateNormal];
|
||||||
[self.controlBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor lightGrayColor]] forState:UIControlStateNormal];
|
[self.controlBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor lightGrayColor]] forState:UIControlStateNormal];
|
||||||
[self.controlBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor cyanColor]] forState:UIControlStateSelected];
|
[self.controlBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor cyanColor]] forState:UIControlStateSelected];
|
||||||
|
[self.controlBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor cyanColor]] forState:UIControlStateHighlighted];
|
||||||
[self.cameraBtn setTitle:@"功率" forState:UIControlStateNormal];
|
[self.cameraBtn setTitle:@"功率" forState:UIControlStateNormal];
|
||||||
[self.cameraBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor lightGrayColor]] forState:UIControlStateNormal];
|
[self.cameraBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor lightGrayColor]] forState:UIControlStateNormal];
|
||||||
[self.cameraBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor cyanColor]] forState:UIControlStateHighlighted];
|
[self.cameraBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor cyanColor]] forState:UIControlStateHighlighted];
|
||||||
|
|
@ -453,7 +454,12 @@
|
||||||
|
|
||||||
- (IBAction)cameraBtnClick:(id)sender {
|
- (IBAction)cameraBtnClick:(id)sender {
|
||||||
|
|
||||||
|
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO4F]||[self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO5F])//一键喂鱼
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
|
||||||
|
{
|
||||||
NSMutableArray *guanxiiArr= [[DataCenter defaultDtacenter] valueForKey:@"devicamerArr"];
|
NSMutableArray *guanxiiArr= [[DataCenter defaultDtacenter] valueForKey:@"devicamerArr"];
|
||||||
NSString*cameraId=nil;
|
NSString*cameraId=nil;
|
||||||
|
|
||||||
|
|
@ -501,7 +507,30 @@
|
||||||
[self.view makeToast:@"暂无关联的摄像头"];
|
[self.view makeToast:@"暂无关联的摄像头"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- (IBAction)controlBtnClick:(id)sender {
|
|
||||||
|
}
|
||||||
|
- (IBAction)controlBtnClick:(UIButton*)sender {
|
||||||
|
|
||||||
|
if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO4F]||[self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO5F])//一键喂鱼
|
||||||
|
{
|
||||||
|
sender.selected=!sender.selected;
|
||||||
|
baseModel*readModel=[[baseModel alloc]init];
|
||||||
|
readModel.sendmacId =self.currentDevice.macAddress;
|
||||||
|
readModel.resavemacId =self.currentDevice.macAddress;
|
||||||
|
readModel.functionCode=@"0c";
|
||||||
|
readModel.massagelegth=@"12";
|
||||||
|
|
||||||
|
NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,[self.dataModel.fishFeedStatus isEqualToString:@"00"]?@"01":@"00",@"0000"];
|
||||||
|
|
||||||
|
NSData*readData=[dataContorl stringToHexData:readString];
|
||||||
|
[[Socketsingleton sharedInstance] soketWriteData:readData];
|
||||||
|
|
||||||
|
[_indicatorView startAnimating];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO3F])
|
||||||
|
{
|
||||||
|
|
||||||
FormatTankAddCamera*model=[[DataCenter defaultDtacenter] valueForKey:@"currentStore"];
|
FormatTankAddCamera*model=[[DataCenter defaultDtacenter] valueForKey:@"currentStore"];
|
||||||
|
|
||||||
|
|
@ -515,6 +544,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
- (IBAction)btnActions:(UIButton *)btn {
|
- (IBAction)btnActions:(UIButton *)btn {
|
||||||
if (self.dataModel.gasPump) {
|
if (self.dataModel.gasPump) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue