You need to sign in before continuing.

Commit 3b0da89476768fb38eb59bbb4222163455a3e545

Authored by Benjamin Renard
1 parent 5a2e21d3
Exists in anr_tempete

Inject snapshots in template_args

src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -578,7 +578,14 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass @@ -578,7 +578,14 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
578 578
579 //Param 579 //Param
580 if (!$isTTCat) { 580 if (!$isTTCat) {
581 - $paramInfo = $this->paramManager->addExistingParam($paramData->{'paramid'}, $this->paramsData, isset($paramData->{'template_args'}) ? $paramData->{'template_args'} : NULL); 581 + $template_args = isset($paramData->{'template_args'}) ? $paramData->{'template_args'} : NULL;
  582 + if (isset($paramData->{'snapshots'})) {
  583 + // ANR TEMPETE - Inject snapshots in template_args
  584 + if (!isset($paramData->{'template_args'}))
  585 + $template_args = (Object)array();
  586 + $template_args->{'snapshots'} = $paramData->{'snapshots'};
  587 + }
  588 + $paramInfo = $this->paramManager->addExistingParam($paramData->{'paramid'}, $this->paramsData, $template_args);
582 } else { 589 } else {
583 $paramInfo = $this->paramManager->addTTCatParam($paramData->{'paramid'}, $this->paramsData); 590 $paramInfo = $this->paramManager->addTTCatParam($paramData->{'paramid'}, $this->paramsData);
584 } 591 }
src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php
@@ -25,7 +25,7 @@ class IHMImpexParamClass extends IHMParamTemplateClass @@ -25,7 +25,7 @@ class IHMImpexParamClass extends IHMParamTemplateClass
25 if (!file_exists($this->filePath)) 25 if (!file_exists($this->filePath))
26 throw new Exception("no RemoteParams File ".$this->filePath); 26 throw new Exception("no RemoteParams File ".$this->filePath);
27 27
28 - $this->dom->load($this->filePath); 28 + @$this->dom->load($this->filePath);
29 29
30 } 30 }
31 31
@@ -139,13 +139,19 @@ class IHMImpexParamClass extends IHMParamTemplateClass @@ -139,13 +139,19 @@ class IHMImpexParamClass extends IHMParamTemplateClass
139 * 139 *
140 */ 140 */
141 public function getImpexFullParamId($param_id, $templateArgs = NULL) { 141 public function getImpexFullParamId($param_id, $templateArgs = NULL) {
142 - 142 +
143 if (!$templateArgs) 143 if (!$templateArgs)
144 return $param_id; 144 return $param_id;
145 145
146 $fullParamId = $param_id; 146 $fullParamId = $param_id;
147 - foreach ($templateArgs as $key => $value)  
148 - $fullParamId .= "_".$value; 147 + foreach ($templateArgs as $key => $value) {
  148 + if ($key == 'snapshots') {
  149 + $fullParamId .= "_".md5(serialize($value));
  150 + }
  151 + else {
  152 + $fullParamId .= "_".$value;
  153 + }
  154 + }
149 155
150 return $fullParamId; 156 return $fullParamId;
151 } 157 }
@@ -313,4 +319,4 @@ class IHMImpexParamClass extends IHMParamTemplateClass @@ -313,4 +319,4 @@ class IHMImpexParamClass extends IHMParamTemplateClass
313 319
314 return $paramNode->getAttribute('units'); 320 return $paramNode->getAttribute('units');
315 } 321 }
316 -}  
317 \ No newline at end of file 322 \ No newline at end of file
  323 +}
src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php
@@ -324,7 +324,7 @@ class IHMParamManagerClass @@ -324,7 +324,7 @@ class IHMParamManagerClass
324 { 324 {
325 if (!isset($this->paramImpexMgr)) 325 if (!isset($this->paramImpexMgr))
326 $this->paramImpexMgr = new ImpexParamManager(); 326 $this->paramImpexMgr = new ImpexParamManager();
327 - 327 +
328 $parameterID = $this->paramImpexMgr->getImpexFullParamId($param, $templateArgs); 328 $parameterID = $this->paramImpexMgr->getImpexFullParamId($param, $templateArgs);
329 329
330 $requestNodes = $paramsData->getRequestNodes(); 330 $requestNodes = $paramsData->getRequestNodes();
@@ -337,11 +337,11 @@ class IHMParamManagerClass @@ -337,11 +337,11 @@ class IHMParamManagerClass
337 $timesNode = $requestNodes[0]->getTimesNode(); 337 $timesNode = $requestNodes[0]->getTimesNode();
338 $intervals = $timesNode->getIntervals(); 338 $intervals = $timesNode->getIntervals();
339 $originFile = IHMConfigClass::getUserWSPath().$parameterID.".xml"; 339 $originFile = IHMConfigClass::getUserWSPath().$parameterID.".xml";
340 - 340 +
341 if (!file_exists($originFile)) { 341 if (!file_exists($originFile)) {
342 - // create IMPEX parameter info and data 342 + // create IMPEX parameter info and data
343 $res = $this->paramImpexMgr->createImpexParameter($param, $intervals, $templateArgs); 343 $res = $this->paramImpexMgr->createImpexParameter($param, $intervals, $templateArgs);
344 - 344 +
345 if (!$res["success"]) 345 if (!$res["success"])
346 throw new Exception('Error to create IMPEX parameter : '.$res["message"]); 346 throw new Exception('Error to create IMPEX parameter : '.$res["message"]);
347 347