RequestOutputPlotParamsNodeClass.php
4.5 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
require_once("RequestOutputPlotYSerieNodeClass.php");
define ("REQUESTOUTPUTPLOTPARAMS_NAME", "params");
define ("REQUESTOUTPUTPLOTPARAM_NAME", "param");
define ("REQUESTOUTPUTPLOTPARAM_ID", "id");
define ("REQUESTOUTPUTPLOTXSERIE_NAME", "xserie");
define ("REQUESTOUTPUTPLOTXSERIE_XAXIS", "xAxis");
define ("REQUESTOUTPUTPLOTXSERIE_INDEX", "index");
define ("REQUESTOUTPUTPLOTCOLORSERIE_NAME", "colorserie");
define ("REQUESTOUTPUTPLOTCOLORSERIE_ID", "id");
define ("REQUESTOUTPUTPLOTCOLORSERIE_INDEX", "index");
define ("REQUESTOUTPUTPLOTSPECTRO_NAME", "spectro");
define ("REQUESTOUTPUTPLOTSPECTRO_YAXIS", "yAxis");
define ("REQUESTOUTPUTPLOTSTATUSBAR_NAME", "serie");
define ("REQUESTOUTPUTPLOTSTATUSBAR_INDEX", "index");
define ("REQUESTOUTPUTPLOTTICKBAR_NAME", "serie");
define ("REQUESTOUTPUTPLOTTICKBAR_INDEX", "index");
/**
* @class RequestOutputPlotParamNodeClass
* @brief Definition of a param for a plot of a plot request
* @details
*/
class RequestOutputPlotParamNodeClass extends NodeClass
{
public function __construct($id)
{
parent::__construct(REQUESTOUTPUTPLOTPARAM_NAME);
$this->setAttribute(REQUESTOUTPUTPLOTPARAM_ID, $id);
}
public function getId()
{
return $this->getAttribute(REQUESTOUTPUTPLOTPARAM_ID);
}
public function addYSerie($yAxis, $index, $xAxis = "", $colorSerieId = -1)
{
if ($xAxis != "")
{
$ySerieNode = new RequestOutputPlotYSerieNodeClass(REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME);
$ySerieNode->setXAxisId($xAxis);
}
else
$ySerieNode = new RequestOutputPlotYSerieNodeClass(REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME);
$ySerieNode->setYAxisId($yAxis);
if ($index >= 0)
$ySerieNode->setIndex($index);
if ($colorSerieId >= 0)
$ySerieNode->setColorSerieId($colorSerieId);
$this->addChild($ySerieNode);
return $ySerieNode;
}
public function addOrbitSerie($yAxis, $xAxis, $colorSerieId = -1)
{
$orbitSerieNode = new RequestOutputPlotOrbitSerieNodeClass();
$orbitSerieNode->setYAxisId($yAxis);
$orbitSerieNode->setXAxisId($xAxis);
if ($colorSerieId >= 0)
$orbitSerieNode->setColorSerieId($colorSerieId);
$this->addChild($orbitSerieNode);
return $orbitSerieNode;
}
public function addInstantSerie($xAxis, $yAxis)
{
$iserieNode = new RequestOutputPlotInstantSerieNodeClass();
$iserieNode->setXAxisId($xAxis);
$iserieNode->setYAxisId($yAxis);
$this->addChild($iserieNode);
return $iserieNode;
}
public function addSpectro($yAxis)
{
$spectroNode = new NodeClass(REQUESTOUTPUTPLOTSPECTRO_NAME);
$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS, $yAxis);
$this->addChild($spectroNode);
return $spectroNode;
}
public function addXSerie($xAxis, $index)
{
$xSerieNode = new NodeClass(REQUESTOUTPUTPLOTXSERIE_NAME);
$xSerieNode->setAttribute(REQUESTOUTPUTPLOTXSERIE_XAXIS, $xAxis);
if ($index >= 0)
$xSerieNode->setAttribute(REQUESTOUTPUTPLOTXSERIE_INDEX, $index);
$this->addChild($xSerieNode);
return $xSerieNode;
}
public function addColorSerie($id, $index)
{
$colorSerieNode = new NodeClass(REQUESTOUTPUTPLOTCOLORSERIE_NAME);
$colorSerieNode->setAttribute(REQUESTOUTPUTPLOTCOLORSERIE_ID, $id);
if ($index >= 0)
$colorSerieNode->setAttribute(REQUESTOUTPUTPLOTCOLORSERIE_INDEX, $index);
$this->addChild($colorSerieNode);
return $colorSerieNode;
}
public function addStatusBar($index)
{
$statusBarNode = new NodeClass(REQUESTOUTPUTPLOTSTATUSBAR_NAME);
if ($index >= 0)
$statusBarNode->setAttribute(REQUESTOUTPUTPLOTSTATUSBAR_INDEX, $index);
$this->addChild($statusBarNode);
return $statusBarNode;
}
public function addTickBar($index)
{
$tickBarNode = new NodeClass(REQUESTOUTPUTPLOTTICKBAR_NAME);
if ($index >= 0)
$tickBarNode->setAttribute(REQUESTOUTPUTPLOTTICKBAR_INDEX, $index);
$this->addChild($tickBarNode);
return $tickBarNode;
}
}
/**
* @class RequestOutputPlotParamsNodeClass
* @brief Definition of a params for a plot of a plot request
* @details
*/
class RequestOutputPlotParamsNodeClass extends NodeClass
{
public function __construct()
{
parent::__construct(REQUESTOUTPUTPLOTPARAMS_NAME);
}
public function getParamById($id)
{
$paramNodes = $this->getChildrenByName(REQUESTOUTPUTPLOTPARAM_NAME);
foreach ($paramNodes as $paramNode)
if ($paramNode->getId() == $id)
return $paramNode;
//create new param
$paramNode = new RequestOutputPlotParamNodeClass($id);
$this->addChild($paramNode);
return $paramNode;
}
}
?>