WSL/SLF GitLab Repository

Commit 183d33c1 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Added a "NONE" filter so it is possible to overwrite filters when importing...

Added a "NONE" filter so it is possible to overwrite filters when importing another ini file. The documentation has been expanded accordingly.
parent 724d6e22
......@@ -39,8 +39,9 @@ namespace mio {
* - empty lines are ignored
* - if there is no section name given in a file, the default section called "GENERAL" is assumed
* - a VALUE for a KEY can consist of multiple whitespace separated values (e.g. MYNUMBERS = 17.77 -18.55 8888 99.99)
*
* @anchor config_import
* - it is possible to import another ini file, by specifying as many of the keys listed below as necessary.
* It is possible to import another ini file, by specifying as many of the keys listed below as necessary.
* Please not that in order to prevent circular dependencies, it is not possible to import the same file several times.
* - IMPORT_BEFORE = {file and path to import}. This must take place before any non-import
* key or section header. This imports the specified file before processing the current file, allowing
......
......@@ -87,6 +87,7 @@ namespace mio {
*
* @section processing_available Available processing elements
* New filters can easily be developed. The filters that are currently available are the following:
* - NONE: this does nothing (this is useful in an \ref config_import "IMPORT" to overwritte previous filters);
* - MIN: minimum check filter, see FilterMin
* - MAX: maximum check filter, see FilterMax
* - MIN_MAX: range check filter, see FilterMinMax
......
......@@ -25,18 +25,19 @@ namespace mio {
ProcessingStack::ProcessingStack(const Config& cfg, const std::string& parname) : filter_stack(), param_name(parname)
{
vector<string> vecFilters;
std::vector<std::string> vecFilters;
cfg.getValues(parname+"::filter", "Filters", vecFilters);
const size_t nr_of_filters = vecFilters.size();
for (size_t ii=0; ii<nr_of_filters; ii++){
//create a processing block for each filter
const string block_name = IOUtils::strToUpper( vecFilters[ii] );
std::vector<std::string> vec_args;
const std::string block_name( IOUtils::strToUpper( vecFilters[ii] ) );
if (block_name=="NONE") continue;
std::ostringstream tmp;
tmp << param_name << "::arg" << (ii+1);
//Read arguments
std::vector<std::string> vec_args;
cfg.getValue(tmp.str(), "Filters", vec_args, IOUtils::nothrow);
filter_stack.push_back( BlockFactory::getBlock(block_name, vec_args, cfg) );
}
......
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