Commit 1c0193a55a7e865e9a0adad9355f70f48ec82a1f

Authored by Benjamin Renard
1 parent a0aaa103

Implement variable table for instantPlot

config/DataBaseParameters/mav_sta_c0.xml
... ... @@ -9,7 +9,7 @@
9 9 <tensor_order>0</tensor_order>
10 10 <si_conversion></si_conversion>
11 11 <table>
12   - <centerAutoTable variable="true" name="Energy" units="eV" centerName="mav_sta_c0_energy" log="false"/>
  12 + <centerAutoTable variable="true" name="Energy" units="eV" centerName="mav_sta_c0_energy_mass0" log="false"/>
13 13 </table>
14 14 <fill_value>-1e+31</fill_value>
15 15 <ucd></ucd>
... ... @@ -17,7 +17,7 @@
17 17 </info>
18 18 <get>
19 19 <amdaParam name="mav_sta_c0_tab2d"/>
20   - <amdaParam name="mav_sta_c0_energy"/>
  20 + <amdaParam name="mav_sta_c0_energy_mass0"/>
21 21 </get>
22 22 <process description="Mass 0">$mav_sta_c0_tab2d[0].toVector()</process>
23 23 <output/>
... ...
config/DataBaseParameters/mav_sta_c0_energy.xml renamed to config/DataBaseParameters/mav_sta_c0_energy_mass0.xml
1 1 <?xml version="1.0"?>
2   -<param xml:id="mav_sta_c0_energy">
  2 +<param xml:id="mav_sta_c0_energy_mass0">
3 3 <get>
4 4 <vi name='mavpds:sta:c0'>
5 5 <baseParam name="swp_ind" useNearestValue="true">
... ... @@ -10,6 +10,6 @@
10 10 </baseParam>
11 11 </vi>
12 12 </get>
13   - <process description="MAVEN STATIC C0 Energy">#getMavenStaticEnergy($mavpds_sta_c0_swp_ind)</process>
  13 + <process description="MAVEN STATIC C0 Energy for Mass 0">#getMavenStaticEnergy($mavpds_sta_c0_swp_ind;0)</process>
14 14 <output/>
15   -</param>
16 15 \ No newline at end of file
  16 +</param>
... ...
config/DataBaseParameters/mav_sta_c6.xml
... ... @@ -9,7 +9,7 @@
9 9 <tensor_order>0</tensor_order>
10 10 <si_conversion></si_conversion>
11 11 <table>
12   - <centerAutoTable variable="true" name="Energy" units="eV" centerName="mav_sta_c6_energy" log="false"/>
  12 + <centerAutoTable variable="true" name="Energy" units="eV" centerName="mav_sta_c6_energy_mass0" log="false"/>
13 13 </table>
14 14 <fill_value>-1e+31</fill_value>
15 15 <ucd></ucd>
... ... @@ -17,7 +17,7 @@
17 17 </info>
18 18 <get>
19 19 <amdaParam name="mav_sta_c6_tab2d"/>
20   - <amdaParam name="mav_sta_c6_energy"/>
  20 + <amdaParam name="mav_sta_c6_energy_mass0"/>
21 21 </get>
22 22 <process description="Mass 0">$mav_sta_c6_tab2d[0].toVector()</process>
23 23 <output/>
... ...
config/DataBaseParameters/mav_sta_c6_energy.xml renamed to config/DataBaseParameters/mav_sta_c6_energy_mass0.xml
1 1 <?xml version="1.0"?>
2   -<param xml:id="mav_sta_c6_energy">
  2 +<param xml:id="mav_sta_c6_energy_mass0">
3 3 <get>
4 4 <vi name='mavpds:sta:c6'>
5 5 <baseParam name="swp_ind" useNearestValue="true">
... ... @@ -10,6 +10,6 @@
10 10 </baseParam>
11 11 </vi>
12 12 </get>
13   - <process description="MAVEN STATIC C6 Energy">#getMavenStaticEnergy($mavpds_sta_c6_swp_ind)</process>
  13 + <process description="MAVEN STATIC C6 Energy - Mass 0">#getMavenStaticEnergy($mavpds_sta_c6_swp_ind;0)</process>
