Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieNodeClass.php 2.27 KB
22521f1c   Benjamin Renard   First commit
1
2
<?php

966bd5f8   Benjamin Renard   Add request to ge...
3
4
5
require_once "RequestOutputPlotResamplingNodeClass.php";
require_once "RequestOutputPlotYSerieErrorBarNodeClass.php";

22521f1c   Benjamin Renard   First commit
6
7
8
define ("REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME", "yserie");
define ("REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME", "serie");

22521f1c   Benjamin Renard   First commit
9
define ("REQUESTOUTPUTPLOTYSERIE_INDEX", "index");
c0e7e5be   Benjamin Renard   Add integration f...
10
define ("REQUESTOUTPUTPLOTYSERIE_RESAMPLING", "resampling");
26a23052   Benjamin Renard   Add Interval Tick...
11
define ("REQUESTOUTPUTPLOTYSERIE_ERRORBAR", "errorBar");
22521f1c   Benjamin Renard   First commit
12
13
14
15
16
17

/**
 * @class RequestOutputPlotYSerieNodeClass
 * @brief Definition of a yserie for a plot of a plot request
 * @details
*/
26a23052   Benjamin Renard   Add Interval Tick...
18
class RequestOutputPlotYSerieNodeClass extends RequestOutputPlotBaseSerieNodeClass
22521f1c   Benjamin Renard   First commit
19
20
21
22
23
24
{
	public function __construct($name)
	{
		parent::__construct($name);
	}

f822811a   Benjamin Renard   Implements multi ...
25
26
27
28
29
30
31
32
33
34
	public function setXAxisId($axisId)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTBASESERIE_XAXIS, $axisId);
	}

	public function getXAxisId()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTBASESERIE_XAXIS);
	}

22521f1c   Benjamin Renard   First commit
35
36
37
38
	public function setIndex($index)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTYSERIE_INDEX, $index);
	}
26a23052   Benjamin Renard   Add Interval Tick...
39
	
22521f1c   Benjamin Renard   First commit
40
41
42
43
	public function getIndex()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_INDEX);
	}
4ede4320   Benjamin Renard   Integration for s...
44
	
c0e7e5be   Benjamin Renard   Add integration f...
45
46
47
48
49
50
51
52
53
54
55
56
57
	public function getResampling()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_RESAMPLING);
		
		if (!isset($node))
		{
			$node = new RequestOutputPlotResamplingNodeClass(REQUESTOUTPUTPLOTYSERIE_RESAMPLING);
			$this->addChild($node);
		}
		
		return $node;
	}
	
26a23052   Benjamin Renard   Add Interval Tick...
58
	public function getErrorBar()
f012b419   Benjamin Renard   Add integration f...
59
	{
26a23052   Benjamin Renard   Add Interval Tick...
60
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_ERRORBAR);
f012b419   Benjamin Renard   Add integration f...
61
62
63
	
		if (!isset($node))
		{
26a23052   Benjamin Renard   Add Interval Tick...
64
			$node = new RequestOutputPlotYSerieErrorBarNodeClass(REQUESTOUTPUTPLOTYSERIE_ERRORBAR);
f012b419   Benjamin Renard   Add integration f...
65
66
67
68
69
			$this->addChild($node);
		}
	
		return $node;
	}
966bd5f8   Benjamin Renard   Add request to ge...
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
	
	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);
	}
22521f1c   Benjamin Renard   First commit
85
86
}

f822811a   Benjamin Renard   Implements multi ...
87
?>