Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php 15.3 KB
22521f1c   Benjamin Renard   First commit
1
2
3
<?php

require_once("RequestOutputPlotYSerieNodeClass.php");
c4213719   Erdogan Furkan   Done.
4
require_once("RequestOutputPlotHistogram2DSerieNodeClass.php");
966bd5f8   Benjamin Renard   Add request to ge...
5
6
require_once "RequestOutputPlotOrbitSerieNodeClass.php";
require_once "RequestOutputPlotInstantSerieNodeClass.php";
22521f1c   Benjamin Renard   First commit
7

95ab3cf6   Menouard AZIB   Prise en compte d...
8
define("REQUESTOUTPUTPLOTPARAMS_NAME", "params");
22521f1c   Benjamin Renard   First commit
9

95ab3cf6   Menouard AZIB   Prise en compte d...
10
11
define("REQUESTOUTPUTPLOTPARAM_NAME", "param");
define("REQUESTOUTPUTPLOTPARAM_ID", "id");
22521f1c   Benjamin Renard   First commit
12

95ab3cf6   Menouard AZIB   Prise en compte d...
13
14
15
16
17
18
define("REQUESTOUTPUTPLOTXSERIE_NAME", "xserie");
define("REQUESTOUTPUTPLOTXSERIE_XAXIS", "xAxis");
define("REQUESTOUTPUTPLOTXSERIE_INDEX", "index");
define("REQUESTOUTPUTPLOTXSERIE_ID", "id");
define("REQUESTOUTPUTPLOTXSERIE_MIN", "min");
define("REQUESTOUTPUTPLOTXSERIE_MAX", "max");
22521f1c   Benjamin Renard   First commit
19

95ab3cf6   Menouard AZIB   Prise en compte d...
20
21
22
define("REQUESTOUTPUTPLOTCOLORSERIE_NAME", "colorserie");
define("REQUESTOUTPUTPLOTCOLORSERIE_ID", "id");
define("REQUESTOUTPUTPLOTCOLORSERIE_INDEX", "index");
4ede4320   Benjamin Renard   Integration for s...
23

3dcf7710   Hacene SI HADJ MOHAND   us ok
24
25
26
define("REQUESTOUTPUTPLOTSAUVAUD_NAME", "sauvaud");
define("REQUESTOUTPUTPLOTSAUVAUD_RIGHT_DIM", "right_dim");

95ab3cf6   Menouard AZIB   Prise en compte d...
27
28
29
30
31
32
33
define("REQUESTOUTPUTPLOTSPECTRO_NAME", "spectro");
define("REQUESTOUTPUTPLOTSPECTRO_YAXIS", "yAxis");
define("REQUESTOUTPUTPLOTSPECTRO_INDEX", "index");
define("REQUESTOUTPUTPLOTSPECTRO_MIN", "min");
define("REQUESTOUTPUTPLOTSPECTRO_MAX", "max");
define("REQUESTOUTPUTPLOTSPECTRO_USELOG0ASMIN", "uselog0asmin");
define("REQUESTOUTPUTPLOTSPECTRO_NORMALISATION", "normalization");
944199fe   Benjamin Renard   Use table definit...
34

95ab3cf6   Menouard AZIB   Prise en compte d...
35
36
37
38
39
40
41
42
43
44
45
/**
 * Here, we define constants about background substracion
 */
define("REQUESTOUTPUTPLOTSPECTRO_BGS_TYPE", "background_sub_type");
define("REQUESTOUTPUTPLOTSPECTRO_BGS_TYPE_NONE", "None");
define("REQUESTOUTPUTPLOTSPECTRO_BGS_VALUE", "background_sub_value");
define("REQUESTOUTPUTPLOTSPECTRO_BGS_DIM", "background_sub_dim");
define("REQUESTOUTPUTPLOTSPECTRO_BGS_VALUE_NONE", "None");

###
define("REQUESTOUTPUTPLOTSPECTRO_RESOLUTION", "resolution");
fc153c1c   Elena.Budnik   ispectro added
46

