黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
@@ -56,11 +56,32 @@
            framePic.Gravity = Gravity.CenterHorizontal;
            framePic.Y = Application.GetRealHeight(58);
            listBackControl.frameTable.AddChidren(framePic);
            var linuxImageType = this.zbGateway.LinuxImageType.ToString();
            var imageFile = "Gateway/RealGateway" + linuxImageType + ".png";
            imageFile = IO.FileUtils.GetImageFilePath(imageFile);
            if (imageFile == string.Empty)
            {
                //如果没有指定的网关的真实图片的话,则用共通图片
                imageFile = IO.FileUtils.GetImageFilePath("Gateway/RealGateway.png");
            }
#if Android
            //设备图片
            var bim = Android.Graphics.BitmapFactory.DecodeFile(imageFile);
            var btnpictrue = new PicViewControl(bim.Width, bim.Height);
#endif
#if iOS
            //设备图片
            var bim = UIKit.UIImage.FromFile(imageFile);
            var btnpictrue = new PicViewControl((int)bim.Size.Width, (int)bim.Size.Height);
#endif
            bim.Dispose();
            bim = null;
            //图片
            var btnImage = new PicViewControl(380, 328, true);
            btnImage.Gravity = Gravity.Center;
            btnImage.UnSelectedImagePath = "Gateway/RealGateway.png";
            framePic.AddChidren(btnImage);
            btnpictrue.Gravity = Gravity.Center;
            btnpictrue.UnSelectedImagePath = imageFile;
            framePic.AddChidren(btnpictrue);
            //初始化桌布
            var tableContr = new InformationEditorControl();
@@ -73,6 +94,7 @@
            if (gateWayExist == true)
            {
                btnGateName = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2);
                btnGateName.txtInput.MaxByte = 32;//限制只能输入32个字节
                listview.AddChidren(btnGateName);
                btnGateName.InitControl();
                //划线
@@ -101,15 +123,15 @@
                btnNote.AddBottomLine();
            }
            //设备类型
            //设备类型 (固定智能网关)
            caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
            var btnType = new FrameCaptionViewControl(caption, string.Empty, listview.rowSpace / 2);
            var infoContent = HdlDeviceCommonLogic.Current.GetDeviceModelIdNameInfo("1");
            var btnType = new FrameCaptionViewControl(caption, infoContent != null ? infoContent.A类型名字 : string.Empty, listview.rowSpace / 2);
            btnType.UseClickStatu = false;
            listview.AddChidren(btnType);
            btnType.InitControl();
            //划线
            btnType.AddBottomLine();
            HdlGatewayLogic.Current.SetGatewayImageText(btnType.txtView, zbGateway);
            //安装位置
            var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
@@ -120,7 +142,7 @@
            rowBeloneArea.SelectRoomEvent += (roomKeys) =>
            {
                //变更网关房间
                HdlGatewayLogic.Current.ChangedGatewayRoom(this.zbGateway, roomKeys);
                HdlRoomLogic.Current.ChangedGatewayRoom(this.zbGateway.GwId, roomKeys);
            };
            //完成初始化桌布
@@ -138,12 +160,12 @@
                btnHelp.ButtonClickEvent += (sender, e) =>
                {
                    var form = new GatewayManage.GatewayInfoEditorForm();
                    this.AddFromAndRemoveNowForm(form, zbGateway);
                    this.AddFormAndCloseNowForm(form, zbGateway);
                };
                listBackControl.frameTable.AddChidren(btnHelp);
                //底线
                int lineWidth = btnHelp.GetRealWidthByText();
                var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
                var btnLine = new NormalViewControl(lineWidth, HdlControlResourse.BottomLineHeight, false);
                btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
                btnLine.Gravity = Gravity.CenterHorizontal;
                btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8);
@@ -200,12 +222,12 @@
        /// </summary>
        /// <param name="gatewayName">网关名称</param>
        /// <param name="closeForm">关闭界面</param>
        private async void SetGatewayName(string gatewayName, bool closeForm)
        private void SetGatewayName(string gatewayName, bool closeForm)
        {
            //打开进度条
            this.ShowProgressBar();
            //修改本地网关名
            var result = await HdlGatewayLogic.Current.ReName(zbGateway, gatewayName);
            var result = HdlGatewayLogic.Current.ReName(zbGateway, gatewayName);
            //关闭进度条
            this.CloseProgressBar();
@@ -221,7 +243,7 @@
                    //关闭自身
                    this.CloseForm();
                    //是否是主页添加
                    if (UserCenterResourse.DicActionForm.ContainsKey("GatewayListForm") == false)
                    if (HdlFormLogic.Current.IsFormOpen("GatewayListForm") == false)
                    {
                        var form = new GatewayAddSuccessForm();
                        form.AddForm();