14 14 <output/>
15   -</param>
16 15 \ No newline at end of file
  16 +</param>
... ...
src/ExternLib/GetMavenStaticEnergy/GetMavenStaticEnergy.hh
... ... @@ -11,6 +11,7 @@
11 11 #include "vector"
12 12  
13 13 #include <boost/algorithm/string.hpp>
  14 +#include <boost/lexical_cast.hpp>
14 15  
15 16 #include "AMDA_exception.hh"
16 17 #include "DicError.hh"
... ... @@ -75,23 +76,30 @@ public:
75 76 *
76 77 * @overload Base::GetMavenStaticEnergy::init()
77 78 */
78   - void init(Parameter& pInput, Process::AttributeList& /* pAttribute */) {
  79 + void init(Parameter& pInput, Process::AttributeList& pAttribute) {
79 80 Parameter::InfoList& lInfoList = pInput.getInfoList();
80 81  
81 82 int nbMass = (*lInfoList["nmass"].get())[0];
82 83 int nbSweep = (*lInfoList["nswp"].get())[0];
83 84 int nbEnergy = (*lInfoList["nenergy"].get())[0];
84 85  
  86 + int massIndex = 0;
  87 + try {
  88 + massIndex = boost::lexical_cast<int>( pAttribute[0] );
  89 + } catch( boost::bad_lexical_cast const& ) {
  90 + massIndex = 0;
  91 + }
  92 +
  93 + if (massIndex >= nbMass)
  94 + nbMass = 0;
  95 +
85 96 for (int i = 0; i < nbSweep; ++i)
86 97 {
87   - for (int j = 0; j < nbMass; ++j)
  98 + for (int k = 0; k < nbEnergy; ++k)
88 99 {
89   - for (int k = 0; k < nbEnergy; ++k)
90   - {
91   - std::string infoKey = "energy_";
92   - infoKey += std::to_string(j * nbEnergy + k);
93   - _energyList[i].push_back((*lInfoList[infoKey].get())[i]);
94   - }
  100 + std::string infoKey = "energy_";
  101 + infoKey += std::to_string(massIndex * nbEnergy + k);
  102 + _energyList[i].push_back((*lInfoList[infoKey].get())[i]);
95 103 }
96 104 }
97 105 }
... ...
src/ExternLib/GetMavenStaticEnergy/GetMavenStaticEnergyProcess.cc
... ... @@ -39,6 +39,12 @@ TimeStamp GetMavenStaticEnergyProcess::init() {
39 39 Parameter::InfoList lInfoList = _parameterInput->getInfoList();
40 40 _parameter.getInfoList().insert(lInfoList.begin(), lInfoList.end());
41 41 _paramInput = _parameterInput->getParamData(this).get();
  42 +
  43 + //GET Mass
  44 + if (_attributList.size() == 0) {
  45 + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("GetMavenStaticEnergyProcess::init required at least one attribute for mass'")));
  46 + }
  47 +
