RequestOutputPlotHistogram2DSerieNodeClass.php
4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
require_once "RequestOutputPlotResamplingNodeClass.php";
require_once "RequestOutputPlotYSerieErrorBarNodeClass.php";
define ("REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_NAME", "histogram2d");
define ("REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_XID", "xId");
define ("REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_INDEX", "index");
define ("REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_RESAMPLING", "resampling");
define ("REQUESTOUTPUTPLOTBINS_NAME", "bins");
define ("REQUESTOUTPUTPLOTBINS_MANUAL", "manual");
define ("REQUESTOUTPUTPLOTBINS_XBINNUMBER", "xbinnumber");
define ("REQUESTOUTPUTPLOTBINS_YBINNUMBER", "ybinnumber");
define ("REQUESTOUTPUTPLOTHISTOTYPE_NAME", "histotype");
define ("REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION", "type");
define ("REQUESTOUTPUTPLOTHISTOTYPE_SMOOTHFACTOR", "smoothfactor");
define ("REQUESTOUTPUTPLOTHISTOTYPE_PARAMID", "paramId");
define ("REQUESTOUTPUTPLOTHISTOTYPE_INDEX", "index");
/**
* @class RequestOutputPlotHistogram2DSerieNodeClass
* @brief Definition of a histogram2d for a plot of a plot request
* @details
*/
class RequestOutputPlotBinsNodeClass extends NodeClass
{
public function __construct($name)
{
parent::__construct($name);
}
public function addManualBins($xBinNumber, $yBinNumber)
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBINS_MANUAL);
if (!isset($node))
{
$node = new NodeClass(REQUESTOUTPUTPLOTBINS_MANUAL);
$this->addChild($node);
}
$node->setAttribute(REQUESTOUTPUTPLOTBINS_XBINNUMBER, $xBinNumber);
$node->setAttribute(REQUESTOUTPUTPLOTBINS_YBINNUMBER, $yBinNumber);
return $node;
}
}
class RequestOutputPlotHistotypeNodeClass extends NodeClass
{
public function __construct($name)
{
parent::__construct($name);
}
public function setFunction($type){
$this->setAttribute(REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION, $type);
}
public function getFunction(){
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION);
}
public function setSmoothFactor($smoothFactor){
$this->setAttribute(REQUESTOUTPUTPLOTHISTOTYPE_SMOOTHFACTOR, $smoothFactor);
}
public function getSmoothFactor(){
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOTYPE_SMOOTHFACTOR);
}
public function setParamId($paramId){
$this->setAttribute(REQUESTOUTPUTPLOTHISTOTYPE_PARAMID, $paramId);
}
public function getParamId(){
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOTYPE_PARAMID);
}
public function setIndex($index){
$this->setAttribute(REQUESTOUTPUTPLOTHISTOTYPE_INDEX, $index);
}
public function getIndex(){
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOTYPE_INDEX);
}
}
class RequestOutputPlotHistogram2DSerieNodeClass extends RequestOutputPlotBaseSerieNodeClass
{
public function __construct($name)
{
parent::__construct($name);
}
public function getBins()
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBINS_NAME);
if (!isset($node))
{
$node = new RequestOutputPlotBinsNodeClass(REQUESTOUTPUTPLOTBINS_NAME);
$this->addChild($node);
}
return $node;
}
public function getHistotype()
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTHISTOTYPE_NAME);
if (!isset($node))
{
$node = new RequestOutputPlotHistotypeNodeClass(REQUESTOUTPUTPLOTHISTOTYPE_NAME);
$this->addChild($node);
}
return $node;
}
public function setIndex($index)
{
$this->setAttribute(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_INDEX, $index);
}
public function getIndex()
{
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_INDEX);
}
public function setXId($xId)
{
$this->setAttribute(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_XID, $xId);
}
public function getXId()
{
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_XID);
}
public function getResampling()
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_RESAMPLING);
if (!isset($node))
{
$node = new RequestOutputPlotResamplingNodeClass(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_RESAMPLING);
$this->addChild($node);
}
return $node;
}
public function loadFromNode($xmlNode)
{
$this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_INDEX));
$xId = $this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_XID);
if (!empty($xId))
$this->setXId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_XID));
$resamplingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_RESAMPLING);
if (isset($resamplingXmlNode))
$this->getResampling()->loadFromNode($resamplingXmlNode);
parent::loadFromNode($xmlNode);
}
}
?>