From 351bdda734832d821a9764b0cde8be5d83c4ec50 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 01 十二月 2022 09:56:25 +0800
Subject: [PATCH] 2022年12月01日09:56:23

---
 ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs |   69 ++++++++++++++++++++++++++--------
 1 files changed, 53 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
index f856377..0d335b8 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
@@ -87,8 +87,19 @@
             btnMore.InitControl();
             btnMore.ButtonClickEvent += (sender, e) =>
             {
-                var detailInfo = new DeviceDetailInfoForm();
-                detailInfo.AddForm(device, nowSelectRoom);
+                //鑾峰彇璁惧灞炰簬銆愭櫨琛f灦銆�
+                var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice> { device });
+                if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.Airer)
+                {
+                    var form = new Shared.Phone.UserCenter.Device.DeviceFunctionSettionForm();
+                    form.AddForm(device, true);
+                }
+                else
+                {
+                    var detailInfo = new DeviceDetailInfoForm();
+                    detailInfo.AddForm(device, nowSelectRoom);
+                }
+
             };
 
             //鍒濆鍖栦腑閮ㄤ俊鎭�
@@ -121,12 +132,23 @@
             frameWhiteBack.Gravity = Gravity.CenterHorizontal;
             bodyFrameLayout.AddChidren(frameWhiteBack);
 
+            if (this.device.Type == DeviceType.TemperatureSensor)
+            {
+                //鑾峰彇璁惧绫诲瀷
+                var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
+                //绌烘皵璐ㄩ噺浼犳劅鍣� ,鍗$墖姣旇緝澶�
+                if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                {
+                    frameWhiteBack.Y = Application.GetRealHeight(98);
+                }
+            }
+
             //璁惧鍚嶇О
             this.btnDeviceName = new NormalViewControl(100, 60, true);
             btnDeviceName.Y = Application.GetRealHeight(46);
             btnDeviceName.TextSize = 15;
             btnDeviceName.IsBold = true;
-            btnDeviceName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(i_device);
+            btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
             btnDeviceName.Width = btnDeviceName.GetRealWidthByText();
             btnDeviceName.TextAlignment = TextAlignment.Center;
             btnDeviceName.Gravity = Gravity.CenterHorizontal;
@@ -146,7 +168,7 @@
             frameRoomBlack.Height = Application.GetRealHeight(138);
             frameRoomBlack.Width = frameWhiteBack.Width;
             frameRoomBlack.BackgroundColor = 0xff232323;
-            frameRoomBlack.Radius= (uint)Application.GetRealHeight(17);
+            frameRoomBlack.Radius = (uint)Application.GetRealHeight(17);
             frameRoomBlack.Gravity = Gravity.BottomCenter;
             frameWhiteBack.AddChidren(frameRoomBlack);
 
@@ -159,7 +181,7 @@
 
             //鎴块棿鍥炬爣
             var btnRoomIcon = new IconViewControl(81);
-            btnRoomIcon.X = HdlControlResourse.XXLeft;
+            btnRoomIcon.X = ControlCommonResourse.XXLeft;
             btnRoomIcon.UnSelectedImagePath = "Item/Room.png";
             btnRoomIcon.Gravity = Gravity.CenterVertical;
             frameRoomBlack.AddChidren(btnRoomIcon);
@@ -295,21 +317,36 @@
         /// </summary>
         private void AddDeviceReportEvent()
         {
-            string mainKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(this.device);
+            string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.device);
             //灞炴�т笂鎶�
             HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceDetailCardAttribute" + mainKeys, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
             {
-                string mainKey2 = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(report);
-                if (mainKeys != mainKey2)
+                string mainKey2 = Common.LocalDevice.Current.GetDeviceMainKeys(report);
+
+                if (this.device.Type == DeviceType.Airer && this.device.DeviceAddr == report.DeviceAddr)
                 {
-                    //涓嶆槸鍚屼竴涓笢瑗�
-                    return;
+                    //鏅捐。鏋剁壒娈婏細5涓洖璺唬琛ㄤ笉鍚岀殑鍔熻兘锛屼絾鏄粯璁ゆ湰鍦板彧鏄剧ず浜嗙涓�涓洖璺�
+                    //鎵�浠ユ潯浠剁壒娈婂垽鏂�
+                    //妫�娴嬬粨鏋�
+                    if (this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, report) == true)
+                    {
+                        //缁撴灉宸茬粡鎺ユ敹鍒�
+                        this.ResponeResult = 1;
+                    }
                 }
-                //妫�娴嬬粨鏋�
-                if (this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, report) == true)
+                else
                 {
-                    //缁撴灉宸茬粡鎺ユ敹鍒�
-                    this.ResponeResult = 1;
+                    if (mainKeys != mainKey2)
+                    {
+                        //涓嶆槸鍚屼竴涓笢瑗�
+                        return;
+                    }
+                    //妫�娴嬬粨鏋�
+                    if (this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, report) == true)
+                    {
+                        //缁撴灉宸茬粡鎺ユ敹鍒�
+                        this.ResponeResult = 1;
+                    }
                 }
             });
         }
@@ -337,7 +374,7 @@
             else
             {
                 //鍒锋柊鍚嶅瓧
-                this.btnDeviceName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(this.device);
+                this.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(this.device);
                 btnDeviceName.Width = btnDeviceName.GetRealWidthByText();
                 btnDeviceName.Gravity = Gravity.CenterHorizontal;
                 if (this.nowSelectRoom == null)
@@ -363,7 +400,7 @@
         /// </summary>
         public override void CloseFormBefore()
         {
-            string mainKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(this.device);
+            string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.device);
             HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardAttribute" + mainKeys);
 
             //鍥炶皟鍑芥暟

--
Gitblit v1.8.0