黄学彪
2019-10-24 31497bb69602433d94c8a28ea01c3ee3c7cc8576
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
@@ -29,6 +29,10 @@
        /// 获取得到了新网关
        /// </summary>
        private bool newGatewayGetting = false;
        /// <summary>
        /// 网关检测中
        /// </summary>
        private string isGatewayChecking = "0";
        #endregion
@@ -111,7 +115,7 @@
            btnMsg1.Y = picGwImage.Bottom + Application.GetRealHeight(112);
            btnMsg1.TextID = R.MyInternationalizationString.uSearchGatewayFailMsg1;
            bodyFrameLayout.AddChidren(btnMsg1);
            //1.长按ZB/RST键20秒,网关恢复出厂设置,指示灯全部熄{0}灭后,重新入网。
            //1.长按ZB/RST键20秒,网关恢复出厂设置,指示灯全部熄灭后,重新入网。
            var btnMsg2 = new NormalViewControl(930, 100, true);
            btnMsg2.X = Application.GetRealWidth(75);
            btnMsg2.Y = btnMsg1.Bottom + Application.GetRealHeight(35);
@@ -120,7 +124,7 @@
            btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnMsg2.IsMoreLines = true;
            bodyFrameLayout.AddChidren(btnMsg2);
            //2.点按HID/WCFG键,进入网关换绑模式,系统指示灯快闪{0}5秒。
            //2.点按HID/WCFG键,进入网关换绑模式,系统指示灯快闪5秒。
            var btnMsg3 = new NormalViewControl(930, 100, true);
            btnMsg3.X = Application.GetRealWidth(75);
            btnMsg3.Y = btnMsg2.Bottom + Application.GetRealHeight(12);
@@ -214,7 +218,7 @@
            picGwImage.AddChidren(btnRound);
            string strMsg = btnMsg.Text;
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                //清空全部列表
                HdlGatewayLogic.Current.ClearAllRealGateway();
@@ -229,8 +233,22 @@
                    maxCount--;
                    if (maxCount % 4 == 0)
                    {
                        //每2秒检测搜索到的网关
                        await this.CheckZbGatewayAndSetRow();
                        lock(isGatewayChecking)
                        {
                            if (isGatewayChecking != "1")
                            {
                                isGatewayChecking = "1";
                                HdlThreadLogic.Current.RunThread(async () =>
                                {
                                    //每2秒检测搜索到的网关
                                    await this.CheckZbGatewayAndSetRow();
                                    lock (isGatewayChecking)
                                    {
                                        isGatewayChecking = "0";
                                    }
                                });
                            }
                        }
                    }
                    if (this.newGatewayGetting == true)
                    {
@@ -265,12 +283,15 @@
                        this.InitFailMiddleFrame();
                    });
                }
                else
                else if (newGatewayGetting == true)
                {
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        var form = new WiredGatewayListForm();
                        this.AddFromAndRemoveNowForm(form, listZbGateway, dicZbGatewayDiv);
                        if (this.Parent != null)
                        {
                            var form = new WiredGatewayListForm();
                            this.AddFromAndRemoveNowForm(form, listZbGateway, dicZbGatewayDiv);
                        }
                    });
                }
            });