| | |
| | | /// </summary>
|
| | | public Common.Room nowSelectRoom = null;
|
| | | /// <summary>
|
| | | /// 标记它是由哪个控件调起的
|
| | | /// </summary>
|
| | | public ViewGroup RowOrCardControl = null;
|
| | | /// <summary>
|
| | | /// 状态控件
|
| | | /// </summary>
|
| | | private NormalViewControl btnStatu = null;
|
| | |
| | | /// <summary>
|
| | | /// 是否获取网关反馈的结果 0:没有获取得到 1:已经获取得到
|
| | | /// </summary>
|
| | | private int ResponeResult = 0;
|
| | | public int ResponeResult = 0;
|
| | | /// <summary>
|
| | | /// 当前端点的功能类型
|
| | | /// </summary>
|
| | |
| | | this.ResponeResult = 0;
|
| | |
|
| | | //先让指定控件不能点击
|
| | | var listSelect = new List<bool>();
|
| | | foreach (var myContr in listControl)
|
| | | {
|
| | | myContr.CanClick = false;
|
| | | listSelect.Add(myContr.IsSelected);
|
| | | }
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | int waitime = 30;
|
| | | int waitime = 40;
|
| | | while (waitime > 0)
|
| | | {
|
| | | System.Threading.Thread.Sleep(100);
|
| | |
| | | break;
|
| | | }
|
| | | waitime--;
|
| | | //2秒的时候,还是接受不到的话,强制再次刷新设备状态
|
| | | if (waitime == 20)
|
| | | {
|
| | | //从新发送获取设备的状态(强制)
|
| | | this.device.HadReadDeviceStatu = false;
|
| | | if (this.RowOrCardControl != null)
|
| | | {
|
| | | this.RowOrCardControl.GetType().InvokeMember("SendStatuComand", System.Reflection.BindingFlags.InvokeMethod, null, this.RowOrCardControl, null);
|
| | | }
|
| | | }
|
| | | }
|
| | | if (waitime <= 0)
|
| | | if (waitime <= 0 && this.Parent != null)
|
| | | {
|
| | | //没有获取得到结果
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.FAIL));
|
| | | msgContr.Show();
|
| | | //变更回原来的状态
|
| | | for (int i = 0; i < listSelect.Count; i++)
|
| | | {
|
| | | if (listSelect[i] != listControl[i].IsSelected)
|
| | | {
|
| | | listControl[i].IsSelected = listSelect[i];
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | //开关按钮可以再点击
|
| | |
| | | private void AddDeviceReportEvent()
|
| | | {
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.device);
|
| | | //节点反馈
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceDetailCardControl" + mainKeys, ReceiveComandDiv.A节点控制反馈, (report) =>
|
| | | {
|
| | | string mainKey2 = Common.LocalDevice.Current.GetDeviceMainKeys(report);
|
| | | if (mainKeys != mainKey2)
|
| | | {
|
| | | //不是同一个东西
|
| | | return;
|
| | | }
|
| | | //检测结果
|
| | | if (this.CheckResponeResultStatu(ReceiveComandDiv.A节点控制反馈, report) == true)
|
| | | {
|
| | | //结果已经接收到
|
| | | this.ResponeResult = 1;
|
| | | }
|
| | | });
|
| | | //属性上报
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceDetailCardAttribute" + mainKeys, ReceiveComandDiv.A设备属性上报, (report) =>
|
| | | {
|
| | |
| | | public override void CloseFormBefore()
|
| | | {
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.device);
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardControl" + mainKeys);
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardAttribute" + mainKeys);
|
| | |
|
| | | //回调函数
|