From b079d370b3c23751a5d200dc2d25f6c80977b4d4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 11 三月 2022 15:03:50 +0800
Subject: [PATCH] 代码同步

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs |   36 ++++++++++++++++++++++++++++--------
 1 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
index 8cc3709..f7b44a0 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
@@ -14,7 +14,7 @@
         /// <summary>
         /// 榛樿閫変腑鏄埧闂存椂锛氬叏閮ㄥ尯鍩�
         /// </summary>
-        public static Entity.Room selectedRoom = new Entity.Room { roomId ="6688" };
+        //public static Entity.Room selectedRoom = new Entity.Room { roomId ="6688" };
 
         /// <summary>
         /// 榛樿閫変腑鏄澶囩被鍨嬫椂锛氬叏閮ㄥ姛鑳�
@@ -122,7 +122,9 @@
                         funAllAreaView.btnText1.Text = (areaView.btnClick.Tag as Entity.Room).roomName;
                         ///鍒囨崲鎴块棿榛樿鍔熻兘绫诲瀷鍏ㄩ儴;
                         funAllAreaView.btnText2.Text = Language.StringByID(StringId.allFun);
-                        selectedRoom = (areaView.btnClick.Tag as Entity.Room);
+                        //selectedRoom = (areaView.btnClick.Tag as Entity.Room);
+                        UserInfo.Current.logicselectedRoom = (areaView.btnClick.Tag as Entity.Room);
+                        UserInfo.Current.logicselectedFunction = "";
                         ///鑾峰彇鏄剧ず璁惧鍒楄〃
                         var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_type);
 
@@ -142,7 +144,7 @@
             {
 
                 //鑾峰彇鏈�缁堟樉绀哄垪琛�
-                var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(selectedRoom, if_type);
+                var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type);
                 //鑾峰彇璁惧鍒楄〃鐨勭被鍨嬶紙渚嬪锛氱伅鍏夌被锛岀獥甯樼被銆傘�傘�傦級
                 var deviceTypeList = LogicMethod.CurrLogicMethod.GetDeviceTypeList(functionList);
                 if (deviceTypeList.Count == 0)
@@ -223,11 +225,13 @@
                     {
                         fLayout.RemoveFromParent();
                         funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString();
+                        UserInfo.Current.logicselectedFunction = areaView.btnClick.Tag.ToString();
                         ///鑾峰彇鍗曚釜绫诲瀷锛堜緥濡傦細鐏厜绫汇�傘�傦級璁惧FunctionType鍒楄〃
-                        var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(areaView.btnClick.Tag.ToString());
+                        var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
                         ///鑾峰彇鍗曚釜鐏厜绫诲瀷锛堜緥濡傦細鐏厜1,鐏厜2銆傘�傦級鏄剧ず璁惧鍒楄〃
-                        var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, functionList);
-                        DeviceListView(vv, lists);
+                        var lists2 = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, functionList);
+                        DeviceListView(vv, lists2);
+
                     };
                     if (deviceTypeList.Count - 1 == i)
                     {
@@ -239,9 +243,24 @@
             funAllAreaView.btnText2.MouseUpEventHandler += funClick;
             funAllAreaView.btnIcon2.MouseUpEventHandler += funClick;
             ///鑾峰彇鏄剧ず璁惧鍒楄〃
-            var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(selectedRoom, if_type);
-            DeviceListView(vv, deviceList);
+            var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type);
 
+            if (!string.IsNullOrEmpty(UserInfo.Current.logicselectedFunction))
+            {
+
+                ///鑾峰彇鍗曚釜绫诲瀷锛堜緥濡傦細鐏厜绫汇�傘�傦級璁惧FunctionType鍒楄〃
+                var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
+                ///鑾峰彇鍗曚釜鐏厜绫诲瀷锛堜緥濡傦細鐏厜1,鐏厜2銆傘�傦級鏄剧ず璁惧鍒楄〃
+                var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, deviceList);
+
+                funAllAreaView.btnText2.Text = UserInfo.Current.logicselectedFunction;
+                DeviceListView(vv, lists);
+            }
+            else
+            {
+                DeviceListView(vv, deviceList);
+            }
+            funAllAreaView.btnText1.Text = UserInfo.Current.logicselectedRoom.roomName;
         }
 
 
@@ -252,6 +271,7 @@
         /// <param name="deviceList"></param>
         public void DeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function> deviceList)
         {
+
             verticalScrolView.RemoveAll();
             foreach (var dev in deviceList)
             {

--
Gitblit v1.8.0