Commit 71eaac9bfece882188c27a29e3361fc56056aba2
1 parent
4fe90834
Exists in
master
and in
66 other branches
Return default axes options for a ParamInfo request
Showing
2 changed files
with
50 additions
and
2 deletions
Show diff stats
src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php
@@ -248,9 +248,56 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface | @@ -248,9 +248,56 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface | ||
248 | return $result_data; | 248 | return $result_data; |
249 | } | 249 | } |
250 | 250 | ||
251 | + $axesNode = $plotNode->getAxes(); | ||
252 | + if (isset($axesNode)) { | ||
253 | + $result_data['axes'] = array(); | ||
254 | + | ||
255 | + $colorAxis = $axesNode->getColorAxis(); | ||
256 | + if (isset($colorAxis)) { | ||
257 | + $result_data['axes']['color'] = array(); | ||
258 | + $this->unmarshallAxisData($colorAxis, $result_data['axes']['color']); | ||
259 | + } | ||
260 | + | ||
261 | + $xAxis = $axesNode->getDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS, 'xaxis_id'); | ||
262 | + if (isset($xAxis)) { | ||
263 | + $result_data['axes']['xaxis_id'] = array(); | ||
264 | + $this->unmarshallAxisData($xAxis, $result_data['axes']['xaxis_id']); | ||
265 | + } | ||
266 | + | ||
267 | + $yLeftAxis = $axesNode->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS, 'y-left'); | ||
268 | + if (isset($yLeftAxis)) { | ||
269 | + $result_data['axes']['y-left'] = array(); | ||
270 | + $this->unmarshallAxisData($yLeftAxis, $result_data['axes']['y-left']); | ||
271 | + } | ||
272 | + | ||
273 | + $yRightAxis = $axesNode->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS, 'y-right'); | ||
274 | + if (isset($yRightAxis)) { | ||
275 | + $result_data['axes']['y-right'] = array(); | ||
276 | + $this->unmarshallAxisData($yRightAxis, $result_data['axes']['y-right']); | ||
277 | + } | ||
278 | + } | ||
279 | + | ||
251 | return $result_data; | 280 | return $result_data; |
252 | } | 281 | } |
253 | 282 | ||
283 | + private function unmarshallAxisData($axisNode, &$result_array) { | ||
284 | + if (!isset($axisNode)) | ||
285 | + return; | ||
286 | + | ||
287 | + $scale = $axisNode->getScale(); | ||
288 | + if (isset($scale)) | ||
289 | + $result_array['axis-scale'] = $scale; | ||
290 | + $rangeNode = $axisNode->getRange(); | ||
291 | + if (isset($rangeNode)) { | ||
292 | + $rangeMin = $rangeNode->getMin(); | ||
293 | + if (isset($rangeMin)) | ||
294 | + $result_array['axis-range-min'] = $rangeMin; | ||
295 | + $rangeMax = $rangeNode->getMax(); | ||
296 | + if (isset($rangeMax)) | ||
297 | + $result_array['axis-range-max'] = $rangeMax; | ||
298 | + } | ||
299 | + } | ||
300 | + | ||
254 | private function unmarshallSpectroData($drawNode, &$result_array) { | 301 | private function unmarshallSpectroData($drawNode, &$result_array) { |
255 | if (!isset($drawNode)) | 302 | if (!isset($drawNode)) |
256 | return; | 303 | return; |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxesNodeClass.php
@@ -131,9 +131,10 @@ class RequestOutputPlotAxesNodeClass extends NodeClass | @@ -131,9 +131,10 @@ class RequestOutputPlotAxesNodeClass extends NodeClass | ||
131 | $zaxisXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXES_ZAXIS); | 131 | $zaxisXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXES_ZAXIS); |
132 | if (isset($zaxisXmlNode)) | 132 | if (isset($zaxisXmlNode)) |
133 | { | 133 | { |
134 | - $colorXmlNode = $this->getXmlNodeChildByTagName($xaxisXmlNode, REQUESTOUTPUTPLOTCOLORAXIS_NAME); | ||
135 | - if (isset($colorXmlNode)) | 134 | + $colorXmlNode = $this->getXmlNodeChildByTagName($zaxisXmlNode, REQUESTOUTPUTPLOTCOLORAXIS_NAME); |
135 | + if (isset($colorXmlNode)) { | ||
136 | $this->getColorAxis()->loadFromNode($colorXmlNode); | 136 | $this->getColorAxis()->loadFromNode($colorXmlNode); |
137 | + } | ||
137 | } | 138 | } |
138 | } | 139 | } |
139 | } | 140 | } |