gxc
2020-01-10 b9cb076fe6127160c96c35bf9c8cebcffe1d5ccd
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -57,12 +57,32 @@
            //初始化桌布
            this.InitFrameTable();
            var framePic = new FrameLayout();
            framePic.Width = Application.GetRealWidth(855);
            framePic.Height = Application.GetRealHeight(570);
            framePic.Gravity = Gravity.CenterHorizontal;
            framePic.Y = Application.GetRealHeight(58);
            bodyFrameLayout.AddChidren(framePic);
            var imageFile = Common.LocalDevice.Current.GetRealDeviceIcon(listNewDevice);
            string fullName = IO.FileUtils.GetImageFilePath(imageFile);
#if Android
            //设备图片
            var btnpictrue = new PicViewControl(855, 570);
            btnpictrue.Gravity = Gravity.CenterHorizontal;
            btnpictrue.Y = Application.GetRealHeight(58);
            Common.LocalDevice.Current.SetRealDeviceIconToControl(btnpictrue, listNewDevice);
            bodyFrameLayout.AddChidren(btnpictrue);
            var bim = Android.Graphics.BitmapFactory.DecodeFile(fullName);
            var btnpictrue = new PicViewControl(bim.Width, bim.Height);
#endif
#if iOS
            //设备图片
            var bim = UIKit.UIImage.FromFile(fullName);
            var btnpictrue = new PicViewControl((int)bim.Size.Width, (int)bim.Size.Height);
#endif
            bim.Dispose();
            bim = null;
            btnpictrue.Gravity = Gravity.Center;
            btnpictrue.UnSelectedImagePath = imageFile;
            framePic.AddChidren(btnpictrue);
            string nameValue = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
            this.saveDefultName = nameValue;
@@ -140,7 +160,7 @@
            };
            bodyFrameLayout.AddChidren(btnHelp);
            //底线
            int lineWidth = btnHelp.GetRealWidthByText(12);
            int lineWidth = btnHelp.GetRealWidthByText();
            var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
            btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
            btnLine.Gravity = Gravity.CenterHorizontal;
@@ -231,29 +251,15 @@
        /// </summary>
        private async void SetAllEpointName()
        {
            var tempValue = Common.LocalDevice.Current.GetDeviceObjectText(this.listNewDevice);
            var arry = tempValue.Split(new string[] { "(" }, StringSplitOptions.RemoveEmptyEntries);
            var objName = arry[0].Trim();
            //获取设备类型
            var deviceInfoType = Common.LocalDevice.Current.GetMyDeviceEnumInfo(this.listNewDevice);
            foreach (var device in this.listNewDevice)
            {
                if (Common.LocalDevice.Current.GetSimpleEpointName(device) != string.Empty)
                {
                    //有名字不处理
                    continue;
                }
                var epointName = objName;
                if (this.listNewDevice.Count > 1)
                {
                    if (deviceInfoType.BeloneType == Common.DeviceBeloneType.A按键面板 && device.Type == DeviceType.TemperatureSensor)
                    {
                        //面板的最后一个回路是温度传感器
                        epointName = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId11);
                    }
                    //XXXXX(N回路)
                    epointName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
                }
                //获取端点名字
                var epointName = Common.LocalDevice.Current.GetDeviceEpointName(device);
                await Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO);
            }
        }