Commit 3182799a856c5f07e777bc30088bcf4b7bf062c5

Authored by Benjamin Renard
1 parent f28f7c0e

Use param indexes for requests

src/InputOutput/IHMImpl/Params/DownloadImpl/IHMInputOutputParamsDownloadClass.php
... ... @@ -74,7 +74,29 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas
74 74 //add params to output
75 75 foreach ($input->list as $param)
76 76 {
77   - $paramInfo = $this->paramManager->addExistingParam($param,$this->paramsData);
  77 + $paramInfo = $this->paramManager->addExistingParam($param->name,$this->paramsData);
  78 + switch ($param->type) {
  79 + case 0:
  80 + //scalar - nothing to do
  81 + break;
  82 + case 1:
  83 + //Tab1D
  84 + if (isset($param->dim1) && ($param->dim1 != '') && ($param->dim1 != '*')) {
  85 + $paramInfo['indexes'] = array();
  86 + $paramInfo['indexes'][] = $param->dim1;
  87 + }
  88 + else if (isset($param->dim2) && ($param->dim2 != '') && ($param->dim2 != '*')) {
  89 + $paramInfo['indexes'] = array();
  90 + $paramInfo['indexes'][] = $param->dim2;
  91 + }
  92 + break;
  93 + case 2:
  94 + if (($param->dim1 != '*') || ($param->dim2 != '*')) {
  95 + $paramInfo['indexes'] = array();
  96 + $paramInfo['indexes'][] = "[".$param->dim1.",".$param->dim2."]";
  97 + }
  98 + break;
  99 + }
78 100 $downloadNode->addParam($paramInfo['id'],$paramInfo['indexes'],$paramInfo['calib_infos']);
79 101 $paramsNode->addParam($paramInfo['id']);
80 102 }
... ...
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -647,6 +647,34 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
647 647 {
648 648 //Param
649 649 $paramInfo = $this->paramManager->addExistingParam($paramData->{'param-id'},$this->paramsData);
  650 +
  651 + $paramInfo['indexes'] = array();
  652 + $dim1 = $paramData->{'param-dim-1'};
  653 + if ($dim1 == '')
  654 + $dim1 = '*';
  655 + $dim2 = $paramData->{'param-dim-2'};
  656 + if ($dim2 == '')
  657 + $dim2 = '*';
  658 + switch ($paramData->{'param-type'}) {
  659 + case 0:
  660 + //scalar - nothing to do
  661 + break;
  662 + case 1:
  663 + //Tab1D
  664 + if (isset($dim1) && ($dim1 != '*')) {
  665 + $paramInfo['indexes'][] = $dim1;
  666 + }
  667 + else if (isset($dim2) && ($dim2 != '*')) {
  668 + $paramInfo['indexes'][] = $dim2;
  669 + }
  670 + break;
  671 + case 2:
  672 + if (($dim1 != '*') || ($dim2 != '*')) {
  673 + $paramInfo['indexes'][] = "[".$dim1.",".$dim2."]";
  674 + }
  675 + break;
  676 + }
  677 +
650 678 $requestParamsNode->addParam($paramInfo['id']);
651 679  
652 680  
... ... @@ -958,7 +986,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
958 986  
959 987 protected function unmarshallSpectro($paramDrawingData, $plotNode, $paramNode, $indexes)
960 988 {
961   - $spectroNode = $paramNode->addSpectro($paramDrawingData->{'spectro-yaxis'}, $paramDrawingData->{'spectro-value-min'}, $paramDrawingData->{'spectro-value-max'});
  989 + $spectroNode = $paramNode->addSpectro($paramDrawingData->{'spectro-yaxis'}, count($indexes) > 0 ? $indexes[0] : NULL, $paramDrawingData->{'spectro-value-min'}, $paramDrawingData->{'spectro-value-max'});
962 990 }
963 991  
964 992 protected function unmarshallStatusBar($paramDrawingData, $paramNode, $indexes)
... ...
src/InputOutput/IHMImpl/Tools/IHMJobsManagerClass.php
... ... @@ -276,7 +276,7 @@ class IHMJobsManagerClass {
276 276 if ($obj->downloadSrc == '2') //fits image
277 277 $info = $info.' '.$param->url;
278 278 else
279   - $info = $info.' '.$param; //data
  279 + $info = $info.' '.$param->name; //data
280 280 }
281 281 break;
282 282 case 'request' :
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
... ... @@ -21,6 +21,7 @@ define ("REQUESTOUTPUTPLOTCOLORSERIE_INDEX", "index");
21 21  
22 22 define ("REQUESTOUTPUTPLOTSPECTRO_NAME", "spectro");
23 23 define ("REQUESTOUTPUTPLOTSPECTRO_YAXIS", "yAxis");
  24 +define ("REQUESTOUTPUTPLOTSPECTRO_INDEX", "index");
24 25 define ("REQUESTOUTPUTPLOTSPECTRO_MIN", "min");
25 26 define ("REQUESTOUTPUTPLOTSPECTRO_MAX", "max");
26 27  
... ... @@ -95,10 +96,12 @@ class RequestOutputPlotParamNodeClass extends NodeClass
95 96 return $iserieNode;
96 97 }
97 98  
98   - public function addSpectro($yAxis = "", $min = NULL, $max = NULL)
  99 + public function addSpectro($yAxis = "", $index = NULL, $min = NULL, $max = NULL)
99 100 {
100 101 $spectroNode = new NodeClass(REQUESTOUTPUTPLOTSPECTRO_NAME);
101 102 $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS, $yAxis);
  103 + if (isset($index))
  104 + $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_INDEX, $index);
102 105 if (isset($min))
103 106 $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN, $min);
104 107 if (isset($max))
... ... @@ -170,9 +173,10 @@ class RequestOutputPlotParamNodeClass extends NodeClass
170 173 break;
171 174 case REQUESTOUTPUTPLOTSPECTRO_NAME :
172 175 $yAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_YAXIS);
  176 + $index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_INDEX);
173 177 $min = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MIN);
174 178 $max = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MAX);
175   - $node = $this->addSpectro($yAxis, $min, $max);
  179 + $node = $this->addSpectro($yAxis, $index, $min, $max);
176 180 break;
177 181 case REQUESTOUTPUTPLOTXSERIE_NAME :
178 182 $xAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_XAXIS);
... ...