Commit 4f0738db authored by Simon Spannagel's avatar Simon Spannagel
Browse files

ConfigManager: allow to read multiple detector files

parent 86f785c1
......@@ -71,13 +71,16 @@ ConfigManager::ConfigManager(std::string file_name,
}
// Reading detector file
std::string detector_file_name = global_config_.getPath("detectors_file", true);
LOG(TRACE) << "Reading detector configuration";
std::ifstream detector_file(detector_file_name);
ConfigReader detector_reader(detector_file, detector_file_name);
auto detector_configs = detector_reader.getConfigurations();
detector_configs_ = std::list<Configuration>(detector_configs.begin(), detector_configs.end());
auto detector_file_names = global_config_.getPathArray("detectors_file", true);
LOG(TRACE) << "Reading detector configurations";
for(auto& detector_file_name : detector_file_names) {
std::ifstream detector_file(detector_file_name);
ConfigReader detector_reader(detector_file, detector_file_name);
auto detector_configs = detector_reader.getConfigurations();
detector_configs_.splice(detector_configs_.end(),
std::list<Configuration>(detector_configs.begin(), detector_configs.end()));
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment