RequestOutputPlotHistogram1DSerieNodeClass.php
3.03 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
<?php
require_once "RequestOutputPlotResamplingNodeClass.php";
require_once "RequestOutputPlotYSerieErrorBarNodeClass.php";
define ("REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_NAME", "histogram1d");
define ("REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_INDEX", "index");
define ("REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_COLOR", "color");
define ("REQUESTOUTPUTPLOTBINS_NAME", "bins");
define ("REQUESTOUTPUTPLOTBINS_MANUAL", "manual");
define ("REQUESTOUTPUTPLOTBINS_XBINNUMBER", "xbinnumber");
define ("REQUESTOUTPUTPLOTBINS_STAIRS", "stairs");
define ("REQUESTOUTPUTPLOTHISTOTYPE_NAME", "histotype");
define ("REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION", "type");
/**
* @class RequestOutputPlotHistogram1DSerieNodeClass
* @brief Definition of a histogram1D for a plot of a plot request
* @details
*/
class RequestOutputPlotBins1DNodeClass extends NodeClass
{
public function __construct($name)
{
parent::__construct($name);
}
public function addManual1DBins($xBinNumber, $stairs)
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBINS_MANUAL);
if (!isset($node))
{
$node = new NodeClass(REQUESTOUTPUTPLOTBINS_MANUAL);
$this->addChild($node);
}
$node->setAttribute(REQUESTOUTPUTPLOTBINS_XBINNUMBER, $xBinNumber);
$node->setAttribute(REQUESTOUTPUTPLOTBINS_STAIRS, $stairs);
return $node;
}
}
class RequestOutputPlotHistotype1DNodeClass extends NodeClass
{
public function __construct($name)
{
parent::__construct($name);
}
public function set1DFunction($type){
$this->setAttribute(REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION, $type);
}
public function get1DFunction(){
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOTYPE_FUNCTION);
}
}
class RequestOutputPlotHistogram1DSerieNodeClass extends RequestOutputPlotBaseSerieNodeClass
{
public function __construct($name)
{
parent::__construct($name);
}
public function getBins()
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBINS_NAME);
if (!isset($node))
{
$node = new RequestOutputPlotBins1DNodeClass(REQUESTOUTPUTPLOTBINS_NAME);
$this->addChild($node);
}
return $node;
}
public function getHistotype()
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTHISTOTYPE_NAME);
if (!isset($node))
{
$node = new RequestOutputPlotHistotype1DNodeClass(REQUESTOUTPUTPLOTHISTOTYPE_NAME);
$this->addChild($node);
}
return $node;
}
public function setColor($color)
{
$this->setAttribute(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_COLOR, $color);
}
public function getColor()
{
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_COLOR);
}
public function setIndex($index)
{
$this->setAttribute(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_INDEX, $index);
}
public function getIndex()
{
return $this->getAttribute(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_INDEX);
}
public function loadFromNode($xmlNode)
{
$this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_INDEX));
parent::loadFromNode($xmlNode);
}
}
?>