Commit 91acc36e3de72f88ec71cb37909d96ce1f9e83e4
1 parent
197552e8
Exists in
master
and in
94 other branches
Fix boxcar process (#6479)
Showing
1 changed file
with
6 additions
and
9 deletions
Show diff stats
src/ExternLib/Boxcar/Boxcar.hh
... | ... | @@ -43,16 +43,15 @@ public: |
43 | 43 | * @overload Operation::write(ParamDataIndexInfo &pParamDataIndexInfo) |
44 | 44 | */ |
45 | 45 | void write(ParamDataIndexInfo &pParamDataIndexInfo) { |
46 | - unsigned int index = pParamDataIndexInfo._startIndex; | |
47 | 46 | //first call |
48 | - if(_lastTime == 0.0) { | |
49 | - _lastTime = _paramInput.getTime(index); | |
47 | + if((_lastTime == 0.0) && (pParamDataIndexInfo._nbDataToProcess > 0)) { | |
48 | + _lastTime = _paramInput.getTime(pParamDataIndexInfo._startIndex); | |
50 | 49 | //To create a _sum with the good dimention |
51 | - _sum = _paramInput.getDataList()[index]; | |
50 | + _sum = _paramInput.getDataList()[pParamDataIndexInfo._startIndex]; | |
52 | 51 | _sum << elemNull; |
53 | 52 | } |
54 | - if(pParamDataIndexInfo._nbDataToProcess > 0) { | |
55 | - for (; index< pParamDataIndexInfo._startIndex + pParamDataIndexInfo._nbDataToProcess; index++) { | |
53 | + for (unsigned int index = pParamDataIndexInfo._startIndex; | |
54 | + index< pParamDataIndexInfo._startIndex + pParamDataIndexInfo._nbDataToProcess; index++) { | |
56 | 55 | if(_paramInput.getTime(index) - _lastTime >= _second) { |
57 | 56 | pushData(); |
58 | 57 | _lastTime = _paramInput.getTime(index); |
... | ... | @@ -61,9 +60,7 @@ public: |
61 | 60 | _sum =_sum + _paramInput.getDataList()[index]; |
62 | 61 | _timeMemory.push_back(_paramInput.getTime(index)); |
63 | 62 | } |
64 | - } | |
65 | - //pParamDataIndexInfo._nbDataToProcess == 0: end of Data | |
66 | - else { | |
63 | + if (pParamDataIndexInfo._timeIntToProcessChanged || pParamDataIndexInfo._noMoreTimeInt) { | |
67 | 64 | pushData(); |
68 | 65 | } |
69 | 66 | } | ... | ... |