Commit 3182799a856c5f07e777bc30088bcf4b7bf062c5
1 parent
f28f7c0e
Exists in
master
and in
66 other branches
Use param indexes for requests
Showing
4 changed files
with
59 additions
and
5 deletions
Show diff stats
src/InputOutput/IHMImpl/Params/DownloadImpl/IHMInputOutputParamsDownloadClass.php
@@ -74,7 +74,29 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas | @@ -74,7 +74,29 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas | ||
74 | //add params to output | 74 | //add params to output |
75 | foreach ($input->list as $param) | 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 | $downloadNode->addParam($paramInfo['id'],$paramInfo['indexes'],$paramInfo['calib_infos']); | 100 | $downloadNode->addParam($paramInfo['id'],$paramInfo['indexes'],$paramInfo['calib_infos']); |
79 | $paramsNode->addParam($paramInfo['id']); | 101 | $paramsNode->addParam($paramInfo['id']); |
80 | } | 102 | } |
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -647,6 +647,34 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -647,6 +647,34 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
647 | { | 647 | { |
648 | //Param | 648 | //Param |
649 | $paramInfo = $this->paramManager->addExistingParam($paramData->{'param-id'},$this->paramsData); | 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 | $requestParamsNode->addParam($paramInfo['id']); | 678 | $requestParamsNode->addParam($paramInfo['id']); |
651 | 679 | ||
652 | 680 | ||
@@ -958,7 +986,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | @@ -958,7 +986,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass | ||
958 | 986 | ||
959 | protected function unmarshallSpectro($paramDrawingData, $plotNode, $paramNode, $indexes) | 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 | protected function unmarshallStatusBar($paramDrawingData, $paramNode, $indexes) | 992 | protected function unmarshallStatusBar($paramDrawingData, $paramNode, $indexes) |
src/InputOutput/IHMImpl/Tools/IHMJobsManagerClass.php
@@ -276,7 +276,7 @@ class IHMJobsManagerClass { | @@ -276,7 +276,7 @@ class IHMJobsManagerClass { | ||
276 | if ($obj->downloadSrc == '2') //fits image | 276 | if ($obj->downloadSrc == '2') //fits image |
277 | $info = $info.' '.$param->url; | 277 | $info = $info.' '.$param->url; |
278 | else | 278 | else |
279 | - $info = $info.' '.$param; //data | 279 | + $info = $info.' '.$param->name; //data |
280 | } | 280 | } |
281 | break; | 281 | break; |
282 | case 'request' : | 282 | case 'request' : |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
@@ -21,6 +21,7 @@ define ("REQUESTOUTPUTPLOTCOLORSERIE_INDEX", "index"); | @@ -21,6 +21,7 @@ define ("REQUESTOUTPUTPLOTCOLORSERIE_INDEX", "index"); | ||
21 | 21 | ||
22 | define ("REQUESTOUTPUTPLOTSPECTRO_NAME", "spectro"); | 22 | define ("REQUESTOUTPUTPLOTSPECTRO_NAME", "spectro"); |
23 | define ("REQUESTOUTPUTPLOTSPECTRO_YAXIS", "yAxis"); | 23 | define ("REQUESTOUTPUTPLOTSPECTRO_YAXIS", "yAxis"); |
24 | +define ("REQUESTOUTPUTPLOTSPECTRO_INDEX", "index"); | ||
24 | define ("REQUESTOUTPUTPLOTSPECTRO_MIN", "min"); | 25 | define ("REQUESTOUTPUTPLOTSPECTRO_MIN", "min"); |
25 | define ("REQUESTOUTPUTPLOTSPECTRO_MAX", "max"); | 26 | define ("REQUESTOUTPUTPLOTSPECTRO_MAX", "max"); |
26 | 27 | ||
@@ -95,10 +96,12 @@ class RequestOutputPlotParamNodeClass extends NodeClass | @@ -95,10 +96,12 @@ class RequestOutputPlotParamNodeClass extends NodeClass | ||
95 | return $iserieNode; | 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 | $spectroNode = new NodeClass(REQUESTOUTPUTPLOTSPECTRO_NAME); | 101 | $spectroNode = new NodeClass(REQUESTOUTPUTPLOTSPECTRO_NAME); |
101 | $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS, $yAxis); | 102 | $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS, $yAxis); |
103 | + if (isset($index)) | ||
104 | + $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_INDEX, $index); | ||
102 | if (isset($min)) | 105 | if (isset($min)) |
103 | $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN, $min); | 106 | $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN, $min); |
104 | if (isset($max)) | 107 | if (isset($max)) |
@@ -170,9 +173,10 @@ class RequestOutputPlotParamNodeClass extends NodeClass | @@ -170,9 +173,10 @@ class RequestOutputPlotParamNodeClass extends NodeClass | ||
170 | break; | 173 | break; |
171 | case REQUESTOUTPUTPLOTSPECTRO_NAME : | 174 | case REQUESTOUTPUTPLOTSPECTRO_NAME : |
172 | $yAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_YAXIS); | 175 | $yAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_YAXIS); |
176 | + $index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_INDEX); | ||
173 | $min = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MIN); | 177 | $min = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MIN); |
174 | $max = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MAX); | 178 | $max = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MAX); |
175 | - $node = $this->addSpectro($yAxis, $min, $max); | 179 | + $node = $this->addSpectro($yAxis, $index, $min, $max); |
176 | break; | 180 | break; |
177 | case REQUESTOUTPUTPLOTXSERIE_NAME : | 181 | case REQUESTOUTPUTPLOTXSERIE_NAME : |
178 | $xAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_XAXIS); | 182 | $xAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_XAXIS); |