wei
2021-03-03 d4811b7d34b45ff6b21b97f11da128b5572ec526
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>