Commit a11fb6d3ca729436f0d92ccca63b12f703731285
1 parent
72d1e9e7
Exists in
master
and in
87 other branches
lol
Showing
2 changed files
with
32 additions
and
2 deletions
Show diff stats
src/Info/ParamInfo.cc
... | ... | @@ -6,6 +6,13 @@ |
6 | 6 | */ |
7 | 7 | |
8 | 8 | #include "ParamInfo.hh" |
9 | +#include "Parameter.hh" | |
10 | +#include <vector> | |
11 | +#include <string> | |
12 | +#include <algorithm> | |
13 | +#include <sstream> | |
14 | +#include <iterator> | |
15 | +#include <iostream> | |
9 | 16 | |
10 | 17 | namespace AMDA { |
11 | 18 | namespace Info { |
... | ... | @@ -43,7 +50,7 @@ std::ostream& operator<<(std::ostream& out, const ParamInfo& pi){ |
43 | 50 | |
44 | 51 | #define PUSHINFO(infoMap, key, value) if(!value.empty())infoMap.push_back(std::pair<std::string,std::string>(key,value)) |
45 | 52 | |
46 | -std::vector<std::pair<std::string,std::string>> ParamInfo::getInfoMap(ParameterManager *parameterManager) | |
53 | +std::vector<std::pair<std::string,std::string>> ParamInfo::getInfoMap(ParameterManager * parameterManager) | |
47 | 54 | { |
48 | 55 | std::vector<std::pair<std::string,std::string>> infoMap; |
49 | 56 | |
... | ... | @@ -126,7 +133,29 @@ std::vector<std::pair<std::string,std::string>> ParamInfo::getInfoMap(ParameterM |
126 | 133 | table.second->addTableInfo(parameterManager, table.first, infoMap); |
127 | 134 | } |
128 | 135 | } |
129 | - | |
136 | + //adjout des info de tables | |
137 | + ParameterSPtr param = parameterManager->getParameter(getId()); | |
138 | + std::map<std::string, boost::shared_ptr<std::vector<double>>> infoList =param->getInfoList(); | |
139 | + if(! infoList.empty()){ | |
140 | + for (auto inf : infoList){ | |
141 | + if(! inf.second->empty()){ | |
142 | + std::ostringstream values; | |
143 | + | |
144 | + // Convert all but the last element to avoid a trailing "," | |
145 | + std::copy(inf.second->begin(), inf.second->end()-1, | |
146 | + std::ostream_iterator<double>(values, ",")); | |
147 | + | |
148 | + // Now add the last element with no delimiter | |
149 | + values<< inf.second->back(); | |
150 | + std::stringstream infoKey; | |
151 | + infoKey.str(""); | |
152 | + infoKey << PARAMETER_INFO<< "[" << inf.first << "]"; | |
153 | + PUSHINFO(infoMap , infoKey.str() , values.str()); | |
154 | + | |
155 | + } | |
156 | + } | |
157 | + } | |
158 | + infoList.clear(); | |
130 | 159 | return infoMap; |
131 | 160 | } |
132 | 161 | ... | ... |
src/Info/ParamInfo.hh
... | ... | @@ -40,6 +40,7 @@ namespace Info { |
40 | 40 | #define PARAMETER_PROCESS_INFO "PARAMETER_PROCESS_INFO" |
41 | 41 | #define PARAMETER_PROCESS_DESC "PARAMETER_PROCESS_DESC" |
42 | 42 | #define PARAMETER_LINKED_PARAM "PARAMETER_LINKED_PARAMS" |
43 | +#define PARAMETER_INFO "PARAMETER_INFO" | |
43 | 44 | |
44 | 45 | /** |
45 | 46 | * @class ParamInfo | ... | ... |