Blame view

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

cb46dfbf   Benjamin Renard   Fix orbit serie a...
9
define ("REQUESTOUTPUTPLOTYSERIE_XID", "xId");
22521f1c   Benjamin Renard   First commit
10
define ("REQUESTOUTPUTPLOTYSERIE_INDEX", "index");
60a1a563   Benjamin Renard   Add the possibili...
11
define ("REQUESTOUTPUTPLOTYSERIE_RESOLUTION", "resolution");
c0e7e5be   Benjamin Renard   Add integration f...
12
define ("REQUESTOUTPUTPLOTYSERIE_RESAMPLING", "resampling");
26a23052   Benjamin Renard   Add Interval Tick...
13
define ("REQUESTOUTPUTPLOTYSERIE_ERRORBAR", "errorBar");
22521f1c   Benjamin Renard   First commit
14
15
16
17
18
19

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

22521f1c   Benjamin Renard   First commit
27
28
29
30
	public function setIndex($index)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTYSERIE_INDEX, $index);
	}
26a23052   Benjamin Renard   Add Interval Tick...
31
	
22521f1c   Benjamin Renard   First commit
32
33
34
35
	public function getIndex()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_INDEX);
	}
cb46dfbf   Benjamin Renard   Fix orbit serie a...
36

60a1a563   Benjamin Renard   Add the possibili...
37
38
39
40
41
42
43
44
45
46
	public function setResolution($resolution)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTYSERIE_RESOLUTION, $resolution);
	}

	public function getResolution()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_RESOLUTION);
	}

cb46dfbf   Benjamin Renard   Fix orbit serie a...
47
48
49
50
51
52
53
54
55
	public function setXId($xId)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTYSERIE_XID, $xId);
	}

	public function getXId()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTYSERIE_XID);
	}
4ede4320   Benjamin Renard   Integration for s...
56
	
c0e7e5be   Benjamin Renard   Add integration f...
57
58
59
60
61
62
63
64
65
66
67
68
69
	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...
70
	public function getErrorBar()
f012b419   Benjamin Renard   Add integration f...
71
	{
26a23052   Benjamin Renard   Add Interval Tick...
72
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTYSERIE_ERRORBAR);
f012b419   Benjamin Renard   Add integration f...
73
74
75
	
		if (!isset($node))
		{
26a23052   Benjamin Renard   Add Interval Tick...
76
			$node = new RequestOutputPlotYSerieErrorBarNodeClass(REQUESTOUTPUTPLOTYSERIE_ERRORBAR);
f012b419   Benjamin Renard   Add integration f...
77
78
79
80
81
			$this->addChild($node);
		}
	
		return $node;
	}
966bd5f8   Benjamin Renard   Add request to ge...
82
83
84
85
	
	public function loadFromNode($xmlNode)
	{
		$this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIE_INDEX));
cb46dfbf   Benjamin Renard   Fix orbit serie a...
86
87
88
89

		$xId = $this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIE_XID);
		if (!empty($xId))
			$this->setXId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIE_XID));
966bd5f8   Benjamin Renard   Add request to ge...
90
91
92
93
94
95
96
97
98
99
100
		
		$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
101
102
}

f822811a   Benjamin Renard   Implements multi ...
103
?>