42 48 GetMavenStaticEnergyCreator lGetMavenStaticEnergyCreator(*this,*_paramInput);
43 49 _operation = lGetMavenStaticEnergyCreator.getOperation();
44 50 dynamic_cast<Base::GetMavenStaticEnergy*>(_operation)->init(*_parameterInput,_attributList);
... ...
src/ParamOutputImpl/Plot/InstantPlot/InstantPlot.cc
... ... @@ -46,6 +46,93 @@ void InstantPlot::createParameters(std::list&lt;std::string&gt;&amp; usedParametersId_) {
46 46  
47 47 // Force use of normalized parameter id
48 48 _originalParamId = originalParam->getId();
  49 +
  50 + AMDA::Info::ParamInfoSPtr paramInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(originalParam->getInfoId());
  51 +
  52 + if (paramInfo != nullptr)
  53 + {
  54 + if (_iSerieProperties != nullptr)
  55 + {
  56 + boost::shared_ptr<AMDA::Info::ParamTable> tableSPtr;
  57 +
  58 + if (paramInfo != nullptr)
  59 + tableSPtr = paramInfo->getTable(0);
  60 +
  61 + if ((tableSPtr != nullptr) && (tableSPtr->isVariable()))
  62 + {
  63 + for (std::map<std::string, std::string>::iterator it = tableSPtr->getTableParams().begin(); it != tableSPtr->getTableParams().end(); ++it)
  64 + {
  65 + std::string tableParamKey = it->first;
  66 + std::string tableParamName = it->second;
  67 +
  68 + AMDA::Parameters::ParameterSPtr originalTableParam = _parameterManager.getParameter(tableParamName);
  69 + _iSerieProperties->addTableParam(tableParamKey, originalTableParam->getId());
  70 + }
  71 +
  72 + //Add table parameters to parameters list
  73 + for (std::map<std::string, std::string>::iterator it = _iSerieProperties->getTableParams().begin(); it != _iSerieProperties->getTableParams().end(); ++it)
  74 + {
  75 + std::string tableParamId = it->second;
  76 +
  77 + if (std::find (usedParametersId_.begin(),usedParametersId_.end(),tableParamId) == usedParametersId_.end())
  78 + usedParametersId_.push_back(tableParamId);
  79 + }
  80 + }
  81 + }
  82 + else if (_iSpectroProperties != nullptr)
  83 + {
  84 + boost::shared_ptr<AMDA::Info::ParamTable> table0SPtr;
  85 + boost::shared_ptr<AMDA::Info::ParamTable> table1SPtr;
  86 +
  87 + if (paramInfo != nullptr)
  88 + {
  89 + table0SPtr = paramInfo->getTable(0);
  90 + table1SPtr = paramInfo->getTable(1);
  91 + }
  92 +
  93 + if ((table0SPtr != nullptr) && table0SPtr->isVariable())
  94 + {
  95 + for (std::map<std::string, std::string>::iterator it = table0SPtr->getTableParams().begin(); it != table0SPtr->getTableParams().end(); ++it)
  96 + {
  97 + std::string tableParamKey = it->first;
  98 + std::string tableParamName = it->second;
  99 +
  100 + AMDA::Parameters::ParameterSPtr originalTableParam = _parameterManager.getParameter(tableParamName);
  101 + _iSpectroProperties->addTable0Param(tableParamKey, originalTableParam->getId());
  102 + }
  103 +
  104 + //Add table parameters to parameters list
  105 + for (std::map<std::string, std::string>::iterator it = _iSpectroProperties->getTable0Params().begin(); it != _iSpectroProperties->getTable0Params().end(); ++it)
  106 + {
  107 + std::string tableParamId = it->second;
  108 +
  109 + if (std::find (usedParametersId_.begin(),usedParametersId_.end(),tableParamId) == usedParametersId_.end())
  110 + usedParametersId_.push_back(tableParamId);
  111 + }
  112 + }
  113 +
  114 + if ((table1SPtr != nullptr) && table1SPtr->isVariable())
  115 + {
  116 + for (std::map<std::string, std::string>::iterator it = table1SPtr->getTableParams().begin(); it != table1SPtr->getTableParams().end(); ++it)
  117 + {
  118 + std::string tableParamKey = it->first;
  119 + std::string tableParamName = it->second;
  120 +
  121 + AMDA::Parameters::ParameterSPtr originalTableParam = _parameterManager.getParameter(tableParamName);
  122 + _iSpectroProperties->addTable1Param(tableParamKey, originalTableParam->getId());
  123 + }
  124 +
  125 + //Add table parameters to parameters list
  126 + for (std::map<std::string, std::string>::iterator it = _iSpectroProperties->getTable1Params().begin(); it != _iSpectroProperties->getTable1Params().end(); ++it)
  127 + {
  128 + std::string tableParamId = it->second;
  129 +
  130 + if (std::find (usedParametersId_.begin(),usedParametersId_.end(),tableParamId) == usedParametersId_.end())
  131 + usedParametersId_.push_back(tableParamId);
  132 + }
  133 + }
  134 + }
  135 + }
49 136 }
50 137  
51 138 /**
... ... @@ -180,7 +267,9 @@ void InstantPlot::getSerieParameterValues(int serieId, double **xValues, double
180 267 paramTable = paramInfo->getTable(0);
181 268  
182 269 ParameterData& paramData = (*_pParameterValues)[_originalParamId];
183   - *nbValues = paramData._indexes.size();
  270 +
  271 +
  272 + *nbValues = paramData.getDim1Size();
184 273  
185 274 // Build valueData and tableData
186 275 double valueData[*nbValues];
... ... @@ -193,15 +282,33 @@ void InstantPlot::getSerieParameterValues(int serieId, double **xValues, double
193 282 AMDA::Info::t_TableBound crtBound;
194 283  
195 284 for (int i = 0; i < *nbValues; ++i) {
196   - double value = paramData.getInterpolatedValue(_time, i);
  285 + double value = paramData.getInterpolatedValue(_time, AMDA::Common::ParameterIndexComponent(i));
197 286  
198 287 valueData[i] = value;
199 288 valueMin = std::min (valueMin,value);
200 289 valueMax = std::max (valueMax,value);
201 290  
202 291 if (paramTable) {
203   - crtBound = paramTable->getBound(&_parameterManager, i);
204   - tableValue = (crtBound.min + crtBound.max) /2;;
  292 + if (!paramTable->isVariable())
  293 + crtBound = paramTable->getBound(&_parameterManager, i);
  294 + else
  295 + {
  296 + std::map<std::string, std::vector<double>> paramsTableData;
  297 + for (std::map<std::string, std::string>::iterator it = _iSerieProperties->getTableParams().begin(); it != _iSerieProperties->getTableParams().end(); ++it)
  298 + {
  299 + ParameterData& data = (*_pParameterValues)[it->second];
  300 + double valIdx = data.indexOf(_time);
  301 + std::vector<double> paramTableValues;
  302 + for (int j = 0; j < data.getDim1Size(); ++j)
  303 + {
  304 + double* values = data.getValues(AMDA::Common::ParameterIndexComponent(j), valIdx);
  305 + paramTableValues.push_back((*values));
  306 + }
  307 + paramsTableData[it->first] = paramTableValues;
  308 + }
  309 + crtBound = paramTable->getBound(&_parameterManager, i, &paramsTableData);
  310 + }
  311 + tableValue = (crtBound.min + crtBound.max) /2;
205 312 } else {
206 313 tableValue = i;
207 314 }
... ... @@ -648,19 +755,71 @@ void InstantPlot::configureTableAxis (boost::shared_ptr&lt;Axis&gt; axisSPtr, bool isS
648 755 } else {
649 756 AMDA::Info::t_TableBound crtBound;
650 757  
651   - for (int i = 0; i < dimSize; ++i)
  758 + if (!tableSPtr->isVariable())
652 759 {
653   - crtBound = tableSPtr->getBound(&_parameterManager, i);
654   -
  760 + for (int i = 0; i < dimSize; ++i)
  761 + {
  762 + crtBound = tableSPtr->getBound(&_parameterManager, i);
  763 +
  764 + if (isSpectro)
  765 + {
  766 + lAxisRange.setMin(std::min(crtBound.min,lAxisRange.getMin()));
  767 + lAxisRange.setMax(std::max(crtBound.max,lAxisRange.getMax()));
  768 + }
  769 + else
  770 + {
  771 + lAxisRange.setMin(std::min((crtBound.min+ crtBound.max) / 2.0,lAxisRange.getMin()));
  772 + lAxisRange.setMax(std::max((crtBound.min+ crtBound.max) / 2.0,lAxisRange.getMax()));
  773 + }
  774 + }
  775 + }
  776 + else
  777 + {
  778 + std::map<std::string, std::string> relatedTableParam;
655 779 if (isSpectro)
656 780 {
657   - lAxisRange.setMin(std::min(crtBound.min,lAxisRange.getMin()));
658   - lAxisRange.setMax(std::max(crtBound.max,lAxisRange.getMax()));
  781 + switch (relatedDim)
  782 + {
  783 + case 0 :
  784 + relatedTableParam = _iSpectroProperties->getTable0Params();
  785 + break;
  786 + case 1 :
  787 + relatedTableParam = _iSpectroProperties->getTable1Params();
  788 + break;
  789 + }
659 790 }
660 791 else
661 792 {
662   - lAxisRange.setMin(std::min((crtBound.min+ crtBound.max) / 2.0,lAxisRange.getMin()));
663   - lAxisRange.setMax(std::max((crtBound.min+ crtBound.max) / 2.0,lAxisRange.getMax()));
  793 + relatedTableParam = _iSerieProperties->getTableParams();
  794 + }
  795 +
  796 + std::map<std::string, std::vector<double>> paramsTableData;
  797 + for (std::map<std::string, std::string>::iterator it = relatedTableParam.begin(); it != relatedTableParam.end(); ++it)
  798 + {
  799 + ParameterData& data = (*_pParameterValues)[it->second];
  800 + double valIdx = data.indexOf(_time);
  801 + std::vector<double> paramTableValues;
  802 + for (int i = 0; i < data.getDim1Size(); ++i)
  803 + {
  804 + double* values = data.getValues(AMDA::Common::ParameterIndexComponent(i), valIdx);
  805 + paramTableValues.push_back((*values));
  806 + }
  807 + paramsTableData[it->first] = paramTableValues;
  808 + }
  809 +
  810 + for (int i = 0; i < dimSize; ++i)
  811 + {
  812 + crtBound = tableSPtr->getBound(&_parameterManager, i, &paramsTableData);
  813 + if (isSpectro)
  814 + {
  815 + lAxisRange.setMin(std::min(crtBound.min,lAxisRange.getMin()));
  816 + lAxisRange.setMax(std::max(crtBound.max,lAxisRange.getMax()));
  817 + }
  818 + else
  819 + {
  820 + lAxisRange.setMin(std::min((crtBound.min+ crtBound.max) / 2.0,lAxisRange.getMin()));
  821 + lAxisRange.setMax(std::max((crtBound.min+ crtBound.max) / 2.0,lAxisRange.getMax()));
  822 + }
664 823 }
665 824 }
666 825 }
... ... @@ -887,8 +1046,29 @@ void InstantPlot::drawSpectro(double startDate, double stopDate, std::string pPa
887 1046 }
888 1047 else
889 1048 {
890   - part.x[0] = tableXSPtr->getBound(&_parameterManager, i).min;
891   - part.x[1] = tableXSPtr->getBound(&_parameterManager, i).max;
  1049 + if (!tableXSPtr->isVariable())
  1050 + {
  1051 + part.x[0] = tableXSPtr->getBound(&_parameterManager, i).min;
  1052 + part.x[1] = tableXSPtr->getBound(&_parameterManager, i).max;
  1053 + }
  1054 + else
  1055 + {
  1056 + std::map<std::string, std::vector<double>> paramsTableData;
  1057 + for (std::map<std::string, std::string>::iterator it = _iSpectroProperties->getTable0Params().begin(); it != _iSpectroProperties->getTable0Params().end(); ++it)
  1058 + {
  1059 + ParameterData& data = (*_pParameterValues)[it->second];
  1060 + double valIdx = data.indexOf(_time);
  1061 + std::vector<double> paramTableValues;
  1062 + for (int j = 0; j < data.getDim1Size(); ++j)
  1063 + {
  1064 + double* values = data.getValues(AMDA::Common::ParameterIndexComponent(j), valIdx);
  1065 + paramTableValues.push_back((*values));
  1066 + }
  1067 + paramsTableData[it->first] = paramTableValues;
  1068 + }
  1069 + part.x[0] = tableXSPtr->getBound(&_parameterManager, i, &paramsTableData).min;
  1070 + part.x[1] = tableXSPtr->getBound(&_parameterManager, i, &paramsTableData).max;
  1071 + }
892 1072 }
893 1073 }
894 1074 else
... ... @@ -901,8 +1081,29 @@ void InstantPlot::drawSpectro(double startDate, double stopDate, std::string pPa
901 1081 }
902 1082 else
903 1083 {
904   - part.y[0] = tableYSPtr->getBound(&_parameterManager, i).min;
905   - part.y[1] = tableYSPtr->getBound(&_parameterManager, i).max;
  1084 + if (!tableYSPtr->isVariable())
  1085 + {
  1086 + part.y[0] = tableYSPtr->getBound(&_parameterManager, i).min;
  1087 + part.y[1] = tableYSPtr->getBound(&_parameterManager, i).max;
  1088 + }
  1089 + else
  1090 + {
  1091 + std::map<std::string, std::vector<double>> paramsTableData;
  1092 + for (std::map<std::string, std::string>::iterator it = _iSpectroProperties->getTable0Params().begin(); it != _iSpectroProperties->getTable0Params().end(); ++it)
  1093 + {
  1094 + ParameterData& data = (*_pParameterValues)[it->second];
  1095 + double valIdx = data.indexOf(_time);
  1096 + std::vector<double> paramTableValues;
  1097 + for (int j = 0; j < data.getDim1Size(); ++j)
  1098 + {
  1099 + double* values = data.getValues(AMDA::Common::ParameterIndexComponent(j), valIdx);
  1100 + paramTableValues.push_back((*values));
  1101 + }
  1102 + paramsTableData[it->first] = paramTableValues;
  1103 + }
  1104 + part.y[0] = tableXSPtr->getBound(&_parameterManager, i, &paramsTableData).min;
  1105 + part.y[1] = tableXSPtr->getBound(&_parameterManager, i, &paramsTableData).max;
  1106 + }
906 1107 }
907 1108 }
908 1109  
... ... @@ -918,8 +1119,29 @@ void InstantPlot::drawSpectro(double startDate, double stopDate, std::string pPa
918 1119 }
919 1120 else
920 1121 {
921   - part.y[0] = tableYSPtr->getBound(&_parameterManager, j).min;
922   - part.y[1] = tableYSPtr->getBound(&_parameterManager, j).max;
  1122 + if (!tableYSPtr->isVariable())
  1123 + {
  1124 + part.y[0] = tableYSPtr->getBound(&_parameterManager, j).min;
  1125 + part.y[1] = tableYSPtr->getBound(&_parameterManager, j).max;
  1126 + }
  1127 + else
  1128 + {
  1129 + std::map<std::string, std::vector<double>> paramsTableData;
  1130 + for (std::map<std::string, std::string>::iterator it = _iSpectroProperties->getTable1Params().begin(); it != _iSpectroProperties->getTable1Params().end(); ++it)
  1131 + {
  1132 + ParameterData& data = (*_pParameterValues)[it->second];
  1133 + double valIdx = data.indexOf(_time);
  1134 + std::vector<double> paramTableValues;
  1135 + for (int i = 0; i < data.getDim1Size(); ++i)
  1136 + {
  1137 + double* values = data.getValues(AMDA::Common::ParameterIndexComponent(i), valIdx);
  1138 + paramTableValues.push_back((*values));
  1139 + }
  1140 + paramsTableData[it->first] = paramTableValues;
  1141 + }
  1142 + part.y[0] = tableYSPtr->getBound(&_parameterManager, j, &paramsTableData).min;
  1143 + part.y[1] = tableYSPtr->getBound(&_parameterManager, j, &paramsTableData).max;
  1144 + }
923 1145 }
924 1146 }
925 1147 else
... ... @@ -931,8 +1153,29 @@ void InstantPlot::drawSpectro(double startDate, double stopDate, std::string pPa
931 1153 }
932 1154 else
933 1155 {
934   - part.x[0] = tableXSPtr->getBound(&_parameterManager, j).min;
935   - part.x[1] = tableXSPtr->getBound(&_parameterManager, j).max;
  1156 + if (!tableYSPtr->isVariable())
  1157 + {
  1158 + part.x[0] = tableXSPtr->getBound(&_parameterManager, j).min;
  1159 + part.x[1] = tableXSPtr->getBound(&_parameterManager, j).max;
  1160 + }
  1161 + else
  1162 + {
  1163 + std::map<std::string, std::vector<double>> paramsTableData;
  1164 + for (std::map<std::string, std::string>::iterator it = _iSpectroProperties->getTable1Params().begin(); it != _iSpectroProperties->getTable1Params().end(); ++it)
  1165 + {
  1166 + ParameterData& data = (*_pParameterValues)[it->second];
  1167 + double valIdx = data.indexOf(_time);
  1168 + std::vector<double> paramTableValues;
  1169 + for (int i = 0; i < data.getDim1Size(); ++i)
  1170 + {
  1171 + double* values = data.getValues(AMDA::Common::ParameterIndexComponent(i), valIdx);
  1172 + paramTableValues.push_back((*values));
  1173 + }
  1174 + paramsTableData[it->first] = paramTableValues;
  1175 + }
  1176 + part.x[0] = tableYSPtr->getBound(&_parameterManager, j, &paramsTableData).min;
  1177 + part.x[1] = tableYSPtr->getBound(&_parameterManager, j, &paramsTableData).max;
  1178 + }
936 1179 }
937 1180 }
938 1181  
... ...
src/ParamOutputImpl/Plot/InstantPlot/InstantSeriesProperties.hh
... ... @@ -26,25 +26,29 @@ public:
26 26 InstantSeriesProperties() :
27 27 SeriesProperties(),
28 28 _tableOnXAxis(true),
29   - _id(-1) {
  29 + _id(-1),
  30 + _tableParamsId() {
30 31 }
31 32 InstantSeriesProperties(const SeriesProperties& ref_) :
32 33 SeriesProperties(ref_),
33 34 _tableOnXAxis(true),
34   - _id(-1)
  35 + _id(-1),
  36 + _tableParamsId()
35 37 {
36 38 }
37 39  
38 40 InstantSeriesProperties(const InstantSeriesProperties& pParamDrawingProperties_) :
39 41 SeriesProperties(pParamDrawingProperties_),
40 42 _tableOnXAxis(pParamDrawingProperties_._tableOnXAxis),
41   - _id(pParamDrawingProperties_._id)
  43 + _id(pParamDrawingProperties_._id),
  44 + _tableParamsId(pParamDrawingProperties_._tableParamsId)
42 45 {
43 46 }
44 47  
45 48 InstantSeriesProperties& operator=(const InstantSeriesProperties& ref_) {
46 49 SeriesProperties::operator=(ref_);
47 50 _tableOnXAxis = ref_._tableOnXAxis;
  51 + _tableParamsId = ref_._tableParamsId;
48 52 _id = ref_._id;
49 53 return *this;
50 54 }
... ... @@ -69,6 +73,18 @@ public:
69 73 _id = id;
70 74 }
71 75  
  76 + std::string getTableParamIdByName(std::string paramName){
  77 + return _tableParamsId[paramName];
  78 + }
  79 +
  80 + std::map<std::string, std::string>& getTableParams() {
  81 + return _tableParamsId;
  82 + }
  83 +
  84 + void addTableParam(std::string paramName, std::string paramId) {
  85 + _tableParamsId[paramName] = paramId;
  86 + }
  87 +
72 88 /*
73 89 * Dumps properties for test.
74 90 */
... ... @@ -85,6 +101,11 @@ private :
85 101 * @brief Serie identifier used by the fill element
86 102 */
87 103 int _id;
  104 +
  105 + /**
  106 + * @brief Calculated tableParamsId (from resolution).
  107 + */
  108 + std::map<std::string, std::string> _tableParamsId;
