コード例 #1
0
        public DataCollector(DataCollectorParameters parameters)
            : base(parameters.Logger)
        {
            _parameters = parameters;

            _parameters.SpecificationRepository.SetFolder(PluginLoader.SpecificationFolder);
            _parameters.ReferenceRepository.SetFolder(PluginLoader.ReferenceFolder);
            _parameters.MeasurementDataRepository.SetFolder(PluginLoader.MeasurementDataFolder);

            _parameters.Logger.LogMethodInfo("Instantiated.");
        }
コード例 #2
0
        public object Create(Type t, string name)
        {
            if (t.IsAssignableFrom(typeof(IDataCollector)))
            {
                if (!_dataCollectorDict.ContainsKey(name))
                {
                    DataCollectorParameters param = new DataCollectorParameters();

                    if (param.Load(name))
                    {
                        DataCollector instance = new DataCollector(param);
                        _dataCollectorDict.Add(name, instance);
                    }
                }
                return(_dataCollectorDict[name]);
            }
            return(null);
        }