95ab3cf6   Menouard AZIB   Prise en compte d...
47
48
49
define("REQUESTOUTPUTPLOTINSTANTSPECTRO_NAME", "ispectro");
define("REQUESTOUTPUTPLOTINSTANTSPECTRO_XAXIS", "xAxis");
define("REQUESTOUTPUTPLOTINSTANTSPECTRO_DIMONXAXIS", "dimOnXAxis");
17f69bd1   Benjamin Renard   Add tick plot and...
50

95ab3cf6   Menouard AZIB   Prise en compte d...
51
52
define("REQUESTOUTPUTPLOTSTATUSBAR_NAME", "serie");
define("REQUESTOUTPUTPLOTSTATUSBAR_INDEX", "index");
25a38537   Erdogan Furkan   7616 - Adding col...
53
define("REQUESTOUTPUTPLOTSTATUSBAR_COLOR", "color");
17f69bd1   Benjamin Renard   Add tick plot and...
54

95ab3cf6   Menouard AZIB   Prise en compte d...
55
56
57
define("REQUESTOUTPUTPLOTTICKBAR_NAME", "serie");
define("REQUESTOUTPUTPLOTTICKBAR_INDEX", "index");

044a9305   Benjamin Renard   Add intervals dra...
58

22521f1c   Benjamin Renard   First commit
59
60
61
62
/**
 * @class RequestOutputPlotParamNodeClass
 * @brief Definition of a param for a plot of a plot request
 * @details
95ab3cf6   Menouard AZIB   Prise en compte d...
63
 */
22521f1c   Benjamin Renard   First commit
64
65
66
67
68
69
70
71
72
73
74
75
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);
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
76

966bd5f8   Benjamin Renard   Add request to ge...
77
78
	public function setId($id)
	{
95ab3cf6   Menouard AZIB   Prise en compte d...
79
		$this->setAttribute(REQUESTOUTPUTPLOTPARAM_ID, $id);
966bd5f8   Benjamin Renard   Add request to ge...
80
	}
22521f1c   Benjamin Renard   First commit
81

f822811a   Benjamin Renard   Implements multi ...
82
	public function addYSerie($yAxis, $index, $xId = -1, $colorSerieId = -1, $min = NULL, $max = NULL)
