Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieNodeClass.php 2.05 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);
	}

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

?>