Commit f7093283b2e9384765f9a77c1b548c352a1939e3

Authored by Benjamin Renard
1 parent fa791617

Fix pb with PHP v.5.3

src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php
... ... @@ -93,7 +93,8 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
93 93 if (($data->getResult() != NULL) && ($data->getResult()->getName() == "plot") && (count($data->getResult()->getChildren()) >= 1)) {
94 94 $result_data = array();
95 95  
96   - $panelNode = $data->getResult()->getChildren()[0];
  96 + $panelNodes = $data->getResult()->getChildren();
  97 + $panelNode = $panelNodes[0];
97 98  
98 99 $plotNode = NULL;
99 100 if (count($panelNode->getChildren()) >= 1) {
... ... @@ -234,14 +235,17 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
234 235 if (!isset($drawNode))
235 236 return;
236 237  
237   - if (!empty($drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS)))
238   - $result_array['spectro-yaxis'] = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS);
  238 + $yAxis = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS);
  239 + if (!empty($yAxis))
  240 + $result_array['spectro-yaxis'] = $yAxis;
239 241  
240   - if (!empty($drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN)))
241   - $result_array['spectro-value-min'] = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN);
  242 + $min = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN);
  243 + if (!empty($min))
  244 + $result_array['spectro-value-min'] = $min;
242 245  
243   - if (!empty($drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX)))
244   - $result_array['spectro-value-max'] = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX);
  246 + $max = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX);
  247 + if (!empty($max))
  248 + $result_array['spectro-value-max'] = $max;
245 249 }
246 250  
247 251 private function unmarshallAdditionalObjectsData($plotNode) {
... ... @@ -299,7 +303,8 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface
299 303 $this->unmarshallSymbolData($drawNode->getSymbol(), "serie-symbols-", $result_array);
300 304 }
301 305  
302   - if (!empty($drawNode->getColorSerieId())) {
  306 + $colorSerieId = $drawNode->getColorSerieId();
  307 + if (!empty($colorSerieId)) {
303 308 //ToDo
304 309 }
305 310  
... ...
src/InputOutput/IHMImpl/Params/IHMInputOutputParamsAbstractClass.php
... ... @@ -54,7 +54,8 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface
54 54 */
55 55 protected function unmarshallTimeDefinition($input, $requestIndex, $ttFileIndex = -1, $ttIntIndex = -1)
56 56 {
57   - $timesNode = $this->paramsData->getRequestNodes()[$requestIndex]->getTimesNode();
  57 + $requestNodes = $this->paramsData->getRequestNodes();
  58 + $timesNode = $requestNodes[$requestIndex]->getTimesNode();
58 59  
59 60 switch ($input->timesrc)
60 61 {
... ...
src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php
... ... @@ -101,8 +101,10 @@ class ParamNodeClass extends NodeClass
101 101 $getNode = $this->getChildInstanceByName(PARAM_GET, false);
102 102 if (!$getNode)
103 103 return NULL;
104   - if (count($getNode->getChildren()) > 0)
105   - return $getNode->getChildren()[0];
  104 + if (count($getNode->getChildren()) > 0) {
  105 + $getNodes = $getNode->getChildren();
  106 + return $getNodes[0];
  107 + }
106 108 return NULL;
107 109 }
108 110  
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelNodeClass.php
... ... @@ -6,6 +6,7 @@ require_once("RequestOutputPlotElementStatusNodeClass.php");
6 6 require_once("RequestOutputPlotElementTickNodeClass.php");
7 7 require_once "RequestOutputPlotElementEpochNodeClass.php";
8 8 require_once "RequestOutputPlotElementInstantNodeClass.php";
  9 +require_once "RequestOutputPlotFontNodeClass.php";
9 10  
10 11 define ("REQUESTOUTPUTPLOTPANEL_NAME", "panel");
11 12 define ("REQUESTOUTPUTPLOTPANEL_TITLE", "title");
... ...