Commit 2ae773901384dcb389ccdbbcdbc87d3498ce68d1

Authored by Hacene SI HADJ MOHAND
1 parent f18b22ea
Exists in 8295

index data ok

src/ParamOutputImpl/Plot/ParameterData.cc
... ... @@ -4,6 +4,9 @@
4 4 * Created on: 10 déc. 2013
5 5 * Author: CS
6 6 */
  7 +#include <fstream>
  8 +#include <iomanip>
  9 +#include <boost/lexical_cast.hpp>
7 10  
8 11 #include "ParameterData.hh"
9 12 #include "PlotLogger.hh"
... ... @@ -127,10 +130,10 @@ double ParameterData::getInterpolatedValue (double atTime, AMDA::Common::Paramet
127 130 }
128 131 // Interpolation required
129 132 if (time >= atTime){
130   - if (firstSuperiorIndex == 0) {
  133 + if (firstSuperiorIndex == 0 || getValues(index, firstSuperiorIndex-1)== nullptr || getValues(index, firstSuperiorIndex)== nullptr ) {
131 134 return nan("");
132 135 }
133   - else {
  136 + else {
134 137 double v1 = getValues (index, firstSuperiorIndex-1) [0];
135 138 double v2 = getValues (index, firstSuperiorIndex) [0];
136 139 double d1 = _dates [firstSuperiorIndex-1];
... ...
src/ParamOutputImpl/Plot/ParameterData.hh
... ... @@ -111,7 +111,7 @@ public:
111 111 * (index_) since from_ index.
112 112 */
113 113 double* getValues(AMDA::Common::ParameterIndexComponent index_ = AMDA::Common::ParameterIndexComponent(-1,-1), int from_ = 0) {
114   - if (_values.empty())
  114 + if (_values.empty() || _values[componentToValuesIndex(index_)].noData())
115 115 return NULL;
116 116 return _values[componentToValuesIndex(index_)].getValues(from_);
117 117 }
... ...