22521f1c   Benjamin Renard   First commit
83
	{
95ab3cf6   Menouard AZIB   Prise en compte d...
84
		if ($xId != -1) {
22521f1c   Benjamin Renard   First commit
85
			$ySerieNode = new RequestOutputPlotYSerieNodeClass(REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME);
f822811a   Benjamin Renard   Implements multi ...
86
87
			$ySerieNode->setXId($xId);
			$ySerieNode->setXAxisId(REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
95ab3cf6   Menouard AZIB   Prise en compte d...
88
		} else
22521f1c   Benjamin Renard   First commit
89
90
			$ySerieNode = new RequestOutputPlotYSerieNodeClass(REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME);
		$ySerieNode->setYAxisId($yAxis);
4f9a8e36   Benjamin Renard   Min/Max value def...
91
92
93
94
		if (isset($min))
			$ySerieNode->setMin($min);
		if (isset($max))
			$ySerieNode->setMax($max);
22521f1c   Benjamin Renard   First commit
95
96
		if ($index >= 0)
			$ySerieNode->setIndex($index);
4ede4320   Benjamin Renard   Integration for s...
97
98
		if ($colorSerieId >= 0)
			$ySerieNode->setColorSerieId($colorSerieId);
22521f1c   Benjamin Renard   First commit
99
100
101
		$this->addChild($ySerieNode);
		return $ySerieNode;
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
102

c4213719   Erdogan Furkan   Done.
103
104
	public function addHistogram2DSerie($yAxis, $index, $xId = -1)
	{
f84b7023   Benjamin Renard   Prevent exception...
105
106
107
108
109
110
		if ($xId == -1) {
			return NULL;
		}
		$histogram2dNode = new RequestOutputPlotHistogram2DSerieNodeClass(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_NAME);
		$histogram2dNode->setXId($xId);
		$histogram2dNode->setXAxisId(REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
c4213719   Erdogan Furkan   Done.
111
112
113
114
115
116
117
		$histogram2dNode->setYAxisId($yAxis);
		if ($index >= 0)
			$histogram2dNode->setIndex($index);
		$this->addChild($histogram2dNode);
		return $histogram2dNode;
	}

61e60608   Erdogan Furkan   For now, histo1D ...
118
119
120
121
122
123
124
125
126
127
128
129
	public function addHistogram1DSerie($yAxis, $index, $color)
	{
		$histogram1dNode = new RequestOutputPlotHistogram1DSerieNodeClass(REQUESTOUTPUTPLOTHISTOGRAM1DSERIE_NAME);
		$histogram1dNode->setColor($color);
		$histogram1dNode->setXAxisId(REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
		$histogram1dNode->setYAxisId($yAxis);
		if ($index >= 0)
			$histogram1dNode->setIndex($index);
		$this->addChild($histogram1dNode);
		return $histogram1dNode;
	}

cb46dfbf   Benjamin Renard   Fix orbit serie a...
130
	public function addOrbitSerie($yAxis, $colorSerieId = -1)
26a23052   Benjamin Renard   Add Interval Tick...
131
132
	{
		$orbitSerieNode = new RequestOutputPlotOrbitSerieNodeClass();
cb46dfbf   Benjamin Renard   Fix orbit serie a...
133
		$orbitSerieNode->setXAxisId(REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
26a23052   Benjamin Renard   Add Interval Tick...
134
		$orbitSerieNode->setYAxisId($yAxis);
26a23052   Benjamin Renard   Add Interval Tick...
135
136
137
138
139
		if ($colorSerieId >= 0)
			$orbitSerieNode->setColorSerieId($colorSerieId);
		$this->addChild($orbitSerieNode);
		return $orbitSerieNode;
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
140

cb46dfbf   Benjamin Renard   Fix orbit serie a...
141
	public function addInstantSerie($yAxis)
b4ee5e62   Benjamin Renard   Add integration f...
142
143
	{
		$iserieNode = new RequestOutputPlotInstantSerieNodeClass();
cb46dfbf   Benjamin Renard   Fix orbit serie a...
144
		$iserieNode->setXAxisId(REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
b4ee5e62   Benjamin Renard   Add integration f...
145
146
147
148
		$iserieNode->setYAxisId($yAxis);
		$this->addChild($iserieNode);
		return $iserieNode;
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
149
150
151
152
153
154
155
156
157
158
159
160
161

	public function addSpectro(
		$yAxis = "",
		$resolution = "",
		$index = NULL,
		$min = NULL,
		$max = NULL,
		$uselog0asmin = FALSE,
		$normalization = NULL,
		$bgs_type = NULL,
		$bgs_value = NULL,
		$bgs_dim = NULL
	) {
944199fe   Benjamin Renard   Use table definit...
162
163
		$spectroNode = new NodeClass(REQUESTOUTPUTPLOTSPECTRO_NAME);
		$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS, $yAxis);
0c1bcc5a   Benjamin Renard   Add option to sho...
164
		$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_USELOG0ASMIN, $uselog0asmin ? "true" : "false");
0a56ad20   Benjamin Renard   Give the possibil...
165
166
		if (isset($resolution))
			$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_RESOLUTION, $resolution);
0904976e   Hacene SI HADJ MOHAND   evol ok
167
168
		if (isset($normalization))
			$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_NORMALISATION, $normalization);
95ab3cf6   Menouard AZIB   Prise en compte d...
169
170
171
172
173
174
		if (isset($bgs_type))
			$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_BGS_TYPE, $bgs_type);
		if (isset($bgs_value))
			$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_BGS_VALUE, $bgs_value);
		if (isset($bgs_dim))
			$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_BGS_DIM, $bgs_dim);
3182799a   Benjamin Renard   Use param indexes...
175
176
		if (isset($index))
			$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_INDEX, $index);
4f9a8e36   Benjamin Renard   Min/Max value def...
177
178
179
180
		if (isset($min))
			$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN, $min);
		if (isset($max))
			$spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX, $max);
944199fe   Benjamin Renard   Use table definit...
181
182
183
		$this->addChild($spectroNode);
		return $spectroNode;
	}