88 109 };
89 110  
90 111 } /* namespace plot */
... ...
src/ParamOutputImpl/Plot/InstantPlot/InstantSpectroProperties.hh
... ... @@ -25,23 +25,31 @@ class InstantSpectroProperties: public SpectroProperties {
25 25 public:
26 26 InstantSpectroProperties() :
27 27 SpectroProperties(),
28   - _dimOnXAxis(0) {
  28 + _dimOnXAxis(0),
  29 + _table0ParamsId(),
  30 + _table1ParamsId() {
29 31 }
30 32 InstantSpectroProperties(const SpectroProperties& ref_) :
31 33 SpectroProperties(ref_),
32   - _dimOnXAxis(0)
  34 + _dimOnXAxis(0),
  35 + _table0ParamsId(),
  36 + _table1ParamsId()
33 37 {
34 38 }
35 39  
36 40 InstantSpectroProperties(const InstantSpectroProperties& pParamDrawingProperties_) :
37 41 SpectroProperties(pParamDrawingProperties_),
38   - _dimOnXAxis(pParamDrawingProperties_._dimOnXAxis)
  42 + _dimOnXAxis(pParamDrawingProperties_._dimOnXAxis),
  43 + _table0ParamsId(),
  44 + _table1ParamsId()
39 45 {
40 46 }
41 47  
42 48 InstantSpectroProperties& operator=(const InstantSpectroProperties& ref_) {
43 49 SpectroProperties::operator=(ref_);
44 50 _dimOnXAxis = ref_._dimOnXAxis;
  51 + _table0ParamsId = ref_._table0ParamsId;
  52 + _table1ParamsId = ref_._table1ParamsId;
45 53 return *this;
46 54 }
47 55  
... ... @@ -57,6 +65,30 @@ public:
57 65 _dimOnXAxis = dimOnXAxis;
58 66 }
59 67  
  68 + std::string getTable0ParamIdByName(std::string paramName){
  69 + return _table0ParamsId[paramName];
  70 + }
  71 +
  72 + std::map<std::string, std::string>& getTable0Params() {
  73 + return _table0ParamsId;
  74 + }
  75 +
  76 + void addTable0Param(std::string paramName, std::string paramId) {
  77 + _table0ParamsId[paramName] = paramId;
  78 + }
  79 +
  80 + std::string getTable1ParamIdByName(std::string paramName){
  81 + return _table1ParamsId[paramName];
  82 + }
  83 +
  84 + std::map<std::string, std::string>& getTable1Params() {
  85 + return _table1ParamsId;
  86 + }
  87 +
  88 + void addTable1Param(std::string paramName, std::string paramId) {
  89 + _table1ParamsId[paramName] = paramId;
  90 + }
  91 +
60 92 /*
61 93 * Dumps properties for test.
62 94 */
... ... @@ -68,6 +100,16 @@ private :
68 100 * dimension to draw on X Axis
69 101 */
70 102 int _dimOnXAxis;
  103 +
  104 + /**
  105 + * @brief Calculated tableParamsId for dimension 0 (from resolution).
  106 + */
  107 + std::map<std::string, std::string> _table0ParamsId;
  108 +
  109 + /**
  110 + * @brief Calculated tableParamsId for dimension 1 (from resolution).
  111 + */
  112 + std::map<std::string, std::string> _table1ParamsId;
71 113 };
72 114  
73 115 } /* namespace plot */
... ...
src/ParamOutputImpl/Plot/PanelPlotOutput.cc
... ... @@ -1377,7 +1377,10 @@ bool PanelPlotOutput::getColoredValue(double value, double filterMin, double fil
1377 1377 correctedValue = log10(correctedValue);
1378 1378 }
1379 1379  
1380   - col=(correctedValue-r.getMin())/(r.getMax() - r.getMin());
  1380 + if (!lZAxis->_reverse)
  1381 + col=(correctedValue-r.getMin())/(r.getMax() - r.getMin());
  1382 + else
  1383 + col=(correctedValue-r.getMax())/(r.getMin() - r.getMax());
1381 1384  
1382 1385 return true;
1383 1386 }
... ...