예제 #1
0
        /// <summary>
        /// Returns the current configuration for paths needed in RTDS.
        /// If no path is specified in the configuration file, then exception is thrown.
        /// </summary>
        /// <returns>RTDSPaths</returns>
        public static RTDSPaths GetConfigurationPaths()
        {
            if (_configuration == null)
            {
                _configuration = GetConfiguration();
            }

            //Throws exception if paths are invalid:
            ConfigurationValidator.ValidatePaths(_configuration.Paths);

            return(_configuration.Paths);
        }
예제 #2
0
        /// <summary>
        /// Returns the current configuration for ESAPI setting needed in RTDS.
        /// If no settings is specified in the configuration file, then exception is thrown.
        /// </summary>
        /// <returns></returns>
        public static ESAPISettings GetESAPISettings()
        {
            if (_configuration == null || !ConfigurationValidator.IsESAPISettingsValid(_configuration.ESAPISettings))
            {
                _configuration = GetConfiguration();

                if (!ConfigurationValidator.IsESAPISettingsValid(_configuration.ESAPISettings))
                {
                    Logger.Fatal("Invalid ESAPI settings in configuration.");
                    throw new InvalidESAPISettingsException("Invalid ESAPI settings.");
                }
            }
            return(_configuration.ESAPISettings);
        }
예제 #3
0
        /// <summary>
        /// Returns the current monitor configuration. If monitor settings in configuration file is invalid,
        /// then values will be overwritten with a default value.
        /// </summary>
        /// <returns></returns>
        public static RTDSMonitorSettings GetMonitorSettings()
        {
            if (_configuration == null || !ConfigurationValidator.IsMonitorSettingsValid(_configuration.MonitorSettings))
            {
                _configuration = GetConfiguration();

                if (!ConfigurationValidator.IsMonitorSettingsValid(_configuration.MonitorSettings))
                {
                    _configuration.MonitorSettings = new RTDSMonitorSettings()
                    {
                        TimeOutThreshold = DefaultTimeOutThreshold
                    };

                    Logger.Info("Invalid timeout value in configuration has been overwritten");
                    OverrideConfiguration(_configuration, true);
                }
            }
            return(_configuration.MonitorSettings);
        }