3dcf7710   Hacene SI HADJ MOHAND   us ok
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
              	public function addSauvaud(
		$yAxis = "",
		$resolution = "",
		$index = NULL,
		$min = NULL,
		$max = NULL,
		$uselog0asmin = FALSE,
		$normalization = NULL,
		$bgs_type = NULL,
		$bgs_value = NULL,
		$bgs_dim = NULL, 
                                        $rightDim = NULL
                                        ) {
		$sauvaudNode = new NodeClass(REQUESTOUTPUTPLOTSAUVAUD_NAME);
		$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS, $yAxis);
		$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_USELOG0ASMIN, $uselog0asmin ? "true" : "false");
		if (isset($resolution))
			$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_RESOLUTION, $resolution);
		if (isset($normalization))
			$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_NORMALISATION, $normalization);
		if (isset($bgs_type))
			$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_BGS_TYPE, $bgs_type);
		if (isset($bgs_value))
			$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_BGS_VALUE, $bgs_value);
		if (isset($bgs_dim))
			$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_BGS_DIM, $bgs_dim);
		if (isset($index))
			$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_INDEX, $index);
		if (isset($min))
			$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN, $min);
		if (isset($max))
			$sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX, $max);
                                        if(isset($rightDim))
                                                            $sauvaudNode->setAttribute(REQUESTOUTPUTPLOTSAUVAUD_RIGHT_DIM, $rightDim);
		$this->addChild($sauvaudNode);
		return $sauvaudNode;
	}

95ab3cf6   Menouard AZIB   Prise en compte d...
222

cb46dfbf   Benjamin Renard   Fix orbit serie a...
223
	public function addInstantSpectro($yAxis, $dimOnXAxis, $index = NULL, $min = NULL, $max = NULL)
fc153c1c   Elena.Budnik   ispectro added
224
225
	{
		$ispectroNode = new NodeClass(REQUESTOUTPUTPLOTINSTANTSPECTRO_NAME);
cb46dfbf   Benjamin Renard   Fix orbit serie a...
226
		$ispectroNode->setAttribute(REQUESTOUTPUTPLOTINSTANTSPECTRO_XAXIS, REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
fc153c1c   Elena.Budnik   ispectro added
227
228
		$ispectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS, $yAxis);
		$ispectroNode->setAttribute(REQUESTOUTPUTPLOTINSTANTSPECTRO_DIMONXAXIS, $dimOnXAxis);
95ab3cf6   Menouard AZIB   Prise en compte d...
229

fc153c1c   Elena.Budnik   ispectro added
230
231
232
233
234
235
236
		if (isset($min))
			$ispectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN, $min);
		if (isset($max))
			$ispectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX, $max);
		$this->addChild($ispectroNode);
		return $ispectroNode;
	}
22521f1c   Benjamin Renard   First commit
237

f822811a   Benjamin Renard   Implements multi ...
238
	public function addXSerie($index = -1, $id = 0, $min = NULL, $max = NULL)
