diff --git a/src/InterprojectExchange/FilterConfiguration.cs b/src/InterprojectExchange/FilterConfiguration.cs index 575b4380..eb34c419 100644 --- a/src/InterprojectExchange/FilterConfiguration.cs +++ b/src/InterprojectExchange/FilterConfiguration.cs @@ -50,6 +50,11 @@ public void Save() } } + /// + /// Настройка фильтра сигналов по умолчанию + /// + private readonly List DefaultDevicesFilter = new List() { "DI", "DO", "AI", "AO" }; + /// /// Прочитать конфигурацию фильтрации из .ini /// @@ -65,8 +70,6 @@ public void Read() var newFilterParameters = new Dictionary>(); var iniFile = new IniFile(pathToConfig); - // Стандартное значение ключа параметра в .ini - string defaultValue = "false"; foreach (var section in FilterParameters.Keys) { @@ -76,7 +79,13 @@ public void Read() foreach (var keyValuePair in parameters) { string readValue = iniFile.ReadString(section, - keyValuePair.Key, defaultValue); + keyValuePair.Key, "-"); + + if (readValue == "-") + { + readValue = DefaultDevicesFilter.Contains(keyValuePair.Key).ToString(); + } + bool.TryParse(readValue, out bool isEnabled); itemParameters.Add(keyValuePair.Key, isEnabled); }