Commit fe1a8ddd101edc0cdfcc4b19f4645f230dc9b152

Authored by Erdogan Furkan
1 parent 25a38537

Modifications for the integration part

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -404,8 +404,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
404 404 $this->unmarshallParamsLegend($panelData->{'panel-series-legend'}, $plotNode->getLegends()->getParamsLegend());
405 405  
406 406 //Text Legends
407   - foreach ($panelData->{'text-legends'} as $textLegendData)
408   - $this->unmarshallTextLegend($textLegendData, $plotNode->getLegends());
  407 + foreach ($panelData->{'text-legends'} as $textLegendData) {
  408 + $legendNode = $plotNode->getLegends()->addTextLegend();
  409 + $this->unmarshallTextLegend($textLegendData, $legendNode);
  410 + }
409 411  
410 412 return $plotNode;
411 413 }
... ... @@ -957,7 +959,12 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
957 959 } else {
958 960 $color = $this->hexColor2KernelColor($paramDrawingData->{'intervals-color'});
959 961 }
960   - $paramNode->addIntervals($color);
  962 +
  963 + $intervalsNode = $paramNode->addIntervals($color);
  964 + $textLegendNode = $intervalsNode->addTextLegend();
  965 +
  966 + $this->unmarshallTextLegend($paramDrawingData, $textLegendNode);
  967 +
961 968 }
962 969  
963 970 protected function unmarshallTickBar($paramDrawingData, $paramNode, $indexes)
... ... @@ -1036,35 +1043,35 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
1036 1043 $this->unmarshallFont($paramsLegendData, 'legend-series-font', $paramsLegendNode->getFont());
1037 1044 }
1038 1045  
1039   - protected function unmarshallTextLegend($textLegendData, $legendsNode)
  1046 + protected function unmarshallTextLegend($textLegendData, $parentNode)
1040 1047 {
1041   - $legendNode = $legendsNode->addTextLegend();
1042 1048  
1043 1049 //Legend text
1044   - $legendNode->setText($textLegendData->{'legend-text-value'});
  1050 + $parentNode->setText($textLegendData->{'legend-text-value'});
1045 1051  
1046 1052 //Legend position
1047 1053 switch ($textLegendData->{'legend-text-position'}) {
1048 1054 case 'top':
1049   - $legendNode->setPosition(RequestOutputPlotTextLegendPositionEnum::TOP);
  1055 + $parentNode->setPosition(RequestOutputPlotTextLegendPositionEnum::TOP);
1050 1056 break;
1051 1057 case 'bottom':
1052   - $legendNode->setPosition(RequestOutputPlotTextLegendPositionEnum::BOTTOM);
  1058 + $parentNode->setPosition(RequestOutputPlotTextLegendPositionEnum::BOTTOM);
1053 1059 break;
1054 1060 case 'left':
1055   - $legendNode->setPosition(RequestOutputPlotTextLegendPositionEnum::LEFT);
  1061 + $parentNode->setPosition(RequestOutputPlotTextLegendPositionEnum::LEFT);
1056 1062 break;
1057 1063 case 'right':
1058 1064 default:
1059   - $legendNode->setPosition(RequestOutputPlotTextLegendPositionEnum::RIGHT);
  1065 + $parentNode->setPosition(RequestOutputPlotTextLegendPositionEnum::RIGHT);
1060 1066 }
1061 1067  
1062 1068 //Legend text color
1063   - $legendNode->setColor($this->hexColor2KernelColor($textLegendData->{'legend-text-color'}));
  1069 + $parentNode->setColor($this->hexColor2KernelColor($textLegendData->{'legend-text-color'}));
1064 1070  
1065 1071 //Font
1066   - if ($textLegendData->{'legend-text-font-activated'})
1067   - $this->unmarshallFont($textLegendData, 'legend-text-font', $legendNode->getFont());
  1072 + if ($textLegendData->{'legend-text-font-activated'}) {
  1073 + $this->unmarshallFont($textLegendData, 'legend-text-font', $parentNode->getFont());
  1074 + }
1068 1075 }
1069 1076  
1070 1077 protected function unmarshallConstant($constantData, $axisNode)
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotIntervalsNodeClass.php 0 โ†’ 100644
... ... @@ -0,0 +1,41 @@
  1 +<?php
  2 +
  3 +define("REQUESTOUTPUTPLOTINTERVALS_NAME", "intervals");
  4 +define("REQUESTOUTPUTPLOTINTERVALS_COLOR", "color");
  5 +
  6 +
  7 +/**
  8 + * @class RequestOutputPlotTextLegendNodeClass
  9 + * @brief Definition of a "text legend" element for a plot
  10 + * @details
  11 + */
  12 +class RequestOutputPlotIntervalsNodeClass extends NodeClass
  13 +{
  14 + public $textLegendNode = null;
  15 + public function __construct()
  16 + {
  17 + parent::__construct(REQUESTOUTPUTPLOTINTERVALS_NAME);
  18 + }
  19 +
  20 + public function setColor($color)
  21 + {
  22 + $this->setAttribute(REQUESTOUTPUTPLOTINTERVALS_COLOR, $color);
  23 + }
  24 +
  25 + public function getColor()
  26 + {
  27 + return $this->getAttribute(REQUESTOUTPUTPLOTINTERVALS_COLOR);
  28 + }
  29 +
  30 + public function addTextLegend()
  31 + {
  32 + $this->textLegendNode = new RequestOutputPlotTextLegendNodeClass();
  33 + $this->addChild($this->textLegendNode);
  34 + return $this->textLegendNode;
  35 + }
  36 +
  37 + public function loadFromNode($xmlNode)
  38 + {
  39 + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTINTERVALS_COLOR));
  40 + }
  41 +}
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
... ... @@ -54,8 +54,6 @@ define(&quot;REQUESTOUTPUTPLOTSTATUSBAR_COLOR&quot;, &quot;color&quot;);
54 54 define("REQUESTOUTPUTPLOTTICKBAR_NAME", "serie");
55 55 define("REQUESTOUTPUTPLOTTICKBAR_INDEX", "index");
56 56  
57   -define("REQUESTOUTPUTPLOTINTERVALS_NAME", "intervals");
58   -define("REQUESTOUTPUTPLOTINTERVALS_COLOR", "color");
59 57  
60 58 /**
61 59 * @class RequestOutputPlotParamNodeClass
... ... @@ -256,9 +254,9 @@ class RequestOutputPlotParamNodeClass extends NodeClass
256 254  
257 255 public function addIntervals($color = NULL)
258 256 {
259   - $intervalsNode = new NodeClass(REQUESTOUTPUTPLOTINTERVALS_NAME);
  257 + $intervalsNode = new RequestOutputPlotIntervalsNodeClass();
260 258 if ($color != NULL) {
261   - $intervalsNode->setAttribute(REQUESTOUTPUTPLOTINTERVALS_COLOR, $color);
  259 + $intervalsNode->setColor($color);
262 260 }
263 261 $this->addChild($intervalsNode);
264 262 return $intervalsNode;
... ...