Commit c391ab452e69b5827e4cc26ea1763c70c8b6b320

Authored by Benjamin Renard
1 parent ad920fd6

computedGapSize of a resampled parameter cannot be lower than the sampling time

Showing 1 changed file with 9 additions and 2 deletions   Show diff stats
src/InternLib/ProcessSamplingClassic.cc
... ... @@ -53,10 +53,17 @@ TimeStamp ProcessSamplingClassic::init() {
53 53 }
54 54 double threshold = atof((++(_attributList.begin()))->c_str());
55 55  
56   - _parameter.setGapThreshold(threshold * _paramInput->getMinSampling() / sampling);
57   -
  56 + double newThreshold = threshold * _paramInput->getMinSampling() / sampling;
58 57 double computedGapSize = _parameterInput->getParameterManager().getComputedGapSize(threshold, _paramInput->getMinSampling());
59 58  
  59 + if (computedGapSize < sampling) {
  60 + //If computedGapSize < sampling, set computedGapSize to sampling value (else, each interval between data will be considered as a gap)
  61 + newThreshold = 1;
  62 + computedGapSize = sampling;
  63 + }
  64 +
  65 + _parameter.setGapThreshold(newThreshold);
  66 +
60 67 // ProcessSamplingClassic _operation creation
61 68 Resampling::CreateResampling lCreateResampling( *this, _timeIntervalList, sampling, computedGapSize, *_paramInput, _parameterInput->getDataWriterTemplate()->useNearestValue());
62 69 _operation = lCreateResampling.getResampling();
... ...