黄学彪
2020-11-19 9ef48d7b2da7c408b53f73be0f6eef3cbac1c84a
ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/AddDeviceTypeListForm.cs
@@ -35,7 +35,7 @@
            //初始化中部控件
            this.InitMiddleFrame();
            this.zbGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId);
        }
@@ -211,23 +211,23 @@
            rowThrid.ButtonClickEvent += (sender, e) =>
            {
                rowThrid.CanClick = false;
                HdlThreadLogic.Current.RunThread(() =>
                HdlThreadLogic.Current.RunThread(() =>
                {
                    //检测网关
                    var errorMsg = this.CheckGateway();
                    HdlThreadLogic.Current.RunMain(() =>
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        rowThrid.CanClick = true;
                        if (errorMsg != null)
                        {
                            this.ShowMassage(ShowMsgType.Tip, errorMsg);
                        }
                        else
                        {
                            var form = new Device.DeviceSearchForm();
                            form.AddForm(string.Empty);
                        }
                    });
                        rowThrid.CanClick = true;
                        if (errorMsg != null)
                        {
                            this.ShowMassage(ShowMsgType.Tip, errorMsg);
                        }
                        else
                        {
                            var form = new Device.DeviceSearchForm();
                            form.AddForm(string.Empty);
                        }
                    });
                });
            };
@@ -244,8 +244,8 @@
        /// </summary>
        private string CheckGateway()
        {
            if (zbGateway != null && zbGateway.LinuxImageType == 11)
            {
            if (zbGateway != null && zbGateway.LinuxImageType == 11)
            {
                //mini夜灯只能限制加入16和设备
                this.ShowProgressBar();
@@ -254,7 +254,7 @@
                var listDevice = Common.LocalDevice.Current.GetDeviceListFromGateway(zbGateway.GwId, ref statu, true, ShowErrorMode.NO);
                if (statu != 1)
                {
                    //如果
                    //如果
                    listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(zbGateway.GwId);
                }
                //检测mini网关的设备数
@@ -266,17 +266,17 @@
                        listMac.Add(device.DeviceAddr);
                    }
                }
                this.CloseProgressBar();
                this.CloseProgressBar();
                bool canAdd = listMac.Count < 16;
                if (canAdd == false)
                {
                    //Mini网关最大只能添加16个设备
                    return Language.StringByID(R.MyInternationalizationString.uMiniGatewayMaxDeviceCountMsg);
                }
            }
            return null;
                if (canAdd == false)
                {
                    //Mini网关最大只能添加16个设备
                    return Language.StringByID(R.MyInternationalizationString.uMiniGatewayMaxDeviceCountMsg);
                }
            }
            return null;
        }
        #endregion
@@ -309,25 +309,25 @@
            if (formName != string.Empty)
            {
                rowLayout.ButtonClickEvent += (sender, e) =>
                {
                {
                    rowLayout.CanClick = false;
                    HdlThreadLogic.Current.RunThread(() =>
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        //检测网关
                        var errorMsg = this.CheckGateway();
                        HdlThreadLogic.Current.RunMain(() =>
                        HdlThreadLogic.Current.RunMain(() =>
                        {
                            rowLayout.CanClick = true;
                            if (errorMsg != null)
                            {
                                this.ShowMassage(ShowMsgType.Tip, errorMsg);
                            }
                            else
                            {
                                //反射目标界面
                                this.LoadFormByFullName("Shared.Phone.UserCenter.DeviceDirection." + formName);
                            }
                        });
                            rowLayout.CanClick = true;
                            if (errorMsg != null)
                            {
                                this.ShowMassage(ShowMsgType.Tip, errorMsg);
                            }
                            else
                            {
                                //反射目标界面
                                this.LoadFormByFullName("Shared.Phone.UserCenter.DeviceDirection." + formName);
                            }
                        });
                    });
                };
            }