黄学彪
2020-04-28 e22fdb94322e6cec38e5e4a9aec13d431a133fde
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
@@ -80,7 +80,7 @@
            //设置标题信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
            this.gatewayId = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway);
            this.gatewayId = GatewayResourse.NowSelectGatewayId;
            HdlGatewayLogic.Current.GetRealGateway(ref this.realGateway, this.gatewayId);
            //初始化中部控件
@@ -97,7 +97,7 @@
            //图片
            var btnPic = new PicViewControl(878, 478);
            btnPic.Y = Application.GetMinRealAverage(251);
            btnPic.Y = Application.GetRealHeight(251);
            btnPic.Gravity = Gravity.CenterHorizontal;
            btnPic.UnSelectedImagePath = "Instruct/DeviceSearch.png";
            bodyFrameLayout.AddChidren(btnPic);
@@ -142,11 +142,13 @@
            btnProgressView.Text = "0%";
            frameProgress.AddChidren(btnProgressView);
            //允许设备入网
            this.StartDeviceCanAddToGateway(false);
            //添加监视设备新上报的事件
            this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
            if (this.realGateway != null)
            {
                //允许设备入网
                this.StartDeviceCanAddToGateway(false);
                //添加监视设备新上报的事件
                this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
            }
            //开启连接的假想动画效果线程
            this.StartConcetionAnimeteThread();
        }
@@ -312,20 +314,20 @@
        /// </summary>
        private void StartConcetionAnimeteThread()
        {
            int iconSize = Application.GetMinRealAverage(23);
            int iconSize = this.GetPictrueRealSize(23);
            var listPoint = new List<int>();
            for (int i = 0; i < 9; i++)
            {
                //X轴+Index*(图标大小+间距)
                listPoint.Add(Application.GetMinRealAverage(394) + i * (iconSize + Application.GetMinRealAverage(10)));
                listPoint.Add(this.GetPictrueRealSize(394) + i * (iconSize + this.GetPictrueRealSize(10)));
            }
            var btnRound = new PicViewControl(iconSize, iconSize, false);
            btnRound.Radius = (uint)iconSize / 2;
            btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor;
            btnRound.X = listPoint[0];
            btnRound.Y = Application.GetMinRealAverage(475);
            btnRound.Y = this.GetPictrueRealSize(475);
            bodyFrameLayout.AddChidren(btnRound);
            HdlThreadLogic.Current.RunThread(() =>
@@ -571,15 +573,18 @@
        /// </summary>
        public override void CloseFormBefore()
        {
            //停止接收
            this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
            HdlThreadLogic.Current.RunThread(() =>
            if (this.realGateway != null)
            {
                System.Threading.Thread.Sleep(1200);
                //关闭入网模式
                this.realGateway.AddNewDeviceToGateway(0);
            });
                //停止接收
                this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
                HdlThreadLogic.Current.RunThread(() =>
                {
                    System.Threading.Thread.Sleep(1200);
                    //关闭入网模式
                    this.realGateway.AddNewDeviceToGateway(0);
                });
            }
            base.CloseFormBefore();
        }