RequestOutputPlotYSerieNodeClass.php
2.05 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
<?php
require_once "RequestOutputPlotResamplingNodeClass.php";
require_once "RequestOutputPlotYSerieErrorBarNodeClass.php";
define ("REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME", "yserie");
define ("REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME", "serie");
define ("REQUESTOUTPUTPLOTYSERIE_INDEX", "index");
define ("REQUESTOUTPUTPLOTYSERIE_RESAMPLING", "resampling");
define ("REQUESTOUTPUTPLOTYSERIE_ERRORBAR", "errorBar");
/**
* @class RequestOutputPlotYSerieNodeClass
* @brief Definition of a yserie for a plot of a plot request
* @details
*/
class RequestOutputPlotYSerieNodeClass extends RequestOutputPlotBaseSerieNodeClass
{
public function __construct($name)
{
parent::__construct($name);
}
public function setIndex($index)
{
$this->setAttribute(REQUESTOUTPUTPLOTYSERIE_INDEX, $index);
}
public function getIndex()
{
return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_INDEX);
}
public function getResampling()
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_RESAMPLING);
if (!isset($node))
{
$node = new RequestOutputPlotResamplingNodeClass(REQUESTOUTPUTPLOTYSERIE_RESAMPLING);
$this->addChild($node);
}
return $node;
}
public function getErrorBar()
{
$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_ERRORBAR);
if (!isset($node))
{
$node = new RequestOutputPlotYSerieErrorBarNodeClass(REQUESTOUTPUTPLOTYSERIE_ERRORBAR);
$this->addChild($node);
}
return $node;
}
public function loadFromNode($xmlNode)
{
$this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIE_INDEX));
$resamplingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTYSERIE_RESAMPLING);
if (isset($resamplingXmlNode))
$this->getResampling()->loadFromNode($resamplingXmlNode);
$errorbarXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTYSERIE_ERRORBAR);
if (isset($errorbarXmlNode))
$this->getErrorBar()->loadFromNode($errorbarXmlNode);
parent::loadFromNode($xmlNode);
}
}
?>