diff --git a/src/ParamOutputImpl/Plot/ParameterData.cc b/src/ParamOutputImpl/Plot/ParameterData.cc index 9c41bed..5768728 100644 --- a/src/ParamOutputImpl/Plot/ParameterData.cc +++ b/src/ParamOutputImpl/Plot/ParameterData.cc @@ -4,6 +4,9 @@ * Created on: 10 déc. 2013 * Author: CS */ +#include +#include +#include #include "ParameterData.hh" #include "PlotLogger.hh" @@ -127,10 +130,10 @@ double ParameterData::getInterpolatedValue (double atTime, AMDA::Common::Paramet } // Interpolation required if (time >= atTime){ - if (firstSuperiorIndex == 0) { + if (firstSuperiorIndex == 0 || getValues(index, firstSuperiorIndex-1)== nullptr || getValues(index, firstSuperiorIndex)== nullptr ) { return nan(""); } - else { + else { double v1 = getValues (index, firstSuperiorIndex-1) [0]; double v2 = getValues (index, firstSuperiorIndex) [0]; double d1 = _dates [firstSuperiorIndex-1]; diff --git a/src/ParamOutputImpl/Plot/ParameterData.hh b/src/ParamOutputImpl/Plot/ParameterData.hh index 00ac9b4..f2c9e8d 100644 --- a/src/ParamOutputImpl/Plot/ParameterData.hh +++ b/src/ParamOutputImpl/Plot/ParameterData.hh @@ -111,7 +111,7 @@ public: * (index_) since from_ index. */ double* getValues(AMDA::Common::ParameterIndexComponent index_ = AMDA::Common::ParameterIndexComponent(-1,-1), int from_ = 0) { - if (_values.empty()) + if (_values.empty() || _values[componentToValuesIndex(index_)].noData()) return NULL; return _values[componentToValuesIndex(index_)].getValues(from_); } -- libgit2 0.21.2