Commit e9b02dbfc0df272b23295a886445744c1ada0e02
1 parent
05f2d856
Exists in
master
and in
96 other branches
Fix parameters synchronisation in multi params process (#6288)
Showing
1 changed file
with
15 additions
and
13 deletions
Show diff stats
src/InternLib/MultiParamProcess.cc
... | ... | @@ -67,21 +67,23 @@ unsigned int MultiParamProcess::write() { |
67 | 67 | |
68 | 68 | unsigned int nbDataBeforeCallProcess = _paramData->getDataNumber(); |
69 | 69 | |
70 | - for (ParameterList::iterator itParam = _paramNameList.begin(); itParam != _paramNameList.end(); ++itParam) { | |
71 | - if (itParam->second.second._timeIntToProcessChanged && !_paramDataIndexInfo._timeIntToProcessChanged) | |
72 | - continue; | |
73 | - lNbTotalAvalaible = itParam->second.second._startIndex + itParam->second.second._nbDataToProcess; | |
74 | - if ( _paramDataIndexInfo._startIndex >= lNbTotalAvalaible) | |
75 | - { | |
76 | - LOG4CXX_DEBUG(_logger, "Need more data Parameter name: " << itParam->first ); | |
77 | - lResultList.push_back(make_pair(itParam,(*itParam->second.first).getAsync(this))); | |
70 | + if (_paramDataIndexInfo._timeIntToProcessChanged) { | |
71 | + for (ParameterList::iterator itParam = _paramNameList.begin(); itParam != _paramNameList.end(); ++itParam) { | |
72 | + LOG4CXX_DEBUG(_logger, "MultiParamProcess::write - New interval - Need more data for: " << itParam->first ); | |
73 | + (*itParam).second.second = (*itParam->second.first).getAsync(this).get(); | |
78 | 74 | } |
79 | 75 | } |
80 | - | |
81 | - // Wait data | |
82 | - for ( ParamDataIndexInfoFutureList::iterator it= lResultList.begin();it != lResultList.end(); ++it) { | |
83 | - LOG4CXX_DEBUG(_logger, "Wait data Parameter name: " << it->first->first ); | |
84 | - it->first->second.second=it->second.get(); | |
76 | + else { | |
77 | + for (ParameterList::iterator itParam = _paramNameList.begin(); itParam != _paramNameList.end(); ++itParam) { | |
78 | + if (itParam->second.second._timeIntToProcessChanged) { | |
79 | + continue; | |
80 | + } | |
81 | + lNbTotalAvalaible = itParam->second.second._startIndex + itParam->second.second._nbDataToProcess; | |
82 | + if ( _paramDataIndexInfo._startIndex >= lNbTotalAvalaible) { | |
83 | + LOG4CXX_DEBUG(_logger, "MultiParamProcess::write - Need more data for: " << itParam->first ); | |
84 | + (*itParam).second.second = (*itParam->second.first).getAsync(this).get(); | |
85 | + } | |
86 | + } | |
85 | 87 | } |
86 | 88 | |
87 | 89 | //compute minimum data available | ... | ... |