22521f1c   Benjamin Renard   First commit
239
240
	{
		$xSerieNode = new NodeClass(REQUESTOUTPUTPLOTXSERIE_NAME);
22521f1c   Benjamin Renard   First commit
241
242
		if ($index >= 0)
			$xSerieNode->setAttribute(REQUESTOUTPUTPLOTXSERIE_INDEX, $index);
f822811a   Benjamin Renard   Implements multi ...
243
		$xSerieNode->setAttribute(REQUESTOUTPUTPLOTXSERIE_ID, $id);
4f9a8e36   Benjamin Renard   Min/Max value def...
244
245
246
247
		if (isset($min))
			$xSerieNode->setAttribute(REQUESTOUTPUTPLOTXSERIE_MIN, $min);
		if (isset($max))
			$xSerieNode->setAttribute(REQUESTOUTPUTPLOTXSERIE_MAX, $max);
22521f1c   Benjamin Renard   First commit
248
249
250
		$this->addChild($xSerieNode);
		return $xSerieNode;
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
251

966bd5f8   Benjamin Renard   Add request to ge...
252
	public function addColorSerie($id = "", $index = -1)
4ede4320   Benjamin Renard   Integration for s...
253
254
255
256
257
258
259
260
	{
		$colorSerieNode = new NodeClass(REQUESTOUTPUTPLOTCOLORSERIE_NAME);
		$colorSerieNode->setAttribute(REQUESTOUTPUTPLOTCOLORSERIE_ID, $id);
		if ($index >= 0)
			$colorSerieNode->setAttribute(REQUESTOUTPUTPLOTCOLORSERIE_INDEX, $index);
		$this->addChild($colorSerieNode);
		return $colorSerieNode;
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
261

25a38537   Erdogan Furkan   7616 - Adding col...
262
	public function addStatusBar($index, $color = NULL)
17f69bd1   Benjamin Renard   Add tick plot and...
263
264
265
266
	{
		$statusBarNode = new NodeClass(REQUESTOUTPUTPLOTSTATUSBAR_NAME);
		if ($index >= 0)
			$statusBarNode->setAttribute(REQUESTOUTPUTPLOTSTATUSBAR_INDEX, $index);
25a38537   Erdogan Furkan   7616 - Adding col...
267
268
269
		if ($color != NULL) {
			$statusBarNode->setAttribute(REQUESTOUTPUTPLOTSTATUSBAR_COLOR, $color);
		}
17f69bd1   Benjamin Renard   Add tick plot and...
270
271
272
		$this->addChild($statusBarNode);
		return $statusBarNode;
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
273

17f69bd1   Benjamin Renard   Add tick plot and...
274
275
276
277
278
279
280
281
	public function addTickBar($index)
	{
		$tickBarNode = new NodeClass(REQUESTOUTPUTPLOTTICKBAR_NAME);
		if ($index >= 0)
			$tickBarNode->setAttribute(REQUESTOUTPUTPLOTTICKBAR_INDEX, $index);
		$this->addChild($tickBarNode);
		return $tickBarNode;
	}
044a9305   Benjamin Renard   Add intervals dra...
282

25a38537   Erdogan Furkan   7616 - Adding col...
283
	public function addIntervals($color = NULL)
044a9305   Benjamin Renard   Add intervals dra...
284
	{
fe1a8ddd   Erdogan Furkan   Modifications for...
285
		$intervalsNode = new RequestOutputPlotIntervalsNodeClass();
25a38537   Erdogan Furkan   7616 - Adding col...
286
		if ($color != NULL) {
fe1a8ddd   Erdogan Furkan   Modifications for...
287
			$intervalsNode->setColor($color);
25a38537   Erdogan Furkan   7616 - Adding col...
288
		}
044a9305   Benjamin Renard   Add intervals dra...
289
290
291
		$this->addChild($intervalsNode);
		return $intervalsNode;
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
292

966bd5f8   Benjamin Renard   Add request to ge...
293
294
295
	public function loadFromNode($xmlNode)
	{
		$this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAM_ID));
95ab3cf6   Menouard AZIB   Prise en compte d...
296

966bd5f8   Benjamin Renard   Add request to ge...
297
298
299
		foreach ($this->getXmlNodeChildren($xmlNode) as $plottypeXmlNode) {
			$node = NULL;
			switch ($this->getXmlNodeName($plottypeXmlNode)) {
95ab3cf6   Menouard AZIB   Prise en compte d...
300
				case REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
301
302
					$node = new RequestOutputPlotYSerieNodeClass(REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME);
					break;
95ab3cf6   Menouard AZIB   Prise en compte d...
303
				case REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
304
305
					$node = new RequestOutputPlotYSerieNodeClass(REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME);
					break;
95ab3cf6   Menouard AZIB   Prise en compte d...
306
				case REQUESTOUTPUTPLOTORBITSERIE_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
307
308
					$node = new RequestOutputPlotOrbitSerieNodeClass();
					break;
95ab3cf6   Menouard AZIB   Prise en compte d...
309
				case REQUESTOUTPUTPLOTINSTANTSERIE_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
310
311
					$node = new RequestOutputPlotInstantSerieNodeClass();
					break;
95ab3cf6   Menouard AZIB   Prise en compte d...
312
				case REQUESTOUTPUTPLOTSPECTRO_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
313
					$yAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_YAXIS);
3182799a   Benjamin Renard   Use param indexes...
314
					$index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_INDEX);
966bd5f8   Benjamin Renard   Add request to ge...
315
316
					$min = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MIN);
					$max = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MAX);
0a56ad20   Benjamin Renard   Give the possibil...
317
					$resolution = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_RESOLUTION);
0c1bcc5a   Benjamin Renard   Add option to sho...
318
					$uselog0asmin = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_USELOG0ASMIN) == "true";
