| | |
| | | /// </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) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | 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> |