Commit 72d1e9e79960d44b7c7da420ad9afaba111b8f89

Authored by Hacene SI HADJ MOHAND
1 parent f6e36c21

moitie de l'us

src/Info/ParamInfo.cc
... ... @@ -116,7 +116,7 @@ std::vector<std::pair<std::string,std::string>> ParamInfo::getInfoMap(ParameterM
116 116 if (_tables.empty())
117 117 {
118 118 //no table defined
119   - PUSHINFO(infoMap, PARAMETER_TABLE, std::string("None"));
  119 + //PUSHINFO(infoMap, PARAMETER_TABLE, std::string("None"));
120 120 }
121 121 else
122 122 {
... ...
src/Info/ParamInfo.hh
... ... @@ -252,15 +252,6 @@ public:
252 252 */
253 253 void addTable(int dim, boost::shared_ptr<ParamTable>& tableSPtr) {
254 254 _tables[dim] = tableSPtr;
255   -
256   -
257   - std::map<std::string, std::string>& tableParams=_tables[dim]-> getTableParameters();
258   - if(! tableParams.empty())
259   - for(auto linkedParam : tableParams){
260   - if(std::find(_linkedParamList.begin(), _linkedParamList.end(), linkedParam.second) == _linkedParamList.end()) {
261   - addLinkedParamId(linkedParam.second);
262   - }
263   - }
264 255 }
265 256  
266 257 /*
... ...
src/Info/ParamTable.cc
... ... @@ -124,11 +124,6 @@ std::map&lt;std::string, std::string&gt;&amp; ParamTable::getTableParams(ParameterManager*
124 124 return _tableParams;
125 125 }
126 126  
127   -std::map<std::string, std::string>& ParamTable::getTableParameters()
128   -{
129   - return _tableParams;
130   -}
131   -
132 127  
133 128 std::vector<double> ParamTable::getConstantTableParamValuesByKey(ParameterManager *parameterManager, std::string key)
134 129 {
... ... @@ -206,7 +201,7 @@ void ParamTable::addTableInfo(ParameterManager *parameterManager, int dim, std::
206 201 }
207 202 }
208 203  
209   -void ParamTable::addVariableTableInfo(ParameterManager */*parameterManager*/, int /*dim*/, std::vector<std::pair<std::string,std::string>>& /*tableInfo*/) {
  204 +void ParamTable::addVariableTableInfo(ParameterManager * /*parameterManager*/, int /*dim*/, std::vector<std::pair<std::string,std::string>>& /*tableInfo*/) {
210 205 }
211 206  
212 207 std::string ParamBoundsTable::_boundsParamKey = "TABLEPARAM_BOUNDS";
... ... @@ -523,6 +518,21 @@ t_TableBound ParamCenterAutoTable::getBound(ParameterManager *parameterManager,
523 518 return bound;
524 519 }
525 520  
  521 +void ParamCenterAutoTable::addVariableTableInfo(ParameterManager * parameterManager, int /*dim*/, std::vector<std::pair<std::string,std::string>>& tableInfo) {
  522 + std::map<std::string, std::string>& tableParams=this->getTableParams(parameterManager);
  523 + if(! tableParams.empty()){
  524 + std::stringstream infoKey;
  525 + int i=0;
  526 + for(auto linkedParam : tableParams){
  527 + infoKey.str("");
  528 + infoKey << VARIABLE_PARAMETER_TABLE << linkedParam.first << "[" << i<< "]";
  529 + PUSHINFO(tableInfo, infoKey.str(), linkedParam.second);
  530 + AMDA::Parameters::ParameterSPtr variableTableParam = parameterManager->getParameter(linkedParam.second);
  531 + i++;
  532 + }
  533 + }
  534 +}
  535 +
526 536 std::string ParamMinMaxTable::_minParamKey = "TABLEPARAM_MIN";
527 537 std::string ParamMinMaxTable::_maxParamKey = "TABLEPARAM_MAX";
528 538  
... ...
src/Info/ParamTable.hh
... ... @@ -16,6 +16,7 @@
16 16 #define PARAMETER_TABLE_UNITS "PARAMETER_TABLE_UNITS"
17 17 #define PARAMETER_TABLE_MINVAL "PARAMETER_TABLE_MIN_VALUES"
18 18 #define PARAMETER_TABLE_MAXVAL "PARAMETER_TABLE_MAX_VALUES"
  19 +#define VARIABLE_PARAMETER_TABLE "PARAMETER_TABLE_"
19 20  
20 21 namespace AMDA {
21 22 namespace Info {
... ... @@ -71,8 +72,6 @@ namespace Info {
71 72  
72 73 virtual std::map<std::string, std::string>& getTableParams(ParameterManager *parameterManager);
73 74  
74   - virtual std::map<std::string, std::string>& getTableParameters();
75   -
76 75 void addTableInfo(ParameterManager *parameterManager, int dim, std::vector<std::pair<std::string,std::string>>& infoMap);
77 76  
78 77 protected:
... ... @@ -170,6 +169,8 @@ namespace Info {
170 169 virtual int getSize(ParameterManager *parameterManager);
171 170  
172 171 virtual t_TableBound getBound(ParameterManager *parameterManager, unsigned int index, std::map<std::string, std::vector<double>>* paramsTableData = NULL);
  172 +
  173 + virtual void addVariableTableInfo(ParameterManager *parameterManager, int dim, std::vector<std::pair<std::string,std::string>>& infoMap);
173 174  
174 175 static std::string _centersParamKey;
175 176  
... ...
src/InternLib/MultiParamProcess.cc
... ... @@ -188,7 +188,24 @@ void MultiParamProcess::updateInfo(Parameter &amp; parameter)
188 188  
189 189 for (ParameterList::iterator itParam = _paramNameList.begin(); itParam != _paramNameList.end(); ++itParam)
190 190 paramInfo->addLinkedParamId(itParam->first);
191   -
  191 +
  192 + // adding tableParams into linked params
  193 + std::map<int, boost::shared_ptr<AMDA::Info::ParamTable>> tables =paramInfo->getTables();
  194 +
  195 + if(! tables.empty()){
  196 + for(auto table : tables){
  197 + ParameterManager * parameterManager;
  198 + if(table.second->isVariable(parameterManager)){
  199 + std::map<std::string, std::string> tableParams = table.second->getTableParams(parameterManager);
  200 + if(! tableParams.empty())
  201 + for(auto tableParam : tableParams){
  202 + paramInfo->addLinkedParamId(tableParam.second);
  203 + }
  204 + }
  205 +
  206 + }
  207 + }
  208 +
192 209 paramInfo->setProcessInfo(processInfo);
193 210  
194 211 std::string description = getDescription();
... ...
src/InternLib/SingleParamProcess.cc
... ... @@ -109,6 +109,23 @@ namespace AMDA {
109 109 processInfo += "'";
110 110  
111 111 paramInfo->addLinkedParamId(_parameterInput->getId());
  112 +
  113 + // adding tableParams into linked params
  114 + std::map<int, boost::shared_ptr<AMDA::Info::ParamTable>> tables =paramInfo->getTables();
  115 +
  116 + if(! tables.empty()){
  117 + for(auto table : tables){
  118 + ParameterManager * parameterManager;
  119 + if(table.second->isVariable(parameterManager)){
  120 + std::map<std::string, std::string> tableParams = table.second->getTableParams(parameterManager);
  121 + if(! tableParams.empty())
  122 + for(auto tableParam : tableParams){
  123 + paramInfo->addLinkedParamId(tableParam.second);
  124 + }
  125 + }
  126 +
  127 + }
  128 + }
112 129  
113 130 paramInfo->setProcessInfo(processInfo);
114 131 }
... ...