From 0f5d7d18f98d6d961b3d21dc2b1b59905e261fff Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期二, 23 二月 2021 17:09:17 +0800 Subject: [PATCH] 20210223-1 --- HDL_ON/DAL/DriverLayer/Control_Udp.cs | 58 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 29 insertions(+), 29 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs index 5789606..507f1c1 100644 --- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs +++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs @@ -156,35 +156,7 @@ /// </summary> public void ControlBusScenes(Scene scene) { - if (Control.Ins.IsRemote) - { - foreach (var f in scene.functions) - { - var count = 0; - List<ApiAlinkControlActionObj> actionObjs = new List<ApiAlinkControlActionObj>(); - Dictionary<string, string> d = new Dictionary<string, string>(); - var pm = new DAL.Server.HttpServerRequest(); - foreach (var temp in f.status) - { - if (f.localFunction == null) - { - continue; - } - d.Add(temp.key, temp.value); - var apiControlData = f.localFunction.GetApiControlData(d); - actionObjs.Add(apiControlData); - count++; - if (count > 9) - { - var result = pm.ControlDevice(actionObjs); - actionObjs = new List<ApiAlinkControlActionObj>(); - count = 0; - } - } - var pack = pm.ControlDevice(actionObjs); - } - } - else + if(Control.Ins.GatewayOnline_Local) { foreach (var f in scene.functions) { @@ -332,6 +304,34 @@ } } } + else + { + foreach (var f in scene.functions) + { + var count = 0; + List<ApiAlinkControlActionObj> actionObjs = new List<ApiAlinkControlActionObj>(); + Dictionary<string, string> d = new Dictionary<string, string>(); + var pm = new DAL.Server.HttpServerRequest(); + foreach (var temp in f.status) + { + if (f.localFunction == null) + { + continue; + } + d.Add(temp.key, temp.value); + var apiControlData = f.localFunction.GetApiControlData(d); + actionObjs.Add(apiControlData); + count++; + if (count > 9) + { + var result = pm.ControlDevice(actionObjs); + actionObjs = new List<ApiAlinkControlActionObj>(); + count = 0; + } + } + var pack = pm.ControlDevice(actionObjs); + } + } } /// <summary> -- Gitblit v1.8.0