From 2ae773901384dcb389ccdbbcdbc87d3498ce68d1 Mon Sep 17 00:00:00 2001 From: Hacene SI HADJ MOHAND Date: Thu, 5 Nov 2020 14:56:07 +0100 Subject: [PATCH] index data ok --- src/ParamOutputImpl/Plot/ParameterData.cc | 7 +++++-- src/ParamOutputImpl/Plot/ParameterData.hh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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