Commit b3c7897554c96ddda1c2aa914fd981810a70b16d
Exists in
master
and in
6 other branches
Merge branch 'amdadev'
Showing
8 changed files
with
259 additions
and
16 deletions
Show diff stats
config/kernel/plotConfig.xml
... | ... | @@ -34,6 +34,8 @@ |
34 | 34 | <symbol type="circle" size="5" color="[120,120,0]" /> |
35 | 35 | </timeTick> |
36 | 36 | </xyPlot> |
37 | + <histoPlot zAxis="colorAxis"> | |
38 | + </histoPlot> | |
37 | 39 | <instantPlot zAxis="colorAxis"> |
38 | 40 | <line type="no" style="plain" color="[255,0,0]" width="1" /> |
39 | 41 | <symbol type="dot" size="4" color="[0,0,255]" /> | ... | ... |
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... | ... | @@ -315,7 +315,6 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
315 | 315 | //Plot type |
316 | 316 | $this->isInstantPlot = false; |
317 | 317 | $plotNode = $this->unmarshallPlotType($panelData, $panelNode); |
318 | - | |
319 | 318 | $isTimePlot = ($plotNode->getName() == REQUESTOUTPUTPLOTELEMENTTIME_NAME); |
320 | 319 | |
321 | 320 | //Tick plot |
... | ... | @@ -373,6 +372,9 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
373 | 372 | $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::XYPLOT); |
374 | 373 | $plotNode->setIsIsotropic($panelData->{'panel-scatter-isotropic'}); |
375 | 374 | break; |
375 | + case 'histoPlot': | |
376 | + $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::HISTOPLOT); | |
377 | + break; | |
376 | 378 | case 'statusPlot': |
377 | 379 | $plotNode = $panelNode->addPlotElement(RequestOutputPlotElementTypeEnum::STATUSPLOT); |
378 | 380 | switch ($panelData->{'panel-status-position'}) { |
... | ... | @@ -517,12 +519,30 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
517 | 519 | if (isset($axisData->{'axis-grid-major-number'}) && $axisData->{'axis-grid-major-number'} != 0) |
518 | 520 | $axisNode->getTick()->setMajorGridNumber($axisData->{'axis-grid-major-number'}); |
519 | 521 | } elseif ($axisData->{'axis-grid-specify-ticks-spacing'}) { |
522 | + $timeMultiplier = 1; | |
523 | + if(isset($axisData->{'axis-tick-time-unit'}) && ($axisData->{'axis-type'} == "time" || $axisData->{'axis-type'} == "epoch" )){ | |
524 | + switch ($axisData->{'axis-tick-time-unit'}) { | |
525 | + case 'default': | |
526 | + $timeMultiplier = 1; | |
527 | + break; | |
528 | + case 'min': | |
529 | + $timeMultiplier = 60; | |
530 | + break; | |
531 | + case "hour": | |
532 | + $timeMultiplier = 3600; | |
533 | + break; | |
534 | + case "day": | |
535 | + $timeMultiplier = 86400; | |
536 | + break; | |
537 | + } | |
538 | + } | |
520 | 539 | |
521 | 540 | if (isset($axisData->{'axis-grid-major-space'}) && $axisData->{'axis-grid-major-space'} != 0) |
522 | - $axisNode->getTick()->setMajorGridSpace($axisData->{'axis-grid-major-space'}); | |
541 | + $axisNode->getTick()->setMajorGridSpace($axisData->{'axis-grid-major-space'}*$timeMultiplier); | |
523 | 542 | |
524 | 543 | if (isset($axisData->{'axis-grid-minor-space'}) && $axisData->{'axis-grid-minor-space'} != 0) |
525 | - $axisNode->getTick()->setMinorGridSpace($axisData->{'axis-grid-minor-space'}); | |
544 | + $axisNode->getTick()->setMinorGridSpace($axisData->{'axis-grid-minor-space'}*$timeMultiplier); | |
545 | + | |
526 | 546 | } |
527 | 547 | |
528 | 548 | |
... | ... | @@ -553,8 +573,9 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
553 | 573 | { |
554 | 574 | //X parameters |
555 | 575 | $isScatter = ($plotNode->getName() == REQUESTOUTPUTPLOTELEMENTXY_NAME); |
576 | + $isHisto = ($plotNode->getName() == REQUESTOUTPUTPLOTELEMENTHISTO_NAME); | |
556 | 577 | $xIds = array(); |
557 | - if ($isScatter) { | |
578 | + if ($isScatter || $isHisto) { | |
558 | 579 | $crtXId = 0; |
559 | 580 | foreach ($paramsData as $paramData) { |
560 | 581 | if ($paramData->{'param-drawing-object'}->{'serie-xaxis-param'} == '') |
... | ... | @@ -614,7 +635,7 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
614 | 635 | if (!empty($paramData->{'param-drawing-object'}->{'serie-colored-param'})) |
615 | 636 | $colorSerieId = $drawingEltIndex; |
616 | 637 | |
617 | - $xId = ($isScatter && !empty($paramData->{'param-drawing-object'}->{'serie-xaxis-param'})) ? $xIds[$paramData->{'param-drawing-object'}->{'serie-xaxis-param'}] : -1; | |
638 | + $xId = (($isScatter || $isHisto) && !empty($paramData->{'param-drawing-object'}->{'serie-xaxis-param'})) ? $xIds[$paramData->{'param-drawing-object'}->{'serie-xaxis-param'}] : -1; | |
618 | 639 | |
619 | 640 | switch ($paramData->{'param-drawing-type'}) { |
620 | 641 | case 'serie': |
... | ... | @@ -629,6 +650,10 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
629 | 650 | $paramZInfo = NULL; |
630 | 651 | $this->unmarshallHistogram2D($paramData, $requestParamsNode, $plotNode, $paramNode, $paramInfo['indexes'], $xId, $paramZInfo,$axesData); |
631 | 652 | break; |
653 | + case 'histogram1d': | |
654 | + $paramNode = $plotNode->getParams()->getParamById($paramInfo['id']); | |
655 | + $this->unmarshallHistogram1D($paramData, $requestParamsNode, $plotNode, $paramNode, $paramInfo['indexes']); | |
656 | + break; | |
632 | 657 | case 'orbit-serie': |
633 | 658 | $paramNode = $plotNode->getParams()->getParamById($paramInfo['id']); |
634 | 659 | $this->unmarshallSerie($paramData, $requestParamsNode, $plotNode, $paramNode, -1, $xId, $colorSerieId, true); |
... | ... | @@ -766,6 +791,42 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass |
766 | 791 | } |
767 | 792 | } |
768 | 793 | |
794 | + protected function unmarshallHistogram1D($paramData, $requestParamsNode, $plotNode, $paramNode, $indexes) | |
795 | + { | |
796 | + $histogram1DNodes = array(); | |
797 | + if ($paramData->{'param-drawing-object'}->{'histo1d-color'} == "none") { | |
798 | + $color = NULL; | |
799 | + } else { | |
800 | + $color = $this->hexColor2KernelColor($paramData->{'param-drawing-object'}->{'histo1d-color'}); | |
801 | + } | |
802 | + | |
803 | + if (count($indexes) == 0) { | |
804 | + $histogram1DNode = $paramNode->addHistogram1DSerie($paramData->{'param-drawing-object'}->{'serie-yaxis'}, -1, $color); | |
805 | + if (isset($histogram1DNode)) { | |
806 | + $histogram1DNode->setId($paramData->{'id'}); | |
807 | + $histogram1DNodes[] = $histogram1DNode; | |
808 | + } | |
809 | + } | |
810 | + foreach ($indexes as $index) { | |
811 | + $histogram1DNode = $paramNode->addHistogram1DSerie($paramData->{'param-drawing-object'}->{'serie-yaxis'}, $index, $color); | |
812 | + if (isset($histogram1DNode)) { | |
813 | + if (count($indexes) == 1) | |
814 | + $histogram1DNode->setId($paramData->{'id'}); | |
815 | + $histogram1DNodes[] = $histogram1DNode; | |
816 | + } | |
817 | + } | |
818 | + | |
819 | + foreach ($histogram1DNodes as $histogram1DNode) { | |
820 | + | |
821 | + // xBinNumber | |
822 | + $histogram1DNode->getBins()->addManual1DBins($paramData->{'param-drawing-object'}->{'histo1d-xbinnumber'}); | |
823 | + | |
824 | + // histotype, function | |
825 | + $histogram1DNode->getHistotype()->set1DFunction($paramData->{'param-drawing-object'}->{'histo1d-function'}); | |
826 | + | |
827 | + } | |
828 | + } | |
829 | + | |
769 | 830 | protected function unmarshallSerie($paramData, $requestParamsNode, $plotNode, $paramNode, $indexes, $xId, $colorSerieId, $isOrbitSerie) |
770 | 831 | { |
771 | 832 | $serieNodes = array(); | ... | ... |
src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php
... | ... | @@ -340,16 +340,7 @@ class IHMParamManagerClass |
340 | 340 | } |
341 | 341 | } |
342 | 342 | |
343 | - if ($this->templateParamsManager->isTemplatedParam($linkedParamId)) { | |
344 | - $linkedParamPath = $this->templateParamsManager->generateTemplatedParamFile($linkedParamId, $tempArgs); | |
345 | - $real_linked_param_id = $this->templateParamsManager->getTemplatedParamId($linkedParamId, $tempArgs); | |
346 | - } | |
347 | - else { | |
348 | - $real_linked_param_id = $linkedParamId; | |
349 | - $linkedParamPath = IHMConfigClass::getLocalParamDBPath().$real_linked_param_id.".xml"; | |
350 | - } | |
351 | - $paramsData->addParamToCopy($real_linked_param_id,$linkedParamPath); | |
352 | - $this->addLinkedLocalParams($linkedParamId, $paramsData); | |
343 | + $this->addExistingParam($linkedParamId, $paramsData); | |
353 | 344 | } |
354 | 345 | } |
355 | 346 | ... | ... |
src/InputOutput/IHMImpl/Tools/IHMPlotContextFileClass.php
... | ... | @@ -113,6 +113,8 @@ class IHMPlotContextFileClass |
113 | 113 | $panelContext['plotArea']['y'] = $pageContext['height'] - intval($plotAreaNode->getAttribute('y')) - $panelContext['plotArea']['height']; |
114 | 114 | $panelContext['plotArea']['width'] = intval($plotAreaNode->getAttribute('width')); |
115 | 115 | } |
116 | + //BG COLOR | |
117 | + $panelContext['plotArea']['plotAreaBackgroundColor'] = ($plotAreaNode->getAttribute('plotAreaBackgroundColor')); | |
116 | 118 | |
117 | 119 | //hasSpectro |
118 | 120 | $panelContext['plotArea']['hasSpectro'] = ($plotAreaNode->getAttribute('hasSpectro') == "true"); |
... | ... | @@ -127,7 +129,8 @@ class IHMPlotContextFileClass |
127 | 129 | 'id' => $axisNode->getAttribute('id'), |
128 | 130 | 'logarithmic' => ($axisNode->getAttribute('logarithmic') == "true"), |
129 | 131 | 'min' => floatval($axisNode->getAttribute('min')), |
130 | - 'max' => floatval($axisNode->getAttribute('max')) | |
132 | + 'max' => floatval($axisNode->getAttribute('max')), | |
133 | + 'colorsList' => $axisNode->getAttribute('colorsList') | |
131 | 134 | ); |
132 | 135 | |
133 | 136 | $panelContext['plotArea']['axes'][] = $axisContext; | ... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementHistoNodeClass.php
0 โ 100644
... | ... | @@ -0,0 +1,50 @@ |
1 | +<?php | |
2 | + | |
3 | +require_once("RequestOutputPlotElementNodeClass.php"); | |
4 | + | |
5 | +define ("REQUESTOUTPUTPLOTELEMENTHISTO_NAME", "histoPlot"); | |
6 | +define ("REQUESTOUTPUTPLOTELEMENTHISTO_XAXISID", "xaxis_id"); | |
7 | + | |
8 | +/** | |
9 | + * @class RequestOutputPlotElementXYNodeClass | |
10 | + * @brief Definition of a histogram plot element for a panel of a plot request | |
11 | + * @details | |
12 | +*/ | |
13 | +class RequestOutputPlotElementHistoNodeClass extends RequestOutputPlotElementNodeClass | |
14 | +{ | |
15 | + public function __construct() | |
16 | + { | |
17 | + parent::__construct(REQUESTOUTPUTPLOTELEMENTHISTO_NAME,true,false,false,false,false,false); | |
18 | + //create x axis | |
19 | + $this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS,REQUESTOUTPUTPLOTELEMENTHISTO_XAXISID); | |
20 | + //force color axis creation | |
21 | + $this->getAxes()->getColorAxis(); | |
22 | + } | |
23 | + | |
24 | + public function getXAxis() | |
25 | + { | |
26 | + return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS,REQUESTOUTPUTPLOTELEMENTHISTO_XAXISID); | |
27 | + } | |
28 | + | |
29 | + public function addYAxis($id) | |
30 | + { | |
31 | + return $this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS,$id); | |
32 | + } | |
33 | + | |
34 | + public function getYAxis($id) | |
35 | + { | |
36 | + return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS,$id); | |
37 | + } | |
38 | + | |
39 | + public function getZAxis() | |
40 | + { | |
41 | + return $this->getAxes()->getColorAxis(); | |
42 | + } | |
43 | + | |
44 | + public function loadFromNode($xmlNode) | |
45 | + { | |
46 | + parent::loadFromNode($xmlNode); | |
47 | + } | |
48 | +} | |
49 | + | |
50 | +?> | |
0 | 51 | \ No newline at end of file | ... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotHistogram1DSerieNodeClass.php
0 โ 100644
... | ... | @@ -0,0 +1,120 @@ |
1 | +<?php | |
2 | + | |
3 | +require_once "RequestOutputPlotResamplingNodeClass.php"; | |
4 | +require_once "RequestOutputPlotYSerieErrorBarNodeClass.php"; | |
5 | + | |
6 | +define ("REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_NAME", "histogram1d"); | |
7 | +define ("REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_INDEX", "index"); | |
8 | +define ("REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_COLOR", "color"); | |
9 | + | |
10 | +define ("REQUESTOUTPUTPLOTBINS_NAME", "bins"); | |
11 | +define ("REQUESTOUTPUTPLOTBINS_MANUAL", "manual"); | |
12 | +define ("REQUESTOUTPUTPLOTBINS_XBINNUMBER", "xbinnumber"); | |
13 | + | |
14 | +define ("REQUESTOUTPUTPLOTHISTOTYPE_NAME", "histotype"); | |
15 | +define ("REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION", "type"); | |
16 | +/** | |
17 | + * @class RequestOutputPlotHistogram1DSerieNodeClass | |
18 | + * @brief Definition of a histogram1D for a plot of a plot request | |
19 | + * @details | |
20 | +*/ | |
21 | + | |
22 | +class RequestOutputPlotBins1DNodeClass extends NodeClass | |
23 | +{ | |
24 | + public function __construct($name) | |
25 | + { | |
26 | + parent::__construct($name); | |
27 | + } | |
28 | + | |
29 | + public function addManual1DBins($xBinNumber) | |
30 | + { | |
31 | + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBINS_MANUAL); | |
32 | + | |
33 | + if (!isset($node)) | |
34 | + { | |
35 | + $node = new NodeClass(REQUESTOUTPUTPLOTBINS_MANUAL); | |
36 | + $this->addChild($node); | |
37 | + } | |
38 | + | |
39 | + $node->setAttribute(REQUESTOUTPUTPLOTBINS_XBINNUMBER, $xBinNumber); | |
40 | + return $node; | |
41 | + } | |
42 | + | |
43 | +} | |
44 | + | |
45 | +class RequestOutputPlotHistotype1DNodeClass extends NodeClass | |
46 | +{ | |
47 | + public function __construct($name) | |
48 | + { | |
49 | + parent::__construct($name); | |
50 | + } | |
51 | + | |
52 | + public function set1DFunction($type){ | |
53 | + $this->setAttribute(REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION, $type); | |
54 | + } | |
55 | + public function get1DFunction(){ | |
56 | + return $this->getAttribute(REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION); | |
57 | + } | |
58 | +} | |
59 | + | |
60 | +class RequestOutputPlotHistogram1DSerieNodeClass extends RequestOutputPlotBaseSerieNodeClass | |
61 | +{ | |
62 | + public function __construct($name) | |
63 | + { | |
64 | + parent::__construct($name); | |
65 | + } | |
66 | + | |
67 | + public function getBins() | |
68 | + { | |
69 | + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBINS_NAME); | |
70 | + | |
71 | + if (!isset($node)) | |
72 | + { | |
73 | + $node = new RequestOutputPlotBins1DNodeClass(REQUESTOUTPUTPLOTBINS_NAME); | |
74 | + $this->addChild($node); | |
75 | + } | |
76 | + | |
77 | + return $node; | |
78 | + } | |
79 | + | |
80 | + public function getHistotype() | |
81 | + { | |
82 | + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTHISTOTYPE_NAME); | |
83 | + | |
84 | + if (!isset($node)) | |
85 | + { | |
86 | + $node = new RequestOutputPlotHistotype1DNodeClass(REQUESTOUTPUTPLOTHISTOTYPE_NAME); | |
87 | + $this->addChild($node); | |
88 | + } | |
89 | + | |
90 | + return $node; | |
91 | + } | |
92 | + | |
93 | + public function setColor($color) | |
94 | + { | |
95 | + $this->setAttribute(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_COLOR, $color); | |
96 | + } | |
97 | + | |
98 | + public function getColor() | |
99 | + { | |
100 | + return $this->getAttribute(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_COLOR); | |
101 | + } | |
102 | + | |
103 | + public function setIndex($index) | |
104 | + { | |
105 | + $this->setAttribute(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_INDEX, $index); | |
106 | + } | |
107 | + | |
108 | + public function getIndex() | |
109 | + { | |
110 | + return $this->getAttribute(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_INDEX); | |
111 | + } | |
112 | + | |
113 | + public function loadFromNode($xmlNode) | |
114 | + { | |
115 | + $this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_INDEX)); | |
116 | + parent::loadFromNode($xmlNode); | |
117 | + } | |
118 | +} | |
119 | + | |
120 | +?> | ... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelNodeClass.php
... | ... | @@ -23,6 +23,7 @@ abstract class RequestOutputPlotElementTypeEnum |
23 | 23 | { |
24 | 24 | const TIMEPLOT = "TimePlot"; |
25 | 25 | const XYPLOT = "XYPlot"; |
26 | + const HISTOPLOT = "HistoPlot"; | |
26 | 27 | const STATUSPLOT = "StatusPlot"; |
27 | 28 | const TICKPLOT = "TickPlot"; |
28 | 29 | const EPOCHPLOT = "EpochPlot"; |
... | ... | @@ -107,6 +108,9 @@ class RequestOutputPlotPanelNodeClass extends NodeClass |
107 | 108 | case RequestOutputPlotElementTypeEnum::XYPLOT: |
108 | 109 | $node = new RequestOutputPlotElementXYNodeClass(); |
109 | 110 | break; |
111 | + case RequestOutputPlotElementTypeEnum::HISTOPLOT: | |
112 | + $node = new RequestOutputPlotElementHistoNodeClass(); | |
113 | + break; | |
110 | 114 | case RequestOutputPlotElementTypeEnum::STATUSPLOT: |
111 | 115 | $node = new RequestOutputPlotElementStatusNodeClass($noAxes); |
112 | 116 | break; | ... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
... | ... | @@ -115,6 +115,18 @@ class RequestOutputPlotParamNodeClass extends NodeClass |
115 | 115 | return $histogram2dNode; |
116 | 116 | } |
117 | 117 | |
118 | + public function addHistogram1DSerie($yAxis, $index, $color) | |
119 | + { | |
120 | + $histogram1dNode = new RequestOutputPlotHistogram1DSerieNodeClass(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_NAME); | |
121 | + $histogram1dNode->setColor($color); | |
122 | + $histogram1dNode->setXAxisId(REQUESTOUTPUTPLOTELEMENTXY_XAXISID); | |
123 | + $histogram1dNode->setYAxisId($yAxis); | |
124 | + if ($index >= 0) | |
125 | + $histogram1dNode->setIndex($index); | |
126 | + $this->addChild($histogram1dNode); | |
127 | + return $histogram1dNode; | |
128 | + } | |
129 | + | |
118 | 130 | public function addOrbitSerie($yAxis, $colorSerieId = -1) |
119 | 131 | { |
120 | 132 | $orbitSerieNode = new RequestOutputPlotOrbitSerieNodeClass(); | ... | ... |