Commit 4768a87d370e23b1121a6f51aac676f4f4735614

Authored by Menouard AZIB
2 parents 8e9913e3 1277dcb7

Merge branch 'develop' into MAZ_6018

updates from develop
src/InputOutput/IHMImpl/Tools/CommonClass.php
... ... @@ -39,11 +39,25 @@ class CommonClass
39 39 public static function isoToTimeStampWithMls($iso)
40 40 {
41 41 date_default_timezone_set('UTC');
  42 + $iso = trim($iso);
  43 + if (empty($iso)) {
  44 + return 0.;
  45 + }
  46 + else if ($iso[strlen($iso)-1] == 'Z') {
  47 + $iso = substr($iso, 0, -1);
  48 + }
42 49 $date = DateTime::createFromFormat('Y-m-d\TH:i:s.v', $iso);
43 50 if ($date !== FALSE) {
44 51 return round(floatval($date->format('v'))/1000. + $date->getTimestamp(),3);
45 52 }
46 53 $date = DateTime::createFromFormat('Y-m-d\TH:i:s', $iso);
  54 + if ($date !== FALSE) {
  55 + return round(floatval($date->getTimestamp()),3);
  56 + }
  57 + $date = DateTime::createFromFormat('Y-m-d\TH:i', $iso);
  58 + if ($date === FALSE) {
  59 + return 0.;
  60 + }
47 61 return round(floatval($date->getTimestamp()),3);
48 62 }
49 63  
... ...
src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php
... ... @@ -345,12 +345,17 @@ class IHMParamManagerClass
345 345 $res_split = $this->splitParamComponents($reference_param);
346 346 $reference_param = $res_split['param'];
347 347 }
348   -
  348 +
  349 + // On plot, no need to plot "ws_" on derived parameter legend.
  350 + $newParamName="";
  351 + if(strpos($paramId, "ws_") === 0){
  352 + $newParamName=substr($paramId,3);
  353 + }
349 354 //create a process param for the derived parameter
350 355 $this->addProcessParam($paramId, $expressionInfo["expression"], $res["param"]["expression"],
351 356 $expressionInfo['params'], $res["param"]["info"]["sampling_mode"], $res["param"]["info"]["timestep"], $reference_param,
352 357 0,$res["param"]["dateModif"],!empty($res["param"]["info"]["units"]) ? $res["param"]["info"]["units"] : "",
353   - !empty($res["param"]["info"]["yTitle"]) ? $res["param"]["info"]["yTitle"] : "", $paramsData);
  358 + !empty($res["param"]["info"]["yTitle"]) ? $res["param"]["info"]["yTitle"] : $newParamName, $paramsData);
354 359  
355 360 return array("id" => $paramId, "indexes" => $indexes, "calib_infos" => array());
356 361 }
... ...
src/InputOutput/IHMImpl/Tools/IHMPlotContextFileClass.php
... ... @@ -136,7 +136,18 @@ class IHMPlotContextFileClass
136 136  
137 137 $pageContext['panels'][] = $panelContext;
138 138 }
139   -
  139 + $instantTimeNavNodes = $pageNode->getElementsByTagName('instantTimeNav');
  140 + foreach($instantTimeNavNodes as $instantTimeNavNode){
  141 + if ($instantTimeNavNode != "")
  142 + {
  143 + $instantTimeNavContext = array(
  144 + 'prevTime' => $instantTimeNavNode->getAttribute('prevTime'),
  145 + 'nextTime' => $instantTimeNavNode->getAttribute('nextTime'),
  146 + );
  147 + $pageContext['instantTimeNav']= $instantTimeNavContext;
  148 + }
  149 +
  150 + }
140 151 return array("success" => true, "page" => $pageContext);
141 152 }
142 153 }
... ...