Commit 3995e067ff5836be3be2dbf33269606267cf5f2c

Authored by Benjamin Renard
2 parents ec574794 8a35f1e6

Merge branch 'master' into multiplot

src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php
... ... @@ -226,8 +226,8 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
226 226 $plotNode = $crtNode;
227 227 break;
228 228 }
229   -
230   - if (isset($plotNode)) {
  229 +
  230 + if (isset($plotNode)) {
231 231 $result_data['panel'] = array();
232 232 switch ($plotNode->getName()) {
233 233 case 'timePlot' :
... ... @@ -292,6 +292,7 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
292 292 }
293 293  
294 294 private function unmarshallDrawData($plotNode, $paramId) {
  295 +
295 296 $result_data = array();
296 297  
297 298 if (!isset($plotNode))
... ... @@ -301,7 +302,6 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
301 302  
302 303 if (!isset($paramsNode))
303 304 return $result_data;
304   -
305 305 if ($this->paramMgr->getTemplateParamsManager()->isTemplatedParam($paramId))
306 306 //Use templated parameter
307 307 $realParamId = $this->paramMgr->getTemplateParamsManager()->getTemplateFileName($paramId);
... ... @@ -309,13 +309,13 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
309 309 $realParamId = $paramId;
310 310  
311 311 $paramNode = $paramsNode->getParamById($realParamId);
312   -
  312 +
  313 +
313 314 if (!isset($paramNode) || (count($paramNode->getChildren()) < 1))
314 315 return $result_data;
315 316  
316 317 $mainDrawNode = NULL;
317 318 $otherDrawNodes = array();
318   -
319 319 foreach ($paramNode->getChildren() as $crtDrawNode) {
320 320 if (in_array($crtDrawNode->getName(), array('serie', 'spectro', 'yserie', 'orbitserie')))
321 321 $mainDrawNode = $crtDrawNode;
... ... @@ -325,7 +325,6 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
325 325  
326 326 if (!isset($mainDrawNode))
327 327 return $result_data;
328   -
329 328 switch ($mainDrawNode->getName()) {
330 329 case 'serie' :
331 330 if ($plotNode->getName() == 'statusPlot') {
... ... @@ -400,14 +399,24 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
400 399 $scale = $axisNode->getScale();
401 400 if (isset($scale))
402 401 $result_array['axis-scale'] = $scale;
  402 +
  403 + $showLegend = $axisNode->getShowLegend();
  404 + if (!empty($showLegend))
  405 + $result_array['axis-legend-activated'] = ($showLegend == "true");
  406 +
403 407 $rangeNode = $axisNode->getRange();
404 408 if (isset($rangeNode)) {
405 409 $rangeMin = $rangeNode->getMin();
406   - if (isset($rangeMin))
  410 + if (!empty($rangeMin))
407 411 $result_array['axis-range-min'] = $rangeMin;
  412 +
408 413 $rangeMax = $rangeNode->getMax();
409   - if (isset($rangeMax))
  414 + if (!empty($rangeMax))
410 415 $result_array['axis-range-max'] = $rangeMax;
  416 + $extend = $rangeNode->getExtend();
  417 + if (!empty($extend))
  418 + $result_array['axis-range-extend'] = ($extend == "true");
  419 +
411 420 }
412 421 }
413 422  
... ... @@ -430,6 +439,11 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
430 439 $uselog0asmin = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_USELOG0ASMIN);
431 440 if (!empty($uselog0asmin))
432 441 $result_array['spectro-log0-as-min'] = (strtolower($uselog0asmin) == "true");
  442 +
  443 +
  444 + $resolution = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_RESOLUTION);
  445 + if (!empty($resolution))
  446 + $result_array['spectro-resolution'] = $resolution;
433 447 }
434 448  
435 449 private function unmarshallAdditionalObjectsData($plotNode) {
... ... @@ -472,14 +486,29 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
472 486 private function unmarshallBaseSerieData($drawNode, &$result_array) {
473 487 if (!isset($drawNode))
474 488 return;
475   -
  489 +
476 490 $result_array['serie-id'] = $drawNode->getId();
477 491  
478 492 $result_array['serie-yaxis'] = $drawNode->getYAxisId();
479   -
  493 +
  494 + $resolution = $drawNode->getResolution();
  495 + if (!empty($resolution))
  496 + $result_array['serie-resolution'] = $resolution;
  497 +
  498 + $colorSerieId = $drawNode->getColorSerieId();
  499 + if (!empty($colorSerieId))
  500 + $result_array['serie-colored-param'] = $colorSerieId;
  501 +
480 502 if ($drawNode->isLineDefined()) {
  503 + $lineNode = $drawNode->getLine();
  504 + $lineType = $lineNode->getType();
  505 + if($lineType == RequestOutputPlotLineTypeEnum::NO){
  506 + $result_array['serie-lines-activated'] = false;
  507 + }
  508 + else{
481 509 $result_array['serie-lines-activated'] = true;
482 510 $this->unmarshallLineData($drawNode->getLine(), "serie-lines-", $result_array);
  511 + }
483 512 }
484 513  
485 514 if ($drawNode->isSymbolDefined()) {
... ... @@ -540,9 +569,17 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
540 569 }
541 570  
542 571 private function unmarshallLineData($lineNode, $prefix, &$result_array) {
543   - $result_array[$prefix.'style'] = $lineNode->getStyle();
544   - $result_array[$prefix.'width'] = $lineNode->getWidth();
545   - $result_array[$prefix.'color'] = $this->toHexColor($lineNode->getColor());
  572 + $lineStyle = $lineNode->getStyle();
  573 + if(!empty($lineStyle))
  574 + $result_array[$prefix.'style'] = $lineStyle;
  575 +
  576 + $lineWidth = $lineNode->getWidth();
  577 + if(!empty($lineWidth))
  578 + $result_array[$prefix.'width'] = $lineWidth;
  579 +
  580 + $lineColor = $lineNode->getColor();
  581 + if(!empty($lineColor))
  582 + $result_array[$prefix.'color'] = $this->toHexColor($lineColor);
546 583 }
547 584  
548 585 private function unmarshallSymbolData($symbolNode, $prefix, &$result_array) {
... ...
src/InputOutput/IHMImpl/Params/IHMInputOutputParamsAbstractClass.php
... ... @@ -267,14 +267,14 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface
267 267 if (isset($datasetNode)) {
268 268 $crtNode = $datasetNode;
269 269 do {
270   - if ($crtNode->hasAttribute("group") && !empty($crtNode->getAttribute("group"))) {
  270 + if ($crtNode->hasAttribute("group") && ($crtNode->getAttribute("group") != "")) {
271 271 $inGroup = TRUE;
272 272 }
273 273 $crtNode = $crtNode->parentNode;
274 274 } while(isset($crtNode) && ($crtNode != $xml->documentElement) && !$inGroup);
275 275 }
276 276 if ($inGroup) {
277   - if ($datasetNode->hasAttribute("timeRestriction") && !empty($datasetNode->getAttribute("timeRestriction"))) {
  277 + if ($datasetNode->hasAttribute("timeRestriction") && ($datasetNode->getAttribute("timeRestriction") != "")) {
278 278 $timeRestriction = $datasetNode->getAttribute("timeRestriction");
279 279 $this->paramsData->addParamTimeRestriction($key, $timeRestriction);
280 280 }
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotBaseSerieNodeClass.php
... ... @@ -7,6 +7,7 @@ require_once &quot;RequestOutputPlotSerieIntervalTicksNodeClass.php&quot;;
7 7  
8 8 define ("REQUESTOUTPUTPLOTBASESERIE_XAXIS", "xAxis");
9 9 define ("REQUESTOUTPUTPLOTBASESERIE_YAXIS", "yAxis");
  10 +define ("REQUESTOUTPUTPLOTBASESERIE_RESOLUTION", "resolution");
10 11 define ("REQUESTOUTPUTPLOTBASESERIE_COLORSERIEID", "colorSerieId");
11 12 define ("REQUESTOUTPUTPLOTBASESERIE_MIN", "min");
12 13 define ("REQUESTOUTPUTPLOTBASESERIE_MAX", "max");
... ... @@ -48,6 +49,16 @@ class RequestOutputPlotBaseSerieNodeClass extends NodeClass
48 49 return $this->getAttribute(REQUESTOUTPUTPLOTBASESERIE_YAXIS);
49 50 }
50 51  
  52 + public function setResolution($resolution)
  53 + {
  54 + $this->setAttribute(REQUESTOUTPUTPLOTBASESERIE_RESOLUTION, $resolution);
  55 + }
  56 +
  57 + public function getResolution()
  58 + {
  59 + return $this->getAttribute(REQUESTOUTPUTPLOTBASESERIE_RESOLUTION);
  60 + }
  61 +
51 62 public function setColorSerieId($colorSerieId)
52 63 {
53 64 $this->setAttribute(REQUESTOUTPUTPLOTBASESERIE_COLORSERIEID, $colorSerieId);
... ... @@ -171,8 +182,9 @@ class RequestOutputPlotBaseSerieNodeClass extends NodeClass
171 182 $this->setColorSerieId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_COLORSERIEID));
172 183 $this->setMin($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_MIN));
173 184 $this->setMax($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_MAX));
  185 + $this->setResolution($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_RESOLUTION));
174 186  
175   - $lineXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTBASESERIE_LINE);
  187 + $lineXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTBASESERIE_LINE);
176 188 if (isset($lineXmlNode))
177 189 $this->getLine()->loadFromNode($lineXmlNode);
178 190  
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLineNodeClass.php
... ... @@ -6,6 +6,7 @@ abstract class RequestOutputPlotLineTypeEnum
6 6 {
7 7 const NO = "no";
8 8 const LINE = "line";
  9 + const YES = "yes";
9 10 }
10 11  
11 12 /**
... ... @@ -27,7 +28,7 @@ class RequestOutputPlotLineNodeClass extends RequestOutputPlotCurveNodeClass
27 28  
28 29 public function getType()
29 30 {
30   - $this->getAttribute(REQUESTOUTPUTPLOTLINE_TYPE);
  31 + return $this->getAttribute(REQUESTOUTPUTPLOTLINE_TYPE);
31 32 }
32 33  
33 34 public function loadFromNode($xmlNode)
... ... @@ -37,4 +38,4 @@ class RequestOutputPlotLineNodeClass extends RequestOutputPlotCurveNodeClass
37 38 }
38 39 }
39 40  
40   -?>
41 41 \ No newline at end of file
  42 +?>
... ...
src/Request/ParamsRequestImpl/ParamsRequestClass.php
... ... @@ -66,7 +66,7 @@ class ParamsRequestClass extends ProcessRequestClass
66 66 foreach ($this->requestData->getRequestNodes() as $request_index => $requestNode)
67 67 {
68 68 //inject time restriction
69   - if (!empty($this->requestData->getParamsTimeRestrictions())) {
  69 + if (count($this->requestData->getParamsTimeRestrictions()) > 0) {
70 70 //Here
71 71 foreach ($this->requestData->getParamsTimeRestrictions() as $paramId => $timeRestriction)
72 72 {
... ...