From cd1029a11d96f55337430cec97b7d4cd510f5d5f Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 17 十二月 2020 15:09:38 +0800
Subject: [PATCH] 2020-12-17 1.成员管理UI还原度修改。2.增加右键删除。3.增加无区域功能管理。

---
 HDL_ON/DAL/DriverLayer/Control.cs |   51 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 9d0256a..da0c9d2 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -77,7 +77,12 @@
                     if (value)
                     {
                         MainPage.Log($"缃戝叧鍦ㄧ嚎锛屽埛鏂拌澶囩姸鎬�");
-                        FunctionList.List.ReadAllFunctionStatus();
+                        new System.Threading.Thread(() =>
+                        {
+                            System.Threading.Thread.Sleep(1000);
+                            FunctionList.List.ReadAllFunctionStatus();
+                        })
+                        { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start();
                     }
                 }
             }
@@ -214,13 +219,16 @@
         /// </summary>
         public void ControlScene(Scene scene)
         {
-            if(myUdp!=null)
-            {
-                myUdp.ControlBusScenes(scene);
-            }
-            if(myTcpClient!= null)
+            if (Ins.IsRemote || DB_ResidenceData.Instance.GatewayType == 1)
             {
                 ControlAProtocolScene(scene);
+            }
+            else
+            {
+                if (DB_ResidenceData.Instance.GatewayType == 0)
+                {
+                    myUdp.ControlBusScenes(scene);
+                }
             }
         }
 
@@ -236,10 +244,11 @@
         {
             function.usageCount++;
             function.refreshTime = DateTime.Now;
-            DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest();
+          
             //杩滅▼閫氳
             if (Ins.IsRemote)
             {
+                DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest();
                 //ALink鎺у埗銆丅us鎺у埗浣跨敤鍚屼竴涓帴鍙f帶鍒讹紝鐢变簯绔礋璐hВ鏋�
                 var apiControlData = function.GetApiControlData(commandDictionary);
                 var actionObjs = new List<ApiAlinkControlActionObj>();
@@ -347,15 +356,33 @@
         //}
 
         /// <summary>
-        /// 鎺у埗a鍗忚鍦烘櫙
+        /// a鍗忚鎺у埗鍦烘櫙
         /// </summary>
         /// <param name="scene"></param>
         static void ControlAProtocolScene(Scene scene)
         {
-            var sendSidObj = new AProtocolSendingObject();
-            sendSidObj.time_stamp = "";
-            sendSidObj.type = "device_sid";
-            sendSidObj.command = "get_list_response";
+            if (Ins.IsRemote)
+            {
+                var pm = new HDL_ON.DAL.Server.HttpServerRequest();
+                pm.ExecuteScene(scene.userSceneId);
+            }
+            else
+            {
+                Dictionary<string, string> keys = new Dictionary<string, string>();
+                keys.Add("sid", scene.sid);
+                var aLinkData = new AlinkReadFunctionStatusObj()
+                {
+                    id = Ins.msg_id.ToString(),
+                    objects = new List<Dictionary<string, string>>()
+                        {
+                            keys
+                        },
+                    time_stamp = Utlis.GetTimestamp()
+                };
+                var aLinkJson = Newtonsoft.Json.JsonConvert.SerializeObject(aLinkData);
+                var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlScene, aLinkJson);
+                Ins.myUdp.SendLocalHdlLinkData(sendBytes);
+            }
         }
         /// <summary>
         /// 杞崲閫氳鏁版嵁

--
Gitblit v1.8.0