Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieIntervalTicksNodeClass.php 2.5 KB
26a23052   Benjamin Renard   Add Interval Tick...
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
<?php

define ("REQUESTOUTPUTPLOTSERIEINTERVALTICKS_MODE", "mode");
define ("REQUESTOUTPUTPLOTSERIEINTERVALTICKS_COLOR", "color");
define ("REQUESTOUTPUTPLOTSERIEINTERVALTICKS_SYMBOL", "symbol");

abstract class RequestOutputPlotSerieIntervalTicksModeEnum
{
	const SYMBOLONLY    = "symbol-only";
	const INTERVALINDEX = "interval-index";
	const STARTTIME     = "start-time";
	const STARTSTOPTIME = "start-stop-time";
}
	
/**
 * @class RequestOutputPlotSerieIntervalTicksNodeClass
 * @brief Definition of interval ticks element for a serie of a plot
 * @details
 */
class RequestOutputPlotSerieIntervalTicksNodeClass extends NodeClass
{
	public function __construct($name)
	{
		parent::__construct($name);
	}

	public function setMode($mode)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_MODE, $mode);
	}
	
	public function getMode()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_MODE);
	}
	
	public function setColor($color)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_COLOR, $color);
	}
	
	public function getColor()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_COLOR);
	}
	
966bd5f8   Benjamin Renard   Add request to ge...
47
48
49
50
51
52
	public function isSymbolDefined()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_SYMBOL);
		return isset($node);
	}
	
26a23052   Benjamin Renard   Add Interval Tick...
53
54
55
56
57
58
59
60
61
62
63
64
65
	public function getSymbol()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_SYMBOL);
	
		if (!isset($node))
		{
			$node = new RequestOutputPlotSymbolNodeClass(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_SYMBOL);
			$this->addChild($node);
		}
	
		return $node;
	}
	
966bd5f8   Benjamin Renard   Add request to ge...
66
67
68
69
70
71
	public function isFontDefined()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTFONT_NODENAME);
		return isset($node);
	}
	
26a23052   Benjamin Renard   Add Interval Tick...
72
73
74
75
76
77
78
79
80
81
82
83
	public function getFont()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTFONT_NODENAME);
	
		if (!isset($node))
		{
			$node = new RequestOutputPlotFontNodeClass();
			$this->addChild($node);
		}
	
		return $node;
	}
966bd5f8   Benjamin Renard   Add request to ge...
84
85
86
87
88
89
90
91
92
93
94
95
96
97
	
	public function loadFromNode($xmlNode)
	{
		$this->setMode($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIEINTERVALTICKS_MODE));
		$this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIEINTERVALTICKS_COLOR));
		
		$symbolXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTSERIEINTERVALTICKS_SYMBOL);
		if (isset($symbolXmlNode))
			$this->getSymbol()->loadFromNode($symbolXmlNode);
		
		$fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFONT_NODENAME);
		if (isset($fontXmlNode))
			$this->getFont()->loadFromNode($fontXmlNode);
	}
26a23052   Benjamin Renard   Add Interval Tick...
98
99
100
}

?>