public string GetDeviceName(string unitNo) { try { return(ConfigManager.ReadConfig(config, Sections.DivConfig.GetDescription(), unitNo)); } catch (Exception ex) { Log.WriteLog(LogType.Error, $"SysConfig | GetDeviceName({unitNo})", ex.Message); return(""); } }
public SysConfig() { Sys_NexpaAdapter = ConfigManager.ReadConfig(config, Sections.SysConfig.GetDescription(), "NexpaAdapter"); Sys_HomeNetAdapter = ConfigManager.ReadConfig(config, Sections.SysConfig.GetDescription(), "HomeNetAdapter"); Sys_Option = ReadOption(ConfigManager.ReadConfig(config, Sections.SysConfig.GetDescription(), "Options")); ValidateConfig = ConfigVersion.Equals(ConfigManager.ReadConfig(config, Sections.SysConfig.GetDescription(), "Config_Version")); Version = ConfigManager.ReadConfig(config, Sections.SysConfig.GetDescription(), "PVersion"); LogLimit = ConfigManager.ReadConfig(config, Sections.SysConfig.GetDescription(), "LogLimit"); ParkName = ConfigManager.ReadConfig(config, Sections.SysConfig.GetDescription(), "ParkName"); Nexpa_ServerTcpIP = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "TcpPort"); Nexpa_ServerTcpPort = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "WebPort"); Nexpa_TcpPort = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "TcpPort"); Nexpa_WebPort = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "WebPort"); Nexpa_WebDomain = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "WebDomain"); Nexpa_UWebIP = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "UWebIP"); Nexpa_UWebPort = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "UWebPort"); Nexpa_EncodCd = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "Encoding"); Nexpa_Encoding = GetEncoding(Nexpa_EncodCd); DBType = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "DBType"); DataSource = $"{ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "DBIP")},{ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "DBPort")}"; NpgHost = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "DBIP"); NpgPort = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "DBPort"); InitialCatalog = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "DBName"); UserID = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "DBID"); Password = ConfigManager.ReadConfig(config, Sections.NexpaConfig.GetDescription(), "DBPW"); HS_BaudRate = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Serial_BaudRate"); HS_PortName = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Serial_PortName"); HS_Parity = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Serial_Parity"); HW_Port = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Web_Port"); HW_Domain = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Web_Domain"); HW_Domain2 = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Web_Domain2"); HT_IP = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Tcp_IP"); HT_Port = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Tcp_Port"); HT_MyPort = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "My_Port"); HC_Id = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "HId"); HC_Pw = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "HPw"); HomeNet_EncodCd = ConfigManager.ReadConfig(config, Sections.HomeNetConfig.GetDescription(), "Encoding"); HomeNet_Encoding = GetEncoding(HomeNet_EncodCd); ParkId = ConfigManager.ReadConfig(config, Sections.EtcConfig.GetDescription(), "ParkId"); AuthToken = ConfigManager.ReadConfig(config, Sections.EtcConfig.GetDescription(), "AuthToken"); }