From 7d9e5d946d08f0b53ff25d1c25dcf83efb68b734 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 15 十二月 2020 09:08:59 +0800
Subject: [PATCH] 20201215-1

---
 HDL_ON/DAL/DriverLayer/Control.cs |   41 +++++++++++++++++++++++++++++++----------
 1 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 9d0256a..33a81c0 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -214,13 +214,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);
+                }
             }
         }
 
@@ -347,15 +350,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.userSceneId);
+                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