| | |
| | | /// </summary> |
| | | public void ControlScene(Scene scene) |
| | | { |
| | | if(myUdp!=null) |
| | | if (Ins.IsRemote || DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | ControlAProtocolScene(scene); |
| | | } |
| | | else |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | myUdp.ControlBusScenes(scene); |
| | | } |
| | | if(myTcpClient!= null) |
| | | { |
| | | ControlAProtocolScene(scene); |
| | | } |
| | | } |
| | | |
| | |
| | | //} |
| | | |
| | | /// <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> |
| | | /// 转换通讯数据 |