From 00ab3ddb140ba8bb88b5cf572b004a85e1da85e9 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期四, 02 一月 2020 19:51:56 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into DEV_GXC --- ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 64 +++++++++++++++++++++++++------ 1 files changed, 51 insertions(+), 13 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs index 1368cc6..a4c9e34 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs +++ b/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; @@ -193,9 +213,9 @@ }; } - #endregion +#endregion - #region 鈻� 淇敼鍚嶅瓧___________________________ +#region 鈻� 淇敼鍚嶅瓧___________________________ /// <summary> /// 璁惧閲嶅懡鍚嶇劧鍚庢墦寮�鏂扮殑鐢婚潰 @@ -235,6 +255,8 @@ 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) @@ -244,16 +266,32 @@ var epointName = objName; if (this.listNewDevice.Count > 1) { - //XXXXX(N鍥炶矾) - epointName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")"; + if (deviceInfoType.BeloneType == Common.DeviceBeloneType.A鎸夐敭闈㈡澘 && device.Type == DeviceType.TemperatureSensor) + { + //闈㈡澘鐨勬渶鍚庝竴涓洖璺槸娓╁害浼犳劅鍣� + epointName += Language.StringByID(R.MyInternationalizationString.uDeviceBelongId11); + } + else if (deviceInfoType.ConcreteType == Common.DeviceConcreteType.Sensor_Pir) + { + //pir浼犳劅鍣�,瀹冨張鎼炵壒娈婁笢瑗�,浼犳劅鍣ㄨ嚜韬敤鑷繁鐨勫悕瀛�,缁х數鍣ㄥ洖璺殑璇濃�︹�� + if (device.Type == DeviceType.OnOffOutput) + { + epointName += Language.StringByID(R.MyInternationalizationString.uDeviceBelongId2300); + } + } + else + { + //XXXXX(N鍥炶矾) + epointName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")"; + } } await Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO); } } - #endregion +#endregion - #region 鈻� 鐢婚潰鍏抽棴___________________________ +#region 鈻� 鐢婚潰鍏抽棴___________________________ /// <summary> /// 鐢婚潰鍏抽棴 @@ -270,6 +308,6 @@ base.CloseFormBefore(); } - #endregion +#endregion } } -- Gitblit v1.8.0