0a56ad20   Benjamin Renard   Give the possibil...
319
					$node = $this->addSpectro($yAxis, $resolution, $index, $min, $max, $uselog0asmin);
966bd5f8   Benjamin Renard   Add request to ge...
320
					break;
3dcf7710   Hacene SI HADJ MOHAND   us ok
321
322
323
324
325
326
327
328
329
330
                                    			case REQUESTOUTPUTPLOTSAUVAUD_NAME:
					$yAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_YAXIS);
					$index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_INDEX);
					$min = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MIN);
					$max = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MAX);
					$resolution = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_RESOLUTION);
					$uselog0asmin = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_USELOG0ASMIN) == "true";
                                                                                                    $rightDim = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSAUVAUD_RIGHT_DIM);
					$node = $this->addSauvaud($yAxis, $resolution, $index, $min, $max, $uselog0asmin, $rightDim);
					break;
95ab3cf6   Menouard AZIB   Prise en compte d...
331
				case REQUESTOUTPUTPLOTXSERIE_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
332
333
334
335
					$xAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_XAXIS);
					$index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_INDEX);
					if (empty($index))
						$index = -1;
f822811a   Benjamin Renard   Implements multi ...
336
337
338
					$xId = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_XID);
					if (empty($xId))
						$xId = 0;
966bd5f8   Benjamin Renard   Add request to ge...
339
340
					$min = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_MIN);
					$max = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_MAX);
f822811a   Benjamin Renard   Implements multi ...
341
					$node = $this->addXSerie($index, $xId, $min, $max);
966bd5f8   Benjamin Renard   Add request to ge...
342
					break;
95ab3cf6   Menouard AZIB   Prise en compte d...
343
				case REQUESTOUTPUTPLOTCOLORSERIE_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
344
345
346
347
348
349
					$id = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTCOLORSERIE_ID);
					$index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTCOLORSERIE_INDEX);
					if (empty($index))
						$index = -1;
					$node = $this->addColorSerie($id, $index);
					break;
95ab3cf6   Menouard AZIB   Prise en compte d...
350
				case REQUESTOUTPUTPLOTSTATUSBAR_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
351
352
353
354
355
					$index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSTATUSBAR_INDEX);
					if (empty($index))
						$index = -1;
					$node = $this->addStatusBar($index);
					break;
95ab3cf6   Menouard AZIB   Prise en compte d...
356
				case REQUESTOUTPUTPLOTTICKBAR_NAME:
966bd5f8   Benjamin Renard   Add request to ge...
357
358
359
360
361
362
					$index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTTICKBAR_INDEX);
					if (empty($index))
						$index = -1;
					$node = $this->addTickBar($index);
					break;
				default:
966bd5f8   Benjamin Renard   Add request to ge...
363
			}
95ab3cf6   Menouard AZIB   Prise en compte d...
364

966bd5f8   Benjamin Renard   Add request to ge...
365
366
367
368
369
370
			if (isset($node)) {
				$node->loadFromNode($plottypeXmlNode);
				$this->addChild($node);
			}
		}
	}
22521f1c   Benjamin Renard   First commit
371
372
373
374
375
376
377
378
379
380
381
382
383
384
}

/**
 * @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);
	}

966bd5f8   Benjamin Renard   Add request to ge...
385
	public function getParamById($id = "")
22521f1c   Benjamin Renard   First commit
386
387
388
	{
		$paramNodes = $this->getChildrenByName(REQUESTOUTPUTPLOTPARAM_NAME);
		foreach ($paramNodes as $paramNode)
95ab3cf6   Menouard AZIB   Prise en compte d...
389
390
			if ($paramNode->getId() == $id)
				return $paramNode;
22521f1c   Benjamin Renard   First commit
391
392
393
394
395
		//create new param
		$paramNode = new RequestOutputPlotParamNodeClass($id);
		$this->addChild($paramNode);
		return $paramNode;
	}
95ab3cf6   Menouard AZIB   Prise en compte d...
396

966bd5f8   Benjamin Renard   Add request to ge...
397
398
399
400
401
402
	public function loadFromNode($xmlNode)
	{
		foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTPARAM_NAME) as $paramXmlNode) {
			$this->getParamById()->loadFromNode($paramXmlNode);
		}
	}
22521f1c   Benjamin Renard   First commit
403
}