From da3634e011bbda29cf4e1c168997b780fe795b20 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 13 五月 2020 09:05:23 +0800
Subject: [PATCH] 优化新风模块和新风面板的测试功能,请合并代码

---
 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs |   87 ++++++++++---------------------------------
 1 files changed, 20 insertions(+), 67 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
index 0bdcf5f..9ca95fc 100644
--- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
@@ -182,7 +182,7 @@
             //鐩墠涓嶇煡閬撻儹闆煄鐨勮繖涓叿浣撴斁鍦ㄥ摢涓殑浣嶇疆
             this.functionSceneAutoBodyView = new FrameLayout();
             functionSceneAutoBodyView.Y = frameSwitchBack.Bottom;
-            functionSceneAutoBodyView.Height = Application.GetRealHeight(1423);
+            functionSceneAutoBodyView.Height = bodyFrameLayout.Height - frameSwitchBack.Bottom;
             bodyFrameLayout.AddChidren(functionSceneAutoBodyView);
 
             //鍦烘櫙,鍔熻兘,鑷姩鍖栫殑鍒囨崲鎺т欢
@@ -334,7 +334,9 @@
             var dicGroupDevice = this.GetAllGroupDevice(room);
             if (dicGroupDevice.Count == 0)
             {
-                this.ShowNoFunctionTip();
+                //娌℃湁鍔熻兘{0}璇峰湪涓汉涓績--璁惧绠$悊澶勬坊鍔�
+                string[] arryMsg = Language.StringByID(R.MyInternationalizationString.NoFunction).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+                this.ShowNotDataImage(functionSceneBodyView, arryMsg);
                 return;
             }
 
@@ -431,35 +433,6 @@
             }
         }
 
-        /// <summary>
-        /// 鎻愮ず娌℃湁鍔熻兘
-        /// </summary>
-        private void ShowNoFunctionTip()
-        {
-            var noFunction = new Button()
-            {
-                Y = Application.GetRealHeight(320),
-                Width = this.GetPictrueRealSize(757),
-                Height = this.GetPictrueRealSize(435),
-                UnSelectedImagePath = "Item/NoFunction.png",
-                Gravity = Gravity.CenterHorizontal
-            };
-            functionSceneBodyView.AddChidren(noFunction);
-
-            var noFunctionTip = new Button()
-            {
-                Y = noFunction.Bottom + Application.GetRealHeight(32),
-                Height = Application.GetRealHeight(200),
-                Width = Application.GetRealWidth(700),
-                Gravity = Gravity.CenterHorizontal,
-                Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"),
-                TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
-                TextAlignment = TextAlignment.Center,
-                IsMoreLines = true
-            };
-            functionSceneBodyView.AddChidren(noFunctionTip);
-        }
-
         #endregion
 
         #region 鈻� 鍒濆鍖栬澶囧垪琛ㄦ帶浠禵________________
@@ -531,9 +504,10 @@
                     }
                     // PM2.5
                     else if (device.Type == DeviceType.PMSensor)
-                    {
-                    }
-                    //褰╃伅(璋冨厜鍣�)
+                    {
+                        cardContr = new Controls.DevicePmSensorRowControl();
+                    }
+                    //褰╃伅(璋冨厜鍣�)
                     else if (device.Type == DeviceType.DimmableLight)
                     {
                         cardContr = new Controls.DeviceColorLightRowControl();
@@ -625,7 +599,9 @@
             }
             if (listScene.Count == 0)
             {
-                this.ShowNoSceneTip();
+                //娌℃湁鍦烘櫙{0}璇风偣鍑诲彸涓婅娣诲姞
+                string[] arryMsg = Language.StringByID(R.MyInternationalizationString.NoScene).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+                this.ShowNotDataImage(functionSceneBodyView, arryMsg);
                 return;
             }
 
@@ -763,36 +739,6 @@
             });
         }
 
-        /// <summary>
-        /// 鏄剧ず娌℃湁鍦烘櫙
-        /// </summary>
-        private void ShowNoSceneTip()
-        {
-            var noFunction = new Button()
-            {
-                Y = Application.GetRealHeight(320),
-                Width = this.GetPictrueRealSize(757),
-                Height = this.GetPictrueRealSize(435),
-                UnSelectedImagePath = "Item/NoFunction.png",
-                Gravity = Gravity.CenterHorizontal
-            };
-            functionSceneBodyView.AddChidren(noFunction);
-
-            var noScenceTip = new Button()
-            {
-                Y = noFunction.Bottom + Application.GetRealHeight(32),
-                Height = Application.GetRealHeight(200),
-                Width = Application.GetRealWidth(700),
-                Gravity = Gravity.CenterHorizontal,
-                Text = Language.StringByID(R.MyInternationalizationString.NoScene).Replace("{\\r\\n}", "\r\n"),
-                TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
-                TextAlignment = TextAlignment.Center,
-                IsMoreLines = true
-            };
-            functionSceneBodyView.AddChidren(noScenceTip);
-        }
-
-
         #endregion
 
         #region 鈻� 涓�鑸澶囩姸鎬佷笂鎶__________________
@@ -929,13 +875,20 @@
                     //鑾峰彇鍥剧墖
                     LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2);
                     dic[typeInfo.BeloneTextId].IconPath = path1;
-                    dic[typeInfo.BeloneTextId].IconPathSelected = path2;
+                    dic[typeInfo.BeloneTextId].IconPathSelected = path2;
+                    dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId;
                     if (device.Type == DeviceType.FreshAir)
                     {
                         dic[typeInfo.BeloneTextId].IconPath = "Device/FreshAirEpoint.png";
                         dic[typeInfo.BeloneTextId].IconPathSelected = "Device/FreshAirEpointSelected.png";
                     }
-                    dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId;
+                    if (device.Type == DeviceType.PMSensor)
+                    {
+                        // PM2.5
+                        dic[typeInfo.BeloneTextId].IconPath = "Device/AirQualitySensorEpoint.png";
+                        dic[typeInfo.BeloneTextId].IconPathSelected = "Device/AirQualitySensorEpointSelected.png";
+                        dic[typeInfo.BeloneTextId].TextId = R.MyInternationalizationString.AirQualitySensor;
+                    }
                 }
                 dic[typeInfo.BeloneTextId].listDeviceKeys.Add(LocalDevice.Current.GetDeviceMainKeys(device));
             }

--
Gitblit v1.8.0