Commit e06e49a1c121097c5af17ce8365cf052b63771c7
1 parent
c38985ab
Exists in
master
and in
85 other branches
in progress
Showing
5 changed files
with
61 additions
and
12 deletions
Show diff stats
src/ExternLib/GetMavenStaticEnergy/GetMavenStaticEnergy.hh
... | ... | @@ -116,6 +116,23 @@ public: |
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
119 | + AMDA::Parameters::SemiVariableTable semiVariableTableElements; | |
120 | + for(int j =0; j<nbMass; j++){ | |
121 | + for(int i =0; i<nbEnergy; i++){ | |
122 | + std::string head ="Energy["+std::to_string(i)+","+to_string(j)+"]"; | |
123 | + semiVariableTableElements.tabHeader.push_back(head); | |
124 | + } | |
125 | + } | |
126 | + std::vector< double> values; | |
127 | + for(int k=0; k<nbSweep;k++){ | |
128 | + values.clear(); | |
129 | + for(int i=0; i<nbEnergy*nbMass; i++){ | |
130 | + std::string lebel="energy_"+std::to_string(i); | |
131 | + values.push_back((*lInfoList[lebel].get())[k]); | |
132 | + } | |
133 | + semiVariableTableElements.tabValues[k]=values; | |
134 | + } | |
135 | + pInput.setSemiVariableTable(semiVariableTableElements) ; | |
119 | 136 | } |
120 | 137 | |
121 | 138 | /** | ... | ... |
src/ExternLib/GetMavenStaticEnergy/GetMavenStaticEnergyProcess.cc
... | ... | @@ -52,8 +52,31 @@ TimeStamp GetMavenStaticEnergyProcess::init() { |
52 | 52 | _paramData->setMinSampling(_paramInput->getMinSampling()); |
53 | 53 | return timeStamp; |
54 | 54 | } |
55 | -AMDA::Parameters::SemiVariableTable GetMavenStaticEnergyProcess::getSemiVariableTable(){ | |
56 | - | |
55 | +void GetMavenStaticEnergyProcess::initSemiVariableTable(){ | |
56 | + AMDA::Parameters::SemiVariableTable semiVariableTableElements; | |
57 | + | |
58 | + Parameter::InfoList lInfoList = _parameterInput->getInfoList(); | |
59 | + int nbMass = (*lInfoList["nmass"].get())[0]; | |
60 | + int nbSweep = (*lInfoList["nswp"].get())[0]; | |
61 | + int nbEnergy = (*lInfoList["nenergy"].get())[0]; | |
62 | + | |
63 | + for(int j =0; j<nbMass; j++){ | |
64 | + for(int i =0; i<nbEnergy; i++){ | |
65 | + std::string head ="Energy["+std::to_string(i)+","+to_string(j)+"]"; | |
66 | + semiVariableTableElements.tabHeader.push_back(head); | |
67 | + } | |
68 | + } | |
69 | + std::vector< double> values; | |
70 | + for(int k=0; k<nbSweep;k++){ | |
71 | + values.clear(); | |
72 | + for(int i=0; i<nbEnergy*nbMass; i++){ | |
73 | + std::string lebel="energy_"+std::to_string(i); | |
74 | + values.push_back((*lInfoList[lebel].get())[k]); | |
75 | + } | |
76 | + semiVariableTableElements.tabValues[k]=values; | |
77 | + } | |
78 | + _parameterInput->setSemiVariableTable(semiVariableTableElements) ; | |
79 | + | |
57 | 80 | } |
58 | 81 | |
59 | 82 | } /* namespace MavenStatic */ | ... | ... |
src/ExternLib/GetMavenStaticEnergy/GetMavenStaticEnergyProcess.hh
src/Parameters/Parameter.hh
... | ... | @@ -36,6 +36,11 @@ typedef boost::shared_ptr<ParamData> ParamDataSPtr; |
36 | 36 | typedef boost::shared_ptr<DataClient> DataClientSPtr; |
37 | 37 | typedef boost::shared_ptr<DataWriter> DataWriterSPtr; |
38 | 38 | |
39 | +struct SemiVariableTable{ | |
40 | + std::vector<std::string> tabHeader; | |
41 | + std::map<int,std::vector<double>> tabValues; | |
42 | +}; | |
43 | + | |
39 | 44 | |
40 | 45 | /** |
41 | 46 | * AMDA::Parameters::Parameter |
... | ... | @@ -150,6 +155,13 @@ public: |
150 | 155 | } |
151 | 156 | |
152 | 157 | void delegateOtherTaskTo(ParameterSPtr& pParam); |
158 | + | |
159 | + AMDA::Parameters::SemiVariableTable getSemiVariableTable(){ | |
160 | + return _semiVariableTable; | |
161 | + } | |
162 | + void setSemiVariableTable(SemiVariableTable semiVariableTable){ | |
163 | + _semiVariableTable = semiVariableTable; | |
164 | + } | |
153 | 165 | |
154 | 166 | protected: |
155 | 167 | |
... | ... | @@ -219,6 +231,8 @@ protected: |
219 | 231 | * List of additional information |
220 | 232 | */ |
221 | 233 | InfoList _infoList; |
234 | + | |
235 | + SemiVariableTable _semiVariableTable; | |
222 | 236 | |
223 | 237 | private: |
224 | 238 | bool establishConnectionToDo; | ... | ... |
src/Parameters/Process.hh
... | ... | @@ -29,10 +29,7 @@ struct Process_exception: virtual AMDA_exception { }; |
29 | 29 | |
30 | 30 | class Operation; |
31 | 31 | |
32 | -struct SemiVariableTable{ | |
33 | - std::vector<std::string> tabHeader; | |
34 | - std::map<int,std::vector<double>> tabValues; | |
35 | -}; | |
32 | + | |
36 | 33 | |
37 | 34 | /** |
38 | 35 | * @class Process |
... | ... | @@ -93,10 +90,7 @@ public: |
93 | 90 | std::list<std::string> clbInfoList; |
94 | 91 | return clbInfoList; |
95 | 92 | } |
96 | - virtual AMDA::Parameters::SemiVariableTable getSemiVariableTable(){ | |
97 | - SemiVariableTable semiVariableTable; | |
98 | - return SemiVariableTable; | |
99 | - } | |
93 | + | |
100 | 94 | |
101 | 95 | protected: |
102 | 96 | static log4cxx::LoggerPtr _logger; |
... | ... | @@ -105,13 +99,14 @@ protected: |
105 | 99 | /** |
106 | 100 | * to store attribut of process write in _expression |
107 | 101 | */ |
108 | - AttributeList _attributList; | |
102 | + AttributeList _attributList; | |
109 | 103 | std::string _expression; |
110 | 104 | std::string _description; |
111 | 105 | Operation *_operation; |
112 | 106 | ParameterSPtr _refParameterSPtr; |
113 | 107 | double _gapThreshold; |
114 | 108 | bool _isUserProcess; |
109 | + SemiVariableTable _semiVariableTable; | |
115 | 110 | }; |
116 | 111 | |
117 | 112 | typedef boost::shared_ptr<Process> ProcessSPtr; | ... | ... |