WSL/SLF GitLab Repository

Commit 8799fd08 authored by Thomas Egger's avatar Thomas Egger
Browse files

SMETIO bug: parseInputOutputSection() assumed that there has to be a...

SMETIO bug: parseInputOutputSection() assumed that there has to be a INPUT::METEO key in the io.ini. It is optional though, the plugin might be only used for writing meteo data.
parent 5fb2f44a
......@@ -249,30 +249,32 @@ void SMETIO::parseInputOutputSection()
//Parse input section: extract number of files to read and store filenames in vecFiles
std::string inpath="", in_meteo="";
cfg.getValue("METEO", "Input", in_meteo);
if(in_meteo=="SMET") //keep it synchronized with IOHandler.cc for plugin mapping!!
cfg.getValue("METEO", "Input", in_meteo, Config::nothrow);
if (in_meteo == "SMET") { //keep it synchronized with IOHandler.cc for plugin mapping!!
cfg.getValue("METEOPATH", "Input", inpath);
unsigned int counter = 1;
string filename = "";
do {
stringstream ss;
filename = "";
ss << "STATION" << counter;
cfg.getValue(ss.str(), "Input", filename, Config::nothrow);
if (filename != ""){
stringstream file_and_path;
file_and_path << inpath << "/" << filename;
if (!IOUtils::validFileName(file_and_path.str())) //Check whether filename is valid
throw InvalidFileNameException(file_and_path.str(), AT);
unsigned int counter = 1;
string filename = "";
vecFiles.push_back(file_and_path.str());
}
counter++;
} while (filename != "");
nr_stations = counter - 1;
do {
stringstream ss;
filename = "";
ss << "STATION" << counter;
cfg.getValue(ss.str(), "Input", filename, Config::nothrow);
if (filename != ""){
stringstream file_and_path;
file_and_path << inpath << "/" << filename;
if (!IOUtils::validFileName(file_and_path.str())) //Check whether filename is valid
throw InvalidFileNameException(file_and_path.str(), AT);
vecFiles.push_back(file_and_path.str());
}
counter++;
} while (filename != "");
nr_stations = counter - 1;
}
//Parse output section: extract info on whether to write ASCII or BINARY format, gzipped or not
outpath = "";
......
Supports Markdown
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