Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieTimeTicksNodeClass.php 3.67 KB
f012b419   Benjamin Renard   Add integration f...
1
2
<?php

26a23052   Benjamin Renard   Add Interval Tick...
3
4
5
6
7
8
define ("REQUESTOUTPUTPLOTSERIETIMETICKS_STEP", "step");
define ("REQUESTOUTPUTPLOTSERIETIMETICKS_NUMBER", "number");
define ("REQUESTOUTPUTPLOTSERIETIMETICKS_MINOR", "minor");
define ("REQUESTOUTPUTPLOTSERIETIMETICKS_COLOR", "color");
define ("REQUESTOUTPUTPLOTSERIETIMETICKS_SYMBOL", "symbol");
define ("REQUESTOUTPUTPLOTSERIETIMETICKS_FIRSTSYMBOL", "firstSymbol");
f012b419   Benjamin Renard   Add integration f...
9
10

/**
26a23052   Benjamin Renard   Add Interval Tick...
11
12
 * @class RequestOutputPlotSerieTimeTicksNodeClass
 * @brief Definition of time ticks element for a serie of a plot
f012b419   Benjamin Renard   Add integration f...
13
14
 * @details
 */
26a23052   Benjamin Renard   Add Interval Tick...
15
class RequestOutputPlotSerieTimeTicksNodeClass extends NodeClass
f012b419   Benjamin Renard   Add integration f...
16
17
18
19
20
21
{
	public function __construct($name)
	{
		parent::__construct($name);
	}

966bd5f8   Benjamin Renard   Add request to ge...
22
23
24
25
26
27
	public function isSymbolDefined()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIETIMETICKS_SYMBOL);
		return isset($node);
	}
	
f012b419   Benjamin Renard   Add integration f...
28
29
	public function getSymbol()
	{
26a23052   Benjamin Renard   Add Interval Tick...
30
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIETIMETICKS_SYMBOL);
f012b419   Benjamin Renard   Add integration f...
31
32
33
	
		if (!isset($node))
		{
26a23052   Benjamin Renard   Add Interval Tick...
34
			$node = new RequestOutputPlotSymbolNodeClass(REQUESTOUTPUTPLOTSERIETIMETICKS_SYMBOL);
f012b419   Benjamin Renard   Add integration f...
35
36
37
38
39
40
			$this->addChild($node);
		}
	
		return $node;
	}
	
966bd5f8   Benjamin Renard   Add request to ge...
41
42
43
44
45
46
	public function isFirstSymbolDefined()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIETIMETICKS_FIRSTSYMBOL);
		return isset($node);
	}
	
f012b419   Benjamin Renard   Add integration f...
47
48
	public function getFirstSymbol()
	{
26a23052   Benjamin Renard   Add Interval Tick...
49
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIETIMETICKS_FIRSTSYMBOL);
f012b419   Benjamin Renard   Add integration f...
50
51
52
	
		if (!isset($node))
		{
26a23052   Benjamin Renard   Add Interval Tick...
53
			$node = new RequestOutputPlotSymbolNodeClass(REQUESTOUTPUTPLOTSERIETIMETICKS_FIRSTSYMBOL);
f012b419   Benjamin Renard   Add integration f...
54
55
56
57
58
59
			$this->addChild($node);
		}
	
		return $node;
	}
	
966bd5f8   Benjamin Renard   Add request to ge...
60
61
62
63
64
65
	public function isFontDefined()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTFONT_NODENAME);
		return isset($node);
	}
	
f012b419   Benjamin Renard   Add integration f...
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
	public function getFont()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTFONT_NODENAME);
	
		if (!isset($node))
		{
			$node = new RequestOutputPlotFontNodeClass();
			$this->addChild($node);
		}
	
		return $node;
	}
	
	public function setStep($step)
	{
26a23052   Benjamin Renard   Add Interval Tick...
81
		$this->setAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_STEP, $step);
f012b419   Benjamin Renard   Add integration f...
82
83
84
85
	}
	
	public function getStep()
	{
26a23052   Benjamin Renard   Add Interval Tick...
86
		return $this->getAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_STEP);
f012b419   Benjamin Renard   Add integration f...
87
88
89
90
	}
	
	public function setNumber($number)
	{
26a23052   Benjamin Renard   Add Interval Tick...
91
		$this->setAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_NUMBER, $number);
f012b419   Benjamin Renard   Add integration f...
92
93
94
95
	}
	
	public function getNumber()
	{
26a23052   Benjamin Renard   Add Interval Tick...
96
		return $this->getAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_NUMBER);
f012b419   Benjamin Renard   Add integration f...
97
98
99
100
	}
	
	public function setMinor($minor)
	{
26a23052   Benjamin Renard   Add Interval Tick...
101
		$this->setAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_MINOR, $minor);
f012b419   Benjamin Renard   Add integration f...
102
103
104
105
	}
	
	public function getMinor()
	{
26a23052   Benjamin Renard   Add Interval Tick...
106
		return $this->getAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_MINOR);
f012b419   Benjamin Renard   Add integration f...
107
108
109
110
	}
	
	public function setColor($color)
	{
26a23052   Benjamin Renard   Add Interval Tick...
111
		$this->setAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_COLOR, $color);
f012b419   Benjamin Renard   Add integration f...
112
113
114
115
	}
	
	public function getColor()
	{
26a23052   Benjamin Renard   Add Interval Tick...
116
		return $this->getAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_COLOR);
f012b419   Benjamin Renard   Add integration f...
117
	}
966bd5f8   Benjamin Renard   Add request to ge...
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
	
	public function loadFromNode($xmlNode)
	{
		$symbolXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_SYMBOL);
		if (isset($symbolXmlNode))
			$this->getSymbol()->loadFromNode($symbolXmlNode);
		
		$firstsymbolXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_FIRSTSYMBOL);
		if (isset($firstsymbolXmlNode))
			$this->getFirstSymbol()->loadFromNode($firstsymbolXmlNode);
		
		$fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFONT_NODENAME);
		if (isset($fontXmlNode))
			$this->getFont()->loadFromNode($fontXmlNode);
		
		$this->setStep($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_STEP));
		$this->setNumber($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_NUMBER));
		$this->setMinor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_MINOR));
		$this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_COLOR));
	}
f012b419   Benjamin Renard   Add integration f...
138
139
140
}

?>