Commit a40aa27895deadd718a5ad30038e3233d9b199a1
1 parent
a46daa71
Exists in
master
and in
94 other branches
Fix resampling
Showing
1 changed file
with
12 additions
and
4 deletions
Show diff stats
src/InternLib/Resampling.hh
... | ... | @@ -271,6 +271,7 @@ public: |
271 | 271 | } |
272 | 272 | } |
273 | 273 | if (pParamDataIndexInfo._timeIntToProcessChanged || pParamDataIndexInfo._noMoreTimeInt) { |
274 | +std::cout << "BRE - TERMINATED" << std::endl; | |
274 | 275 | terminated(); |
275 | 276 | } |
276 | 277 | } |
... | ... | @@ -279,19 +280,26 @@ public: |
279 | 280 | * @brief compute and write last value, right effect |
280 | 281 | */ |
281 | 282 | virtual void terminated() { |
283 | +std::cout << "BRE - A" << std::endl; | |
282 | 284 | if (_markerPtr->isFinished()) { |
285 | +std::cout << "BRE - B" << std::endl; | |
283 | 286 | return; |
284 | 287 | } |
285 | 288 | switch (_samplingMode) |
286 | 289 | { |
287 | 290 | case AVERAGE : |
288 | - if (!_mem.empty()) | |
289 | - { | |
290 | - _val = average(_mem,_paramInput.getDim1(),_paramInput.getDim2()); | |
291 | +std::cout << "BRE - C" << std::endl; | |
292 | + do { | |
293 | + if (!_mem.empty()) { | |
294 | + _val = average(_mem,_paramInput.getDim1(),_paramInput.getDim2()); | |
295 | + } | |
296 | + else { | |
297 | + _val << NotANumber(); | |
298 | + } | |
291 | 299 | _paramOutput->push(_val); |
292 | 300 | _paramDataOutput->pushTime(_markerPtr->getTargetTime()); |
293 | 301 | _mem.clear(); |
294 | - } | |
302 | + } while(_markerPtr->nextTarget()); | |
295 | 303 | break; |
296 | 304 | case INTERPOLATION : |
297 | 305 | case NEARESTVALUE : | ... | ... |