| | |
| | | /// <param name="isOpen">打开状态</param>
|
| | | private void RefreshSwitchStatu(bool isOpen)
|
| | | {
|
| | | //状态一致(第二索引的控件如果是选择状态,则必定为开状态)
|
| | | if (listControl[1].IsSelected == isOpen) { return; }
|
| | |
|
| | | //变更状态
|
| | | if (this.device.DfunctionType == DeviceFunctionType.A开关)
|
| | | {
|
| | |
| | | listControl[0].IsSelected = isOpen;
|
| | | listControl[1].IsSelected = isOpen;
|
| | | }
|
| | | //设置状态文字
|
| | | this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <returns></returns>
|
| | | public override bool CheckResponeResultStatu(ReceiveComandDiv comandDiv, CommonDevice report)
|
| | | {
|
| | | if (comandDiv == ReceiveComandDiv.A节点控制反馈)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else if (comandDiv == ReceiveComandDiv.A设备属性上报)
|
| | | if (comandDiv == ReceiveComandDiv.A设备属性上报)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //变更卡片状态
|
| | | this.RefreshSwitchStatu(((LightBase)this.device).OnOffStatus == 1);
|
| | | //设置状态文字
|
| | | this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
|
| | | });
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | ((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0;
|
| | | //变更卡片状态
|
| | | this.RefreshSwitchStatu(((LightBase)this.device).OnOffStatus == 1);
|
| | | //设置状态文字
|
| | | this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
|
| | | return;
|
| | | }
|
| | | //检测是否获取网关反馈的结果,如果网关没有回复,则会弹出消息
|
| | | this.StartCheckResponeResult(this.listControl, (result) =>
|
| | | {
|
| | | //没有接收到网关回复
|
| | | if (result == false)
|
| | | //接收到网关回复
|
| | | if (result == true)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | { |
| | | //设置状态文字
|
| | | this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
|
| | | {
|
| | | //变更卡片状态
|
| | | bool statu = ((LightBase)this.device).OnOffStatus == 1;
|
| | | this.RefreshSwitchStatu(statu);
|
| | | });
|
| | | }
|
| | | });
|
| | | //变更卡片状态
|
| | | this.RefreshSwitchStatu(isOpen);
|
| | |
|
| | | if (isOpen == true)
|
| | | {
|
| | | //打开
|
| | | this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
|
| | | this.device.SwitchControl(1);
|
| | | }
|
| | | else
|
| | | {
|
| | | //关闭
|
| | | this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close));
|
| | | this.device.SwitchControl(0);
|
| | | }
|
| | | }
|