Blame view

src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php 17.2 KB
966bd5f8   Benjamin Renard   Add request to ge...
1
2
3
4
5
6
7
8
9
10
<?php

/**
 * @class IHMInputOutputParamInfoClass
 * @brief Class that's implement an InputOutputInterface used to treat a get param info request
 * @details
 */
class IHMInputOutputParamInfoClass implements InputOutputInterface
{
	private $paramInfoData        = null;
bf27ba04   Benjamin Renard   Add templated par...
11
	private $paramTemplateMgr     = null;
ffc5cb81   Elena.Budnik   temporary commit
12
	private $paramImpexMgr     = null;
966bd5f8   Benjamin Renard   Add request to ge...
13
14
15
16
17
18
	
	/*
	 * @brief Constructor
	*/
	function __construct()
	{
bf27ba04   Benjamin Renard   Add templated par...
19
		$this->paramTemplateMgr = new IHMParamTemplateClass();
966bd5f8   Benjamin Renard   Add request to ge...
20
21
22
23
24
25
26
27
28
29
30
	}

	/*
	 * @brief translate input data from IHM client to AMDA_Integration module for a get param info request
	*/
	public function getInputData($input,$function,$requestId="")
	{
		$this->paramInfoData = new ParamInfoRequestDataClass();
		
		switch ($input->type) {
			case 'plot_init' :
ffc5cb81   Elena.Budnik   temporary commit
31
			
966bd5f8   Benjamin Renard   Add request to ge...
32
				$this->paramInfoData->setType(ParamInfoTypeEnumClass::PLOTINIT);
f28f7c0e   Benjamin Renard   Add param info re...
33
34
35
				
				if (!isset($input->paramId) || empty($input->paramId))
					throw new Exception("Param info request need a param id as argument");
4fe90834   Benjamin Renard   Fix bug with get ...
36
37
38
39
40
41
				
				if ($this->paramTemplateMgr->isTemplatedParam($input->paramId))
					//Use param template file
					$paramFilePath = $this->paramTemplateMgr->getTemplatePath($input->paramId);
				else
				    $paramFilePath = IHMConfigClass::getLocalParamDBPath().$input->paramId.".xml";
ffc5cb81   Elena.Budnik   temporary commit
42
43
44
			
				if (!file_exists("$paramFilePath"))
					throw new Exception("Cannot find parameter definition file");
f28f7c0e   Benjamin Renard   Add param info re...
45
				
ffc5cb81   Elena.Budnik   temporary commit
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
				$this->paramInfoData->setFilePath($paramFilePath);
				break;
				
				case 'impex_plot_init' :
			
				$this->paramInfoData->setType(ParamInfoTypeEnumClass::IMPEXPLOTINIT);
	 	
				if (!isset($input->paramId) || empty($input->paramId))
					throw new Exception("Param info request need a param id as argument");				
 
				if (!$this->paramImpexMgr)
				{
					$this->paramImpexMgr = new IHMImpexParamClass();					
				}
				
				$paramFilePath = $this->paramImpexMgr->getParamInfoPlotPath($input->paramId);
				
				if (!$paramFilePath || !file_exists($paramFilePath))
f28f7c0e   Benjamin Renard   Add param info re...
64
65
66
67
					throw new Exception("Cannot find parameter definition file");
				
				$this->paramInfoData->setFilePath($paramFilePath);
				break;
ffc5cb81   Elena.Budnik   temporary commit
68
				
f28f7c0e   Benjamin Renard   Add param info re...
69
			case 'param_info' :
ffc5cb81   Elena.Budnik   temporary commit
70
			
f28f7c0e   Benjamin Renard   Add param info re...
71
72
73
74
75
				$this->paramInfoData->setType(ParamInfoTypeEnumClass::PARAMINFO);
				
				if (!isset($input->paramId) || empty($input->paramId))
					throw new Exception("Param info request need a param id as argument");
				
bf27ba04   Benjamin Renard   Add templated par...
76
77
78
79
				$templatedParams = $this->paramTemplateMgr->getParamTemplates();
				
				if (array_key_exists($input->paramId, $templatedParams))
					$this->paramInfoData->setTemplateInfo($templatedParams[$input->paramId]);
f28f7c0e   Benjamin Renard   Add param info re...
80
81
82
83
				
				$paramInfoFilePath = IHMConfigClass::getLocalParamInfoPath().'info_'.$input->paramId.".xml";
				
				if (!file_exists($paramInfoFilePath))
9937b488   Benjamin Renard   Modify default pl...
84
					throw new Exception("Cannot find parameter info file");
f28f7c0e   Benjamin Renard   Add param info re...
85
86
				
				$this->paramInfoData->setFilePath($paramInfoFilePath);
966bd5f8   Benjamin Renard   Add request to ge...
87
				break;
ffc5cb81   Elena.Budnik   temporary commit
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
				
			case 'impex_param_info' :
				
				$this->paramInfoData->setType(ParamInfoTypeEnumClass::IMPEXINFO);				  
				if (!isset($input->paramId) || empty($input->paramId))
					throw new Exception("Param info request need a param id as argument");
				 
				if (!$this->paramImpexMgr)
				{
					$this->paramImpexMgr = new IHMImpexParamClass();					
				}
				$this->paramImpexMgr->setParamTemplateListFilePath($input->paramId);
				$templatedParams = $this->paramImpexMgr->getParamTemplates();

				$simRegion = $this->paramImpexMgr->getSimulationRegion($input->paramId);
577d5c04   Elena.Budnik   IMPEX integration
103
				
ffc5cb81   Elena.Budnik   temporary commit
104
105
106
107
108
109
110
				// No SimulationRuns (LESIA)
			 	if ($simRegion == "UNKNOWN")
					$simRegion = $this->paramImpexMgr->getResourceID($input->paramId);
				 
				$this->paramInfoData->setTemplateInfo($templatedParams[$simRegion]);

				break;
966bd5f8   Benjamin Renard   Add request to ge...
111
			default :
ffc5cb81   Elena.Budnik   temporary commit
112
				throw new Exception("Param info request type '".$input->type."' not yet implemented");
966bd5f8   Benjamin Renard   Add request to ge...
113
		}
966bd5f8   Benjamin Renard   Add request to ge...
114
115
		
		$this->paramInfoData->setParamId($input->paramId);
966bd5f8   Benjamin Renard   Add request to ge...
116
117
118
119
120
121
122
123
124
		
		return $this->paramInfoData;
	}

