WSL/SLF GitLab Repository

Commit ca13350c authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Added a missing check on arguments and associated error message to the CST algorithm

parent 462dcad5
......@@ -259,11 +259,16 @@ double ConstAlgorithm::getQualityRating(const Date& i_date, const MeteoData::Par
nrOfMeasurments = getData(date, param, vecData, vecMeta);
if (nrOfMeasurments == 0) {
if (vecArgs.size()==1) {
const size_t nr_args = vecArgs.size();
if (nr_args>1)
throw InvalidArgumentException("Wrong number of arguments supplied for the "+algo+" algorithm", AT);
if (nr_args==1) {
IOUtils::convertString(user_cst, vecArgs[0]);
user_provided = true;
return 0.01;
} else return 0.0;
} else
return 0.0;
} else if (nrOfMeasurments == 1) {
return 0.8;
} else if (nrOfMeasurments > 1) {
......
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