Commit 4ede4320f50798bff7f3feb89a4d4b4f7e6d7a61
1 parent
78a73e9a
Exists in
master
and in
66 other branches
Integration for series and spectro plots
Showing
11 changed files
with
491 additions
and
18 deletions
Show diff stats
config/plotConfig.xml
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | <yAxis scale="linear" reverse="false" color="[0,0,0]" position="left" thickness="1" /> |
19 | 19 | <timePlot xAxis="timeAxis" zAxis="colorAxis"> |
20 | 20 | <line type="line" style="plain" width="1" /> |
21 | - <symbol type="no" size="4" color="[0,0,255]" /> | |
21 | + <symbol type="no" size="4" /> | |
22 | 22 | </timePlot> |
23 | 23 | <epochPlot xAxis="epochAxis" zAxis="colorAxis"> |
24 | 24 | <line type="line" style="plain" width="1" /> |
... | ... |
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... | ... | @@ -27,8 +27,15 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
27 | 27 | { |
28 | 28 | $requestNode = $this->paramsData->addRequestNode(); |
29 | 29 | $outputsNode = $requestNode->getOutputsNode(); |
30 | + $paramsNode = $requestNode->getParamsNode(); | |
30 | 31 | |
31 | 32 | //unmarshall time definition |
33 | + | |
34 | + //BRE - For debug - TO ERASE | |
35 | + $input->{'startDate'} = '2005-01-30T00:00:18'; | |
36 | + $input->{'stopDate'} = '2005-02-01T00:00:15'; | |
37 | + | |
38 | + | |
32 | 39 | $this->unmarshallTimeDefinition($input, $requestIndex); |
33 | 40 | |
34 | 41 | $plotOutputNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::PLOT); |
... | ... | @@ -146,7 +153,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
146 | 153 | $pageNode->getLayout()->setType(RequestOutputPlotLayoutTypeEnum::VERTICAL); |
147 | 154 | |
148 | 155 | foreach ($tab->{'panels'} as $panelData) |
149 | - $this->unmarshallPanel($panelData, $pageNode); | |
156 | + $this->unmarshallPanel($panelData, $pageNode, $paramsNode); | |
150 | 157 | |
151 | 158 | if ($this->isInteractiveRequest) |
152 | 159 | { |
... | ... | @@ -183,7 +190,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
183 | 190 | return $this->paramsData; |
184 | 191 | } |
185 | 192 | |
186 | - protected function unmarshallPanel($panelData, $pageNode) | |
193 | + protected function unmarshallPanel($panelData, $pageNode, $paramsNode) | |
187 | 194 | { |
188 | 195 | $panelNode = $pageNode->addPanel(); |
189 | 196 | |
... | ... | @@ -198,7 +205,14 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
198 | 205 | $this->unmarshallTitle($panelData, 'panel-title', $panelNode->getTitle()); |
199 | 206 | |
200 | 207 | //Plot type |
201 | - $this->unmarshallPlotType($panelData, $panelNode); | |
208 | + $plotNode = $this->unmarshallPlotType($panelData, $panelNode); | |
209 | + | |
210 | + //Axes | |
211 | + foreach ($panelData->{'axes'} as $axisData) | |
212 | + $this->unmarshallAxis($axisData, $plotNode); | |
213 | + | |
214 | + //Params | |
215 | + $this->unmarshallParams($panelData->{'params'}, $paramsNode, $plotNode); | |
202 | 216 | |
203 | 217 | return $panelNode; |
204 | 218 | } |
... | ... | @@ -217,9 +231,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
217 | 231 | throw new Exception('Plot type not implemented.'); |
218 | 232 | } |
219 | 233 | |
220 | - //Axes | |
221 | - foreach ($panelData->{'axes'} as $axisData) | |
222 | - $this->unmarshallAxis($axisData, $plotNode); | |
234 | + return $plotNode; | |
223 | 235 | } |
224 | 236 | |
225 | 237 | protected function unmarshallAxis($axisData, $plotNode) |
... | ... | @@ -239,10 +251,11 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
239 | 251 | $axisNode = $plotNode->getXAxis(); |
240 | 252 | break; |
241 | 253 | case 'y-left' : |
242 | - $axisNode = $plotNode->addYAxis('y1'); | |
254 | + $axisNode = $plotNode->addYAxis('y-left'); | |
243 | 255 | break; |
244 | 256 | case 'y-right' : |
245 | - $axisNode = $plotNode->addYAxis('y2'); | |
257 | + $axisNode = $plotNode->addYAxis('y-right'); | |
258 | + $axisNode->setPosition(RequestOutputPlotAxisElementPosition::RIGHT); | |
246 | 259 | break; |
247 | 260 | case 'color' : |
248 | 261 | $axisNode = $plotNode->getZAxis(); |
... | ... | @@ -295,10 +308,131 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
295 | 308 | $axisNode->getTick()->setMajorGrid($axisData->{'axis-grid-major'} ? "true" : "false"); |
296 | 309 | |
297 | 310 | //legend |
298 | - $axisNode->getLegend()->setText($axisData->{'-text'}); | |
311 | + if ($axisData->{'axis-legend-text'} != '') | |
312 | + $axisNode->getLegend()->setText($axisData->{'axis-legend-text'}); | |
313 | + $axisNode->getLegend()->setColor($this->hexColor2KernelColor($axisData->{'axis-legend-color'})); | |
299 | 314 | $this->unmarshallLabel($axisData, "axis-legend", $axisNode->getLegend()); |
300 | 315 | } |
301 | 316 | |
317 | + protected function unmarshallParams($paramsData, $requestParamsNode, $plotNode) | |
318 | + { | |
319 | + //X parameters | |
320 | + $isScatter = ($plotNode->getName() == REQUESTOUTPUTPLOTELEMENTXY_NAME); | |
321 | + if ($isScatter) | |
322 | + { | |
323 | + foreach ($paramsData as $paramData) | |
324 | + { | |
325 | + if ($paramData->{'param-drawing-object'}->{'serie-xaxis-param'} == '') | |
326 | + continue; | |
327 | + | |
328 | + $paramXInfo = $this->paramManager->addExistingParam($paramData->{'param-drawing-object'}->{'serie-xaxis-param'},$this->paramsData); | |
329 | + if ($paramXInfo['id'] == '') | |
330 | + throw new Exception('Cannot retrieve X parameter.'); | |
331 | + $requestParamsNode->addParam($paramXInfo['id']); | |
332 | + $xParamNode = $plotNode->getParams()->getParamById($paramXInfo['id']); | |
333 | + switch ($paramData->{'param-drawing-type'}) | |
334 | + { | |
335 | + case 'serie' : | |
336 | + //Unmarshall x serie | |
337 | + if (count($paramXInfo['indexes']) == 0) | |
338 | + $xParamNode->addXSerie(REQUESTOUTPUTPLOTELEMENTXY_XAXISID, -1); | |
339 | + else if (count($paramXInfo['indexes']) == 1) | |
340 | + $xParamNode->addXSerie(REQUESTOUTPUTPLOTELEMENTXY_XAXISID, $paramXInfo['indexes'][0]); | |
341 | + else | |
342 | + throw new Exception('X parameter for serie must be a component.'); | |
343 | + break; | |
344 | + default : | |
345 | + throw new Exception('X parameter not allowed for this drawing type. '); | |
346 | + } | |
347 | + } | |
348 | + } | |
349 | + | |
350 | + //Main drawing element parameter | |
351 | + $drawingEltIndex = 0; | |
352 | + foreach ($paramsData as $paramData) | |
353 | + { | |
354 | + //Param | |
355 | + $paramInfo = $this->paramManager->addExistingParam($paramData->{'param-id'},$this->paramsData); | |
356 | + $requestParamsNode->addParam($paramInfo['id']); | |
357 | + $paramNode = $plotNode->getParams()->getParamById($paramInfo['id']); | |
358 | + | |
359 | + $colorSerieId = -1; | |
360 | + if ($paramData->{'param-drawing-object'}->{'serie-colored-param'} != '') | |
361 | + $colorSerieId = $drawingEltIndex; | |
362 | + | |
363 | + switch ($paramData->{'param-drawing-type'}) | |
364 | + { | |
365 | + case 'serie' : | |
366 | + $this->unmarshallYSerie($paramData->{'param-drawing-object'}, $plotNode, $paramNode, $paramInfo['indexes'], $isScatter && ($paramData->{'param-drawing-object'}->{'serie-xaxis-param'} != ''), $colorSerieId); | |
367 | + break; | |
368 | + case 'spectro' : | |
369 | + $this->unmarshallSpectro($paramData->{'param-drawing-object'}, $plotNode, $paramNode, $paramInfo['indexes']); | |
370 | + break; | |
371 | + default : | |
372 | + throw new Exception('Drawing type not implemented.'); | |
373 | + } | |
374 | + ++$drawingEltIndex; | |
375 | + } | |
376 | + | |
377 | + //Colored parameter | |
378 | + $drawingEltIndex = 0; | |
379 | + foreach ($paramsData as $paramData) | |
380 | + { | |
381 | + if ($paramData->{'param-drawing-object'}->{'serie-colored-param'} == '') | |
382 | + { | |
383 | + ++$drawingEltIndex; | |
384 | + continue; | |
385 | + } | |
386 | + | |
387 | + $paramColoredInfo = $this->paramManager->addExistingParam($paramData->{'param-drawing-object'}->{'serie-colored-param'},$this->paramsData); | |
388 | + if ($paramColoredInfo['id'] == '') | |
389 | + throw new Exception('Cannot retrieve colored parameter.'); | |
390 | + $requestParamsNode->addParam($paramColoredInfo['id']); | |
391 | + $coloredParamNode = $plotNode->getParams()->getParamById($paramColoredInfo['id']); | |
392 | + | |
393 | + $colorSerieId = $drawingEltIndex; | |
394 | + | |
395 | + switch ($paramData->{'param-drawing-type'}) | |
396 | + { | |
397 | + case 'serie' : | |
398 | + //Unmarshall colored serie | |
399 | + if (count($paramColoredInfo['indexes']) == 0) | |
400 | + $coloredParamNode->addColorSerie($colorSerieId, -1); | |
401 | + else if (count($paramColoredInfo['indexes']) == 1) | |
402 | + $coloredParamNode->addColorSerie($colorSerieId, $paramColoredInfo['indexes'][0]); | |
403 | + else | |
404 | + throw new Exception('Colored parameter for serie must be a component.'); | |
405 | + break; | |
406 | + default : | |
407 | + throw new Exception('Colored parameter not allowed for this drawing type. '); | |
408 | + } | |
409 | + ++$drawingEltIndex; | |
410 | + } | |
411 | + } | |
412 | + | |
413 | + protected function unmarshallYSerie($paramDrawingData, $plotNode, $paramNode, $indexes, $useXAxis, $colorSerieId) | |
414 | + { | |
415 | + $serieNodes = array(); | |
416 | + | |
417 | + if (count($indexes) == 0) | |
418 | + $serieNodes[] = $paramNode->addYSerie($paramDrawingData->{'serie-yaxis'}, -1, $useXAxis ? REQUESTOUTPUTPLOTELEMENTXY_XAXISID : '', $colorSerieId); | |
419 | + foreach ($indexes as $index) | |
420 | + $serieNodes[] = $paramNode->addYSerie($paramDrawingData->{'serie-yaxis'}, $index, $useXAxis ? REQUESTOUTPUTPLOTELEMENTXY_XAXISID : '', $colorSerieId); | |
421 | + | |
422 | + foreach ($serieNodes as $serieNode) | |
423 | + { | |
424 | + //Line | |
425 | + $this->unmarshallLine($paramDrawingData, 'serie', $serieNode->getLine()); | |
426 | + //Symbol | |
427 | + $this->unmarshallSymbol($paramDrawingData, 'serie', $serieNode->getSymbol()); | |
428 | + } | |
429 | + } | |
430 | + | |
431 | + protected function unmarshallSpectro($paramDrawingData, $plotNode, $paramNode, $indexes) | |
432 | + { | |
433 | + $spectroNode = $paramNode->addSpectro($paramDrawingData->{'spectro-yaxis'}); | |
434 | + } | |
435 | + | |
302 | 436 | protected function unmarshallTitle($inputData, $keyPrefix, $titleNode) |
303 | 437 | { |
304 | 438 | if ($inputData->{$keyPrefix.'-text'} != '') |
... | ... | @@ -378,6 +512,108 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
378 | 512 | $fontNode->setWeight(RequestOutputPlotFontWeight::MEDIUM); |
379 | 513 | } |
380 | 514 | } |
515 | + | |
516 | + protected function unmarshallCurve($inputData, $keyPrefix, $curveNode) | |
517 | + { | |
518 | + switch ($inputData->{$keyPrefix.'-style'}) | |
519 | + { | |
520 | + case 'plain' : | |
521 | + $curveNode->setStyle(RequestOutputPlotCurveStyleEnum::PLAIN); | |
522 | + break; | |
523 | + case 'dot' : | |
524 | + $curveNode->setStyle(RequestOutputPlotCurveStyleEnum::DOT); | |
525 | + break; | |
526 | + case 'long-spaced-dot' : | |
527 | + $curveNode->setStyle(RequestOutputPlotCurveStyleEnum::LONGSPACEDDOT); | |
528 | + break; | |
529 | + case 'long-short-dot' : | |
530 | + $curveNode->setStyle(RequestOutputPlotCurveStyleEnum::LONGSHORTDOT); | |
531 | + break; | |
532 | + default : | |
533 | + throw new Exception('Curve style not implemented.'); | |
534 | + } | |
535 | + | |
536 | + $curveNode->setWidth($inputData->{$keyPrefix.'-width'}); | |
537 | + | |
538 | + if ($inputData->{$keyPrefix.'-color'} != 'auto') | |
539 | + $curveNode->setColor($this->hexColor2KernelColor($inputData->{$keyPrefix.'-color'})); | |
540 | + } | |
541 | + | |
542 | + protected function unmarshallLine($inputData, $keyPrefix, $lineNode) | |
543 | + { | |
544 | + if (!$inputData->{$keyPrefix."-lines-activated"}) | |
545 | + $lineNode->setType(RequestOutputPlotLineTypeEnum::NO); | |
546 | + else | |
547 | + { | |
548 | + $lineNode->setType(RequestOutputPlotLineTypeEnum::LINE); | |
549 | + $this->unmarshallCurve($inputData, $keyPrefix."-lines", $lineNode); | |
550 | + } | |
551 | + } | |
552 | + | |
553 | + protected function unmarshallSymbol($inputData, $keyPrefix, $symbolNode) | |
554 | + { | |
555 | + if (!$inputData->{$keyPrefix."-symbols-activated"}) | |
556 | + { | |
557 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::NO); | |
558 | + return; | |
559 | + } | |
560 | + | |
561 | + switch ($inputData->{$keyPrefix.'-symbols-type'}) | |
562 | + { | |
563 | + case 'dot' : | |
564 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::DOT); | |
565 | + break; | |
566 | + case 'plus' : | |
567 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::PLUS); | |
568 | + break; | |
569 | + case 'wildcard' : | |
570 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::WILDCARD); | |
571 | + break; | |
572 | + case 'circle' : | |
573 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::CIRCLE); | |
574 | + break; | |
575 | + case 'crux' : | |
576 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::CRUX); | |
577 | + break; | |
578 | + case 'square' : | |
579 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::SQUARE); | |
580 | + break; | |
581 | + case 'triangle' : | |
582 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::TRIANGLE); | |
583 | + break; | |
584 | + case 'crux-in-circle' : | |
585 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::CRUXINCIRCLE); | |
586 | + break; | |
587 | + case 'dot-in-circle' : | |
588 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::DOTINCIRCLE); | |
589 | + break; | |
590 | + case 'diamond' : | |
591 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::DIAMOND); | |
592 | + break; | |
593 | + case 'star' : | |
594 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::STAR); | |
595 | + break; | |
596 | + case 'david-star' : | |
597 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::DAVIDSTAR); | |
598 | + break; | |
599 | + case 'full-square' : | |
600 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::FULLSQUARE); | |
601 | + break; | |
602 | + case 'full-circle' : | |
603 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::FULLCIRCLE); | |
604 | + break; | |
605 | + case 'full-star' : | |
606 | + $symbolNode->setType(RequestOutputPlotSymbolTypeEnum::FULLSTAR); | |
607 | + break; | |
608 | + default : | |
609 | + throw new Exception('Symbol type not implemented.'); | |
610 | + } | |
611 | + | |
612 | + $symbolNode->setSize($inputData->{$keyPrefix.'-symbols-size'}); | |
613 | + | |
614 | + if ($inputData->{$keyPrefix.'-symbols-color'} != 'auto') | |
615 | + $symbolNode->setColor($this->hexColor2KernelColor($inputData->{$keyPrefix.'-symbols-color'})); | |
616 | + } | |
381 | 617 | |
382 | 618 | /* |
383 | 619 | * @brief method to marshall the result of a download request |
... | ... |
src/Request/ParamsRequestImpl/Nodes/NodeClass.php
src/Request/ParamsRequestImpl/Nodes/Requests/RequestNodeClass.php
... | ... | @@ -42,6 +42,9 @@ class RequestParamsNodeClass extends NodeClass |
42 | 42 | |
43 | 43 | public function addParam($id) |
44 | 44 | { |
45 | + foreach ($this->getChildrenByName(REQUESTPARAM_NAME) as $paramNode) | |
46 | + if ($paramNode->getId() == $id) | |
47 | + return; | |
45 | 48 | $param = new RequestParamNodeClass(); |
46 | 49 | $param->setId($id); |
47 | 50 | $this->addChild($param); |
... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxisElementNodeClass.php
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | define ("REQUESTOUTPUTPLOTAXISELEMENT_POSITION", "position"); |
4 | 4 | define ("REQUESTOUTPUTPLOTAXISELEMENT_REVERSE", "reverse"); |
5 | +define ("REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE", "visible"); | |
5 | 6 | define ("REQUESTOUTPUTPLOTAXISELEMENT_SCALE", "scale"); |
6 | 7 | define ("REQUESTOUTPUTPLOTAXISELEMENT_COLOR", "color"); |
7 | 8 | define ("REQUESTOUTPUTPLOTAXISELEMENT_THICKNESS", "thickness"); |
... | ... | @@ -31,6 +32,14 @@ abstract class RequestOutputPlotAxisElementTickPosition |
31 | 32 | const OUTWARDS = "outwards"; |
32 | 33 | } |
33 | 34 | |
35 | +abstract class RequestOutputPlotAxisElementPosition | |
36 | +{ | |
37 | + const TOP = "top"; | |
38 | + const BOTTOM = "bottom"; | |
39 | + const LEFT = "bottom"; | |
40 | + const RIGHT = "right"; | |
41 | +} | |
42 | + | |
34 | 43 | /** |
35 | 44 | * @class RequestOutputPlotAxisElementRangeNodeClass |
36 | 45 | * @brief Definition of range for an axis |
... | ... | @@ -221,7 +230,15 @@ class RequestOutputPlotAxisElementNodeClass extends NodeClass |
221 | 230 | return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_REVERSE); |
222 | 231 | } |
223 | 232 | |
224 | - /* ToDo visible */ | |
233 | + public function setVisible($visible) | |
234 | + { | |
235 | + $this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE, $visible); | |
236 | + } | |
237 | + | |
238 | + public function getVisible() | |
239 | + { | |
240 | + return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE); | |
241 | + } | |
225 | 242 | |
226 | 243 | public function setScale($scale) |
227 | 244 | { |
... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveNodeClass.php
0 โ 100644
... | ... | @@ -0,0 +1,58 @@ |
1 | +<?php | |
2 | + | |
3 | +define ("REQUESTOUTPUTPLOTCURVE_STYLE", "style"); | |
4 | +define ("REQUESTOUTPUTPLOTCURVE_WIDTH", "width"); | |
5 | +define ("REQUESTOUTPUTPLOTCURVE_COLOR", "color"); | |
6 | + | |
7 | +abstract class RequestOutputPlotCurveStyleEnum | |
8 | +{ | |
9 | + const PLAIN = "plain"; | |
10 | + const DOT = "dot"; | |
11 | + const LONGSPACEDDOT = "long-spaced-dot"; | |
12 | + const LONGSHORTDOT = "long-short-dot"; | |
13 | +} | |
14 | + | |
15 | +/** | |
16 | + * @class RequestOutputPlotCurveNodeClass | |
17 | + * @brief Definition of a curve element for a plot | |
18 | + * @details | |
19 | + */ | |
20 | +class RequestOutputPlotCurveNodeClass extends NodeClass | |
21 | +{ | |
22 | + public function __construct($name) | |
23 | + { | |
24 | + parent::__construct($name); | |
25 | + } | |
26 | + | |
27 | + public function setStyle($style) | |
28 | + { | |
29 | + $this->setAttribute(REQUESTOUTPUTPLOTCURVE_STYLE, $style); | |
30 | + } | |
31 | + | |
32 | + public function getStyle() | |
33 | + { | |
34 | + return $this->getAttribute(REQUESTOUTPUTPLOTCURVE_STYLE); | |
35 | + } | |
36 | + | |
37 | + public function setWidth($width) | |
38 | + { | |
39 | + $this->setAttribute(REQUESTOUTPUTPLOTCURVE_WIDTH, $width); | |
40 | + } | |
41 | + | |
42 | + public function getWidth() | |
43 | + { | |
44 | + return $this->getAttribute(REQUESTOUTPUTPLOTCURVE_WIDTH); | |
45 | + } | |
46 | + | |
47 | + public function setColor($color) | |
48 | + { | |
49 | + $this->setAttribute(REQUESTOUTPUTPLOTCURVE_COLOR, $color); | |
50 | + } | |
51 | + | |
52 | + public function getColor() | |
53 | + { | |
54 | + return $this->getAttribute(REQUESTOUTPUTPLOTCURVE_COLOR); | |
55 | + } | |
56 | +} | |
57 | + | |
58 | +?> | |
0 | 59 | \ No newline at end of file |
... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLineNodeClass.php
0 โ 100644
... | ... | @@ -0,0 +1,34 @@ |
1 | +<?php | |
2 | + | |
3 | +define ("REQUESTOUTPUTPLOTLINE_TYPE", "type"); | |
4 | + | |
5 | +abstract class RequestOutputPlotLineTypeEnum | |
6 | +{ | |
7 | + const NO = "no"; | |
8 | + const LINE = "line"; | |
9 | +} | |
10 | + | |
11 | +/** | |
12 | + * @class RequestOutputPlotLineNodeClass | |
13 | + * @brief Definition of a line element for a plot | |
14 | + * @details | |
15 | + */ | |
16 | +class RequestOutputPlotLineNodeClass extends RequestOutputPlotCurveNodeClass | |
17 | +{ | |
18 | + public function __construct($name) | |
19 | + { | |
20 | + parent::__construct($name); | |
21 | + } | |
22 | + | |
23 | + public function setType($type) | |
24 | + { | |
25 | + $this->setAttribute(REQUESTOUTPUTPLOTLINE_TYPE, $type); | |
26 | + } | |
27 | + | |
28 | + public function getType() | |
29 | + { | |
30 | + $this->getAttribute(REQUESTOUTPUTPLOTLINE_TYPE); | |
31 | + } | |
32 | +} | |
33 | + | |
34 | +?> | |
0 | 35 | \ No newline at end of file |
... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
... | ... | @@ -11,6 +11,10 @@ define ("REQUESTOUTPUTPLOTXSERIE_NAME", "xserie"); |
11 | 11 | define ("REQUESTOUTPUTPLOTXSERIE_XAXIS", "xAxis"); |
12 | 12 | define ("REQUESTOUTPUTPLOTXSERIE_INDEX", "index"); |
13 | 13 | |
14 | +define ("REQUESTOUTPUTPLOTCOLORSERIE_NAME", "colorserie"); | |
15 | +define ("REQUESTOUTPUTPLOTCOLORSERIE_ID", "id"); | |
16 | +define ("REQUESTOUTPUTPLOTCOLORSERIE_INDEX", "index"); | |
17 | + | |
14 | 18 | define ("REQUESTOUTPUTPLOTSPECTRO_NAME", "spectro"); |
15 | 19 | define ("REQUESTOUTPUTPLOTSPECTRO_YAXIS", "yAxis"); |
16 | 20 | |
... | ... | @@ -32,7 +36,7 @@ class RequestOutputPlotParamNodeClass extends NodeClass |
32 | 36 | return $this->getAttribute(REQUESTOUTPUTPLOTPARAM_ID); |
33 | 37 | } |
34 | 38 | |
35 | - public function addYSerie($yAxis, $index, $xAxis = "") | |
39 | + public function addYSerie($yAxis, $index, $xAxis = "", $colorSerieId = -1) | |
36 | 40 | { |
37 | 41 | if ($xAxis != "") |
38 | 42 | { |
... | ... | @@ -44,6 +48,8 @@ class RequestOutputPlotParamNodeClass extends NodeClass |
44 | 48 | $ySerieNode->setYAxisId($yAxis); |
45 | 49 | if ($index >= 0) |
46 | 50 | $ySerieNode->setIndex($index); |
51 | + if ($colorSerieId >= 0) | |
52 | + $ySerieNode->setColorSerieId($colorSerieId); | |
47 | 53 | $this->addChild($ySerieNode); |
48 | 54 | return $ySerieNode; |
49 | 55 | } |
... | ... | @@ -65,6 +71,16 @@ class RequestOutputPlotParamNodeClass extends NodeClass |
65 | 71 | $this->addChild($xSerieNode); |
66 | 72 | return $xSerieNode; |
67 | 73 | } |
74 | + | |
75 | + public function addColorSerie($id, $index) | |
76 | + { | |
77 | + $colorSerieNode = new NodeClass(REQUESTOUTPUTPLOTCOLORSERIE_NAME); | |
78 | + $colorSerieNode->setAttribute(REQUESTOUTPUTPLOTCOLORSERIE_ID, $id); | |
79 | + if ($index >= 0) | |
80 | + $colorSerieNode->setAttribute(REQUESTOUTPUTPLOTCOLORSERIE_INDEX, $index); | |
81 | + $this->addChild($colorSerieNode); | |
82 | + return $colorSerieNode; | |
83 | + } | |
68 | 84 | } |
69 | 85 | |
70 | 86 | /** |
... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSymbolNodeClass.php
0 โ 100644
... | ... | @@ -0,0 +1,70 @@ |
1 | +<?php | |
2 | + | |
3 | +define ("REQUESTOUTPUTPLOTSYMBOL_TYPE", "type"); | |
4 | +define ("REQUESTOUTPUTPLOTSYMBOL_SIZE", "size"); | |
5 | +define ("REQUESTOUTPUTPLOTSYMBOL_COLOR", "color"); | |
6 | + | |
7 | +abstract class RequestOutputPlotSymbolTypeEnum | |
8 | +{ | |
9 | + const NO = "no"; | |
10 | + const DOT = "dot"; | |
11 | + const PLUS = "plus"; | |
12 | + const WILDCARD = "wildcard"; | |
13 | + const CIRCLE = "circle"; | |
14 | + const CRUX = "crux"; | |
15 | + const SQUARE = "square"; | |
16 | + const TRIANGLE = "triangle"; | |
17 | + const CRUXINCIRCLE = "crux-in-circle"; | |
18 | + const DOTINCIRCLE = "dot-in-circle"; | |
19 | + const DIAMOND = "diamond"; | |
20 | + const STAR = "star"; | |
21 | + const DAVIDSTAR = "david-star"; | |
22 | + const FULLSQUARE = "full-square"; | |
23 | + const FULLCIRCLE = "full-circle"; | |
24 | + const FULLSTAR = "full-star"; | |
25 | +} | |
26 | + | |
27 | +/** | |
28 | + * @class RequestOutputPlotSymbolNodeClass | |
29 | + * @brief Definition of a symbol element for a plot | |
30 | + * @details | |
31 | + */ | |
32 | +class RequestOutputPlotSymbolNodeClass extends NodeClass | |
33 | +{ | |
34 | + public function __construct($name) | |
35 | + { | |
36 | + parent::__construct($name); | |
37 | + } | |
38 | + | |
39 | + public function setType($type) | |
40 | + { | |
41 | + $this->setAttribute(REQUESTOUTPUTPLOTSYMBOL_TYPE, $type); | |
42 | + } | |
43 | + | |
44 | + public function getType() | |
45 | + { | |
46 | + return $this->getAttribute(REQUESTOUTPUTPLOTSYMBOL_TYPE); | |
47 | + } | |
48 | + | |
49 | + public function setSize($size) | |
50 | + { | |
51 | + $this->setAttribute(REQUESTOUTPUTPLOTSYMBOL_SIZE, $size); | |
52 | + } | |
53 | + | |
54 | + public function getSize() | |
55 | + { | |
56 | + return $this->getAttribute(REQUESTOUTPUTPLOTSYMBOL_SIZE); | |
57 | + } | |
58 | + | |
59 | + public function setColor($color) | |
60 | + { | |
61 | + $this->setAttribute(REQUESTOUTPUTPLOTSYMBOL_COLOR, $color); | |
62 | + } | |
63 | + | |
64 | + public function getColor() | |
65 | + { | |
66 | + return $this->getAttribute(REQUESTOUTPUTPLOTSYMBOL_COLOR); | |
67 | + } | |
68 | +} | |
69 | + | |
70 | +?> | |
0 | 71 | \ No newline at end of file |
... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieNodeClass.php
... | ... | @@ -6,6 +6,9 @@ define ("REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME", "serie"); |
6 | 6 | define ("REQUESTOUTPUTPLOTYSERIE_YAXIS", "yAxis"); |
7 | 7 | define ("REQUESTOUTPUTPLOTYSERIE_XAXIS", "xAxis"); |
8 | 8 | define ("REQUESTOUTPUTPLOTYSERIE_INDEX", "index"); |
9 | +define ("REQUESTOUTPUTPLOTYSERIE_COLORSERIEID", "colorSerieId"); | |
10 | +define ("REQUESTOUTPUTPLOTYSERIE_LINE", "line"); | |
11 | +define ("REQUESTOUTPUTPLOTYSERIE_SYMBOL", "symbol"); | |
9 | 12 | |
10 | 13 | /** |
11 | 14 | * @class RequestOutputPlotYSerieNodeClass |
... | ... | @@ -48,6 +51,42 @@ class RequestOutputPlotYSerieNodeClass extends NodeClass |
48 | 51 | { |
49 | 52 | return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_INDEX); |
50 | 53 | } |
54 | + | |
55 | + public function setColorSerieId($colorSerieId) | |
56 | + { | |
57 | + $this->setAttribute(REQUESTOUTPUTPLOTYSERIE_COLORSERIEID, $colorSerieId); | |
58 | + } | |
59 | + | |
60 | + public function getColorSerieId() | |
61 | + { | |
62 | + return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_COLORSERIEID); | |
63 | + } | |
64 | + | |
65 | + public function getLine() | |
66 | + { | |
67 | + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_LINE); | |
68 | + | |
69 | + if (!isset($node)) | |
70 | + { | |
71 | + $node = new RequestOutputPlotLineNodeClass(REQUESTOUTPUTPLOTYSERIE_LINE); | |
72 | + $this->addChild($node); | |
73 | + } | |
74 | + | |
75 | + return $node; | |
76 | + } | |
77 | + | |
78 | + public function getSymbol() | |
79 | + { | |
80 | + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_SYMBOL); | |
81 | + | |
82 | + if (!isset($node)) | |
83 | + { | |
84 | + $node = new RequestOutputPlotSymbolNodeClass(REQUESTOUTPUTPLOTYSERIE_SYMBOL); | |
85 | + $this->addChild($node); | |
86 | + } | |
87 | + | |
88 | + return $node; | |
89 | + } | |
51 | 90 | } |
52 | 91 | |
53 | 92 | ?> |
54 | 93 | \ No newline at end of file |
... | ... |
src/Request/ParamsRequestImpl/ParamsRequestClass.php
... | ... | @@ -75,15 +75,15 @@ class ParamsRequestClass extends ProcessRequestClass |
75 | 75 | |
76 | 76 | $doc->appendChild($xmlNode); |
77 | 77 | |
78 | - if (!$doc->schemaValidate(KernelConfigClass::getXSDRequestFilePath())) | |
78 | + if (!$doc->save($this->getRequestFilePath($requestIndex))) | |
79 | 79 | { |
80 | - $this->requestData->setLastErrorMessage('Params request XML file not valid for request '.$requestIndex); | |
80 | + $this->requestData->setLastErrorMessage('Cannot save params request XML file for request '.$requestIndex); | |
81 | 81 | return false; |
82 | 82 | } |
83 | - | |
84 | - if (!$doc->save($this->getRequestFilePath($requestIndex))) | |
83 | + | |
84 | + if (!$doc->schemaValidate(KernelConfigClass::getXSDRequestFilePath())) | |
85 | 85 | { |
86 | - $this->requestData->setLastErrorMessage('Cannot save params request XML file for request '.$requestIndex); | |
86 | + $this->requestData->setLastErrorMessage('Params request XML file not valid for request '.$requestIndex); | |
87 | 87 | return false; |
88 | 88 | } |
89 | 89 | |
... | ... |