	/*
	 * @brief translate output data from AMDA_Integration module to IHM client for a get param info request
	*/
	public function getOutput($data)
	{
966bd5f8   Benjamin Renard   Add request to ge...
125
126
		switch ($data->getType()) {
			case ParamInfoTypeEnumClass::PLOTINIT :
f28f7c0e   Benjamin Renard   Add param info re...
127
128
129
				$result = array("success" => false, "message" => "Cannot get plot init");
				$this->getOutputPlotInit($data, $result);
				break;
ffc5cb81   Elena.Budnik   temporary commit
130
131
132
133
			case ParamInfoTypeEnumClass::IMPEXPLOTINIT :
				$result = array("success" => false, "message" => "Cannot get impex plot init");
				$this->getOutputPlotInit($data, $result);
				break;
f28f7c0e   Benjamin Renard   Add param info re...
134
135
136
			case ParamInfoTypeEnumClass::PARAMINFO :
				$result = array("success" => false, "message" => "Cannot get param info");
				$this->getOutputParamInfo($data, $result);
966bd5f8   Benjamin Renard   Add request to ge...
137
				break;
ffc5cb81   Elena.Budnik   temporary commit
138
139
140
141
			case ParamInfoTypeEnumClass::IMPEXINFO :
				$result = array("success" => false, "message" => "Cannot get impex param info");
				$this->getOutputParamInfo($data, $result);
				break;	
966bd5f8   Benjamin Renard   Add request to ge...
142
143
144
145
146
147
148
			default:
				//Nothing ToDo
		}
		
		return $result;
	}
	
f28f7c0e   Benjamin Renard   Add param info re...
149
150
151
152
153
154
	private function getOutputParamInfo($data, &$result) {
		if (($data->getResult() != NULL)) {
			$result = array(
					"success" => true,
					"data" => $data->getResult()
			);
bf27ba04   Benjamin Renard   Add templated par...
155
156
157
			if ($data->getTemplateInfo() != NULL) {
				$result["template"] = $data->getTemplateInfo();
			}
f28f7c0e   Benjamin Renard   Add param info re...
158
159
160
161
162
163
164
		}
	}
	
