/// <summary>
 /// 加载通讯配置
 /// </summary>
 private void LoadCommunicationConfig()
 {
     LogHelper.Debug("正在初始化网络通讯配置");
     if (GatewayService._serverOrClient != 1)//20181013
     {
         List <CommunicationInfo> communicationlst = GetDefaultCommunicationLst();
         for (int i = 0; i < communicationlst.Count; i++)
         {
             _communicationConfig.Add(communicationlst[i].CommunicationCode, communicationlst[i]);
         }
     }
     else
     {
         CommunicationInfo cvalue = new CommunicationInfo()
         {
             CommunicationCode = "CS001",
             DriverCode        = "DC001",
             ServerIp          = "127.0.0.1",
             ServerPort        = 1901,
             SocketType        = SocketType.TCP,
             CommunicationType = CommunicationType.socketClient,
             DeviceList        = new List <string>()
         };
         _communicationConfig.Add(cvalue.CommunicationCode, cvalue);
     }
     //增加广播系统http通讯
     //bool broadCastEnable = Basic.Framework.Configuration.ConfigurationManager.FileConfiguration.GetBool("BroadCastEnable", false);
     //if (broadCastEnable)
     //{
     //    CommunicationInfo broadcastCommunication = GetBroadCastDefaultCommunication();
     //    _communicationConfig.Add(broadcastCommunication.CommunicationCode, broadcastCommunication);
     //}
 }
        ///// <summary>
        ///// 获取安全监控默认通讯配置(这里代码暂时写死,未走配置 20170614 )
        ///// </summary>
        ///// <returns></returns>
        //private CommunicationInfo GetKJ73NDefaultCommunication()
        //{
        //    string netServerIp = Basic.Framework.Configuration.ConfigurationManager.FileConfiguration.GetString("NetServerIp", "127.0.0.1");
        //    int netServerPort = Basic.Framework.Configuration.ConfigurationManager.FileConfiguration.GetInt("NetServerPort", 7300);

        //    CommunicationInfo ci = new CommunicationInfo()
        //    {
        //        CommunicationCode = "SC001",
        //        DriverCode = "DC001",
        //        ServerIp = netServerIp,
        //        ServerPort = netServerPort,
        //        SocketType = SocketType.TCP,
        //        CommunicationType = CommunicationType.C8962,
        //        DeviceList = new List<string>()
        //    };

        //    return ci;
        //}
        /// <summary>
        /// 获取安全监控默认通讯配置
        /// </summary>
        /// <returns></returns>
        private List <CommunicationInfo> GetDefaultCommunicationLst()
        {
            List <CommunicationInfo> lstObject = new List <CommunicationInfo>();
            string            netServerIp      = Basic.Framework.Configuration.ConfigurationManager.FileConfiguration.GetString("NetServerIp", "127.0.0.1");
            int               netServerPort    = Basic.Framework.Configuration.ConfigurationManager.FileConfiguration.GetInt("NetServerPort", 7301);
            int               netServerPort2   = Basic.Framework.Configuration.ConfigurationManager.FileConfiguration.GetInt("NetServerPort2", 7302);
            int               netServerPort3   = Basic.Framework.Configuration.ConfigurationManager.FileConfiguration.GetInt("NetServerPort3", 7303);
            int               netServerPort4   = Basic.Framework.Configuration.ConfigurationManager.FileConfiguration.GetInt("NetServerPort4", 7304);
            CommunicationInfo ci = null;

            if (netServerPort != 0)
            {
                ci = new CommunicationInfo()
                {
                    CommunicationCode = "SC001",
                    DriverCode        = "DC001",
                    ServerIp          = netServerIp,
                    ServerPort        = netServerPort,
                    SocketType        = SocketType.TCP,
                    CommunicationType = CommunicationType.C8962,
                    DeviceList        = new List <string>()
                };
                lstObject.Add(ci);
            }
            if (netServerPort2 != 0)
            {
                ci = new CommunicationInfo()
                {
                    CommunicationCode = "SC002",
                    DriverCode        = "DC001",
                    ServerIp          = netServerIp,
                    ServerPort        = netServerPort2,
                    SocketType        = SocketType.TCP,
                    CommunicationType = CommunicationType.C8962,
                    DeviceList        = new List <string>()
                };
                lstObject.Add(ci);
            }
            if (netServerPort3 != 0)
            {
                ci = new CommunicationInfo()
                {
                    CommunicationCode = "SC003",
                    DriverCode        = "DC001",
                    ServerIp          = netServerIp,
                    ServerPort        = netServerPort3,
                    SocketType        = SocketType.TCP,
                    CommunicationType = CommunicationType.C8962,
                    DeviceList        = new List <string>()
                };
                lstObject.Add(ci);
            }
            if (netServerPort4 != 0)
            {
                ci = new CommunicationInfo()
                {
                    CommunicationCode = "SC004",
                    DriverCode        = "DC001",
                    ServerIp          = netServerIp,
                    ServerPort        = netServerPort4,
                    SocketType        = SocketType.TCP,
                    CommunicationType = CommunicationType.C8962,
                    DeviceList        = new List <string>()
                };
                lstObject.Add(ci);
            }
            return(lstObject);
        }