From 35c4bc03ee8da50317cd3f33e9f52f0a4259affd Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 15:53:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/WJC' into NewFilePath

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs |   13 +++++++++----
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs              |   20 ++++++++++++++------
 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs      |    8 ++------
 3 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
index 8a0f17e..3e7d9f5 100755
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -5,7 +5,7 @@
 namespace HDL_ON.UI.UI2.Intelligence.Automation
 {
 
-    public  class  LogicMethod
+    public class LogicMethod
     {
         /// <summary>
         /// 琛ㄧず鏄潯浠�
@@ -141,8 +141,9 @@
             room1.uid = "鍏ㄩ儴鍖哄煙";//榛樿sid鐢ㄨ瘑鍒鎴块棿
             roomList.Add(room1);//榛樿娣诲姞鍒版埧闂村垪琛ㄩ噷
             var roomLists = GetGatewayRoomList();
-            foreach (var room in roomLists)
+            for (int i = 0; i < roomLists.Count; i++)
             {
+                var room = roomLists[i];
                 var devlist = GetRoomDevice(room);
                 if (devlist.Count == 0)
                 {
@@ -202,8 +203,9 @@
         {
             HDL_ON.Entity.Function device = new Entity.Function() { name = "Unknown" };
             List<HDL_ON.Entity.Function> deviceLists = GetGatewayDeviceList();
-            foreach (var dev in deviceLists)
+            for (int i = 0; i < deviceLists.Count; i++)
             {
+                var dev = deviceLists[i];
                 if (dev.sid == sid)
                 {
                     device = dev;
@@ -222,8 +224,9 @@
         {
             HDL_ON.Entity.Scene scene = new Entity.Scene() { name = "Unknown" };
             List<HDL_ON.Entity.Scene> sceneLists = GetSceneList();
-            foreach (var sce in sceneLists)
+            for (int i = 0; i < sceneLists.Count; i++)
             {
+                var sce = sceneLists[i];
                 if (sce.sid == sid)
                 {
                     scene = sce;
@@ -242,8 +245,10 @@
             string roomName = "";
             List<HDL_ON.Entity.Room> roomLists = GetGatewayRoomList();
 
-            foreach (var dev in device.roomIds)
+
+            for (int i = 0; i < device.roomIds.Count; i++)
             {
+                var dev = device.roomIds[i];
                 var room = roomLists.Find((c) => c.uid == dev);
                 if (room != null)
                 {
@@ -409,14 +414,17 @@
         public static List<Entity.Function> GetShowDeviceList(List<FunctionType> functionType, List<HDL_ON.Entity.Function> deviceList)
         {
             List<HDL_ON.Entity.Function> devList = new List<Entity.Function>();
-            foreach (var dev in deviceList)
+            for (int i = 0; i < deviceList.Count; i++)
             {
+                var dev = deviceList[i];
                 if (functionType.Contains(dev.functionType))
                 {
                     ///杩囨护鎺変笉闇�瑕佹樉绀虹殑璁惧
                     devList.Add(dev);
                 }
+
             }
+
             return devList;
         }
         /// <summary>
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs
index a406a77..da2a973 100755
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs
@@ -122,12 +122,17 @@
         /// <summary>
         /// View鐨勬柟娉�
         /// </summary>
-        /// <param name="fLayout">鐖舵帶浠�</param>
+        /// <param name="frame">鐖舵帶浠�</param>
         /// <param name="titleName">鏍囬鍚嶇О</param>
         /// <param name="stateValue">涔嬪墠鐘舵�佸��</param>
         /// <param name="action">杩斿洖鍥炶皟</param>
-        public void FLayoutView(FrameLayout fLayout, string titleName,string stateValue, Action<string> action)
+        public void FLayoutView(FrameLayout frame, string titleName,string stateValue, Action<string> action)
         {
+            FrameLayout fLayout = new FrameLayout
+            {
+                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+            };
+            frame.AddChidren(fLayout);
             fLayout.AddChidren(frameLayout);
             frameLayout.AddChidren(btnTitle);
             frameLayout.AddChidren(btnCancel);
@@ -145,8 +150,8 @@
                 try
                 {
                     //杩涙潵鐨勭姸鎬�
-                    brightnesValue = int.Parse(stateValue);
-                    seekBarVol.Progress = int.Parse(stateValue);
+                    brightnesValue = int.Parse(stateValue.Replace("%", ""));
+                    seekBarVol.Progress = brightnesValue;
                 }
                 catch { }
             }
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
index 11fe439..a139048 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -502,14 +502,10 @@
         private void BrightnessMethod(Entity.Function device, Button button, string titleName)
         {
             #region 鐣岄潰
-            FrameLayout frame = new FrameLayout
-            {
-                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
-            };
-            this.AddChidren(frame);
+            //涔嬪墠鐨勭姸鎬佸��
             string stateVlaue = button.Text;
             LogicView.BrightnessView brightness = new LogicView.BrightnessView();
-            brightness.FLayoutView(frame, titleName, stateVlaue, (brightnesValue) =>
+            brightness.FLayoutView(this, titleName, stateVlaue, (brightnesValue) =>
             {
                 //鐣岄潰鏄剧ず閫変腑鍊�
                 button.Text = brightnesValue+"%";

--
Gitblit v1.8.0