	private function getOutputPlotInit($data, &$result) {
		if (($data->getResult() != NULL) && ($data->getResult()->getName() == "plot") && (count($data->getResult()->getChildren()) >= 1)) {
			$result_data = array();
				
f7093283   Benjamin Renard   Fix pb with PHP v...
165
166
			$panelNodes = $data->getResult()->getChildren();
			$panelNode = $panelNodes[0];
f28f7c0e   Benjamin Renard   Add param info re...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
				
			$plotNode = NULL;
			if (count($panelNode->getChildren()) >= 1) {
				foreach ($panelNode->getChildren() as $crtNode) {
					if (!in_array($crtNode->getName(), array('timePlot', 'epochPlot', 'xyPlot', 'instantPlot', 'statusPlot', 'tickPlot')))
						continue;
					$plotNode = $crtNode;
					break;
				}
		
				if (isset($plotNode)) {
					$result_data['panel'] = array();
					switch ($plotNode->getName()) {
						case 'timePlot' :
							$result_data['panel']['plotType'] = 'timePlot';
		
							break;
						case 'epochPlot' :
							$result_data['panel']['plotType'] = 'epochPlot';
		
							break;
						case 'xyPlot' :
							$result_data['panel']['plotType'] = 'xyPlot';
							$result_data['panel']['isotropic'] = ($plotNode->getIsIsotropic() == "true");
							$result_data['additionalObjects'] = $this->unmarshallAdditionalObjectsData($plotNode);
							break;
						case 'instantPlot' :
							$result_data['panel']['plotType'] = 'instantPlot';
		
							break;
						case 'statusPlot' :
							$result_data['panel']['plotType'] = 'statusPlot';
		
							break;
						case 'tickPlot' :
							$result_data['panel']['plotType'] = 'tickPlot';
		
							break;
					}
						
					$result_data['draw'] = $this->unmarshallDrawData($plotNode, $data->getParamId());
				}
		
				$result = array(
						"success" => true,
						"data" => $result_data
				);
				//var_dump($result);
			}
				
			/*if (count($paramsNode->getChildren()) >= 1) {
			 $paramNode = $paramsNode->getChildren()[0];
			if (count($paramNode->getChildren()) >= 1) {
			$drawNode = $paramNode->getChildren()[0];
				
				
			switch ($drawNode->getName()) {
			case 'serie' :
			$data['drawType'] = 'serie';
			break;
			case 'orbitserie' :
			$data['drawType'] = 'orbit-serie';
			break;
			}
				
			$result = array(
					"success" => true,
					"data" => $data
			);
			}
			}*/
		}
	}
	
966bd5f8   Benjamin Renard   Add request to ge...
241
242
243
244
245
246
247
248
249
250
251
	private function unmarshallDrawData($plotNode, $paramId) {
		$result_data = array();
		
		if (!isset($plotNode))
			return $result_data;
		
		$paramsNode = $plotNode->getParams();
		
		if (!isset($paramsNode))
			return $result_data;
		
4fe90834   Benjamin Renard   Fix bug with get ...
252
253
254
255
256
257
258
		if ($this->paramTemplateMgr->isTemplatedParam($paramId))
			//Use templated parameter
			$realParamId = $this->paramTemplateMgr->getTemplateFileName($paramId);
		else
			$realParamId = $paramId;
		
		$paramNode = $paramsNode->getParamById($realParamId);
966bd5f8   Benjamin Renard   Add request to ge...
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
		
		if (!isset($paramNode) || (count($paramNode->getChildren()) < 1))
			return $result_data;
		
		$mainDrawNode = NULL;
		$otherDrawNodes = array();
		
		foreach ($paramNode->getChildren() as $crtDrawNode) {
			if (in_array($crtDrawNode->getName(), array('serie', 'spectro', 'yserie', 'orbitserie')))
				$mainDrawNode = $crtDrawNode;
			else
				$otherDrawNodes[$mainDrawNode->getName()] = $crtDrawNode;
		}
		
		if (!isset($mainDrawNode))
			return $result_data;
		
		switch ($mainDrawNode->getName()) {
			case 'serie' :
1627a2dd   Benjamin Renard   Add status bar de...
278
279
280
281
282
283
284
				if ($plotNode->getName() == 'statusPlot') {
					$result_data['type'] = 'status-bar';
				}
				else {
					$result_data['type'] = 'serie';
					$this->unmarshallBaseSerieData($mainDrawNode, $result_data);
				}
966bd5f8   Benjamin Renard   Add request to ge...
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
				//if (array_key_exists('colorserie', $otherDrawNodes))
				//	$this->unmarshallColorSerieData($mainDrawNode, $result_data);
				break;
			case 'spectro' :
				$result_data['type'] = 'spectro';
				$this->unmarshallSpectroData($mainDrawNode, $result_data);
				break;
			case 'yserie' :
				if (!array_key_exists('xserie', $otherDrawNodes))
					return $result_data;
				$this->unmarshallBaseSerieData($mainDrawNode, $result_data);
				//$this->unmarshallXSerieData($mainDrawNode, $result_data);
				//if (array_key_exists('colorserie', $otherDrawNodes))
				//	$this->unmarshallColorSerieData($mainDrawNode, $result_data);
				break;
			case 'orbitserie' :
				$result_data['type'] = 'orbit-serie';
				$result_data['serie-projection'] = $mainDrawNode->getProjection();
				$this->unmarshallBaseSerieData($mainDrawNode, $result_data);
				//if (array_key_exists('colorserie', $otherDrawNodes))
				//	$this->unmarshallColorSerieData($mainDrawNode, $result_data);
				break;
			default :
				return $result_data;
		}
		
71eaac9b   Benjamin Renard   Return default ax...
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
		$axesNode = $plotNode->getAxes();
		if (isset($axesNode)) {
			$result_data['axes'] = array();
			
			$colorAxis = $axesNode->getColorAxis();
			if (isset($colorAxis)) {
				$result_data['axes']['color'] = array();
				$this->unmarshallAxisData($colorAxis, $result_data['axes']['color']);
			}
			
			$xAxis = $axesNode->getDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS, 'xaxis_id');
			if (isset($xAxis)) {
				$result_data['axes']['xaxis_id'] = array();
				$this->unmarshallAxisData($xAxis, $result_data['axes']['xaxis_id']);
			}
			
			$yLeftAxis = $axesNode->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS, 'y-left');
			if (isset($yLeftAxis)) {
				$result_data['axes']['y-left'] = array();
				$this->unmarshallAxisData($yLeftAxis, $result_data['axes']['y-left']);
			}
			
			$yRightAxis = $axesNode->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS, 'y-right');
			if (isset($yRightAxis)) {
				$result_data['axes']['y-right'] = array();
				$this->unmarshallAxisData($yRightAxis, $result_data['axes']['y-right']);
			}
		}
		
966bd5f8   Benjamin Renard   Add request to ge...
340
341
342
		return $result_data;
	}
	
71eaac9b   Benjamin Renard   Return default ax...
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
	private function unmarshallAxisData($axisNode, &$result_array) {
		if (!isset($axisNode))
			return;
		
		$scale = $axisNode->getScale();
		if (isset($scale))
			$result_array['axis-scale'] = $scale;
		$rangeNode = $axisNode->getRange();
		if (isset($rangeNode)) {
			$rangeMin = $rangeNode->getMin();
			if (isset($rangeMin))
				$result_array['axis-range-min'] = $rangeMin;
			$rangeMax = $rangeNode->getMax();
			if (isset($rangeMax))
				$result_array['axis-range-max'] = $rangeMax;
		}
	}
	
966bd5f8   Benjamin Renard   Add request to ge...
361
362
363
364
	private function unmarshallSpectroData($drawNode, &$result_array) {
		if (!isset($drawNode))
			return;
		
f7093283   Benjamin Renard   Fix pb with PHP v...
365
366
367
		$yAxis = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS);
		if (!empty($yAxis))
			$result_array['spectro-yaxis'] = $yAxis;
966bd5f8   Benjamin Renard   Add request to ge...
368
		
f7093283   Benjamin Renard   Fix pb with PHP v...
369
370
371
		$min = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN);
		if (!empty($min))
			$result_array['spectro-value-min'] = $min;
966bd5f8   Benjamin Renard   Add request to ge...
372
		
f7093283   Benjamin Renard   Fix pb with PHP v...
373
374
375
		$max = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX);
		if (!empty($max))
			$result_array['spectro-value-max'] = $max;
966bd5f8   Benjamin Renard   Add request to ge...
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
	}
	
	private function unmarshallAdditionalObjectsData($plotNode) {
		$result_data = array();
		
		if (!isset($plotNode))
			return $result_data;
		
		$additionalObjectsNode = $plotNode->getAdditionalObjects();
		
		//curvePlot
		$result_data['curves'] = array();
		$curveObjectsNode = $additionalObjectsNode->getCurveObjects();
		foreach ($curveObjectsNode as $curveNode) {
			$crt_curve_data = array();
			$crt_curve_data['curve-serie-id'] = $curveNode->getSerieId();
			$this->unmarshallLineData($curveNode, "curve-line-", $crt_curve_data);
			
			if ($curveNode->isFunctionDefined()) {
				$crt_curve_data['curve-name'] = $curveNode->getFunction()->getFunctionName();
				$crt_curve_data['curve-attributes'] = array();
				
				foreach ($curveNode->getFunction()->getAttributes()->getChildren() as $attributeNode) {
					$crt_attribute_data = array();
					
					$crt_attribute_data['curve-param-name'] = $attributeNode->getAttribute(REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_ATTRIBUTENAME);
					$crt_attribute_data['curve-param-value'] = $attributeNode->getAttribute(REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_ATTRIBUTEVALUE);
					
					$crt_curve_data['curve-attributes'][] = $crt_attribute_data;
				}
				
			}
			
			$result_data['curves'][] = $crt_curve_data;
		}
		
		return $result_data;
	}
	
	private function unmarshallBaseSerieData($drawNode, &$result_array) {
		if (!isset($drawNode))
			return;
		
		$result_array['serie-id'] = $drawNode->getId();
		
		$result_array['serie-yaxis'] = $drawNode->getYAxisId();
		
		if ($drawNode->isLineDefined()) {
			$result_array['serie-lines-activated'] = true;
			$this->unmarshallLineData($drawNode->getLine(), "serie-lines-", $result_array);
		}
		
		if ($drawNode->isSymbolDefined()) {
			$result_array['serie-symbols-activated'] = true;
			$this->unmarshallSymbolData($drawNode->getSymbol(), "serie-symbols-", $result_array);
		}
		
f7093283   Benjamin Renard   Fix pb with PHP v...
433
434
		$colorSerieId = $drawNode->getColorSerieId();
		if (!empty($colorSerieId)) {
966bd5f8   Benjamin Renard   Add request to ge...
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
			//ToDo
		}
		
		if ($drawNode->isTimeTicksDefined()) {
			$result_array['serie-timetick-activated'] = true;
			
			$result_array['serie-timetick-step'] = $drawNode->getTimeTicks()->getStep();
			$result_array['serie-timetick-nbmajor'] = $drawNode->getTimeTicks()->getNumber();
			$result_array['serie-timetick-nbminor'] = $drawNode->getTimeTicks()->getMinor();
			$result_array['serie-timetick-color'] = $this->toHexColor($drawNode->getTimeTicks()->getColor());
			
			if (!empty($result_array['serie-timetick-nbmajor']) && intval($result_array['serie-timetick-nbmajor']) > 0)
				$result_array['serie-timetick-type'] = 'nb-major';
			else if (!empty($result_array['serie-timetick-step']) && intval($result_array['serie-timetick-step']) > 0)
				$result_array['serie-timetick-type'] = 'time-step';
			else
				$result_array['serie-timetick-type'] = 'auto';
			
			if ($drawNode->getTimeTicks()->isSymbolDefined()) {
				$this->unmarshallSymbolData($drawNode->getTimeTicks()->getSymbol(), "serie-timetick-symbols-", $result_array);
			}
			
			if ($drawNode->getTimeTicks()->isFirstSymbolDefined()) {
				$result_array['serie-timetick-firstsymbols-activated'] = true;
				$this->unmarshallSymbolData($drawNode->getTimeTicks()->getFirstSymbol(), "serie-timetick-firstsymbols-", $result_array);
			}
			
			if ($drawNode->getTimeTicks()->isFontDefined()) {
				$result_array['serie-timetick-font-activated'] = true;
				$this->unmarshallFontData($drawNode->getTimeTicks()->getFont(), "serie-timetick-font-", $result_array);
			}
		}
		
		if ($drawNode->isIntervalTicksDefined()) {
			$result_array['serie-intervaltick-activated'] = true;
			
			$result_array['serie-intervaltick-mode'] =  $drawNode->getIntervalTicks()->getMode();
			$result_array['serie-intervaltick-color'] =  $this->toHexColor($drawNode->getIntervalTicks()->getColor());
			
			if ($drawNode->getIntervalTicks()->isSymbolDefined()) {
				$this->unmarshallSymbolData($drawNode->getIntervalTicks()->getSymbol(), "serie-intervaltick-", $result_array);
			}
			
			if ($drawNode->getIntervalTicks()->isFontDefined()) {
				$result_array['serie-intervaltick-font-activated'] = true;
				$this->unmarshallFontData($drawNode->getIntervalTicks()->getFont(), "serie-intervaltick-font-", $result_array);
			}
		}
	}
	
	private function unmarshallLineData($lineNode, $prefix, &$result_array) {
		$result_array[$prefix.'style'] = $lineNode->getStyle();
		$result_array[$prefix.'width'] = $lineNode->getWidth();
		$result_array[$prefix.'color'] = $this->toHexColor($lineNode->getColor());
	}
	
	private function unmarshallSymbolData($symbolNode, $prefix, &$result_array) {
		$result_array[$prefix.'type'] = $symbolNode->getType();
		$result_array[$prefix.'size'] = $symbolNode->getSize();
		$result_array[$prefix.'color'] = $this->toHexColor($symbolNode->getColor());
	}
	
	private function  unmarshallFontData($fontNode, $prefix, &$result_array) {
		$result_array[$prefix.'name'] = $fontNode->getFontName();
		$result_array[$prefix.'size'] = $fontNode->getSize();
		$result_array[$prefix.'bold'] = ($fontNode->getWeight() == RequestOutputPlotFontWeight::BOLD);
		$result_array[$prefix.'italic'] = ($fontNode->getStyle() == RequestOutputPlotFontStyle::ITALIC);
	}
	
	private function toHexColor($color) {
		$temp = str_replace(array('[', ']', ' '), '', $color);
		$arr = explode(',', $temp);
		if (count ($arr) != 3)
			return '#000000';
		return '#'.sprintf('%02x', $arr[0]).sprintf('%02x', $arr[1]).sprintf('%02x', $arr[2]);
	}
}

?>