Commit e99d9ed4d8dd6bc235091f6a0250e9f34bd32102

Authored by Benjamin Renard
1 parent 1e653e6f

Support fillValue for uploaded parameters (#7749)

src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php
@@ -333,7 +333,7 @@ class IHMParamManagerClass @@ -333,7 +333,7 @@ class IHMParamManagerClass
333 $res["param"]["info"]["viId"], $res["param"]["info"]["realVar"], 333 $res["param"]["info"]["viId"], $res["param"]["info"]["realVar"],
334 $res["param"]["info"]["minSampling"], $res["param"]["info"]["maxSampling"], 334 $res["param"]["info"]["minSampling"], $res["param"]["info"]["maxSampling"],
335 $res["param"]["info"]["type"],$res["param"]["info"]["size"], 335 $res["param"]["info"]["type"],$res["param"]["info"]["size"],
336 - $res["param"]["dateModif"],true); 336 + NULL,$res["param"]["dateModif"],true);
337 337
338 $newParamNode->getInfo()->setName($res["param"]["info"]['name']); 338 $newParamNode->getInfo()->setName($res["param"]["info"]['name']);
339 $newParamNode->getInfo()->setShortName($res["param"]["info"]['name']); 339 $newParamNode->getInfo()->setShortName($res["param"]["info"]['name']);
@@ -407,7 +407,7 @@ class IHMParamManagerClass @@ -407,7 +407,7 @@ class IHMParamManagerClass
407 $res["param"]["info"]["viId"], $res["param"]["info"]["realVar"], 407 $res["param"]["info"]["viId"], $res["param"]["info"]["realVar"],
408 $res["param"]["info"]["minSampling"], $res["param"]["info"]["maxSampling"], 408 $res["param"]["info"]["minSampling"], $res["param"]["info"]["maxSampling"],
409 $res["param"]["info"]["type"],$res["param"]["info"]["size"], 409 $res["param"]["info"]["type"],$res["param"]["info"]["size"],
410 - $res["param"]["dateModif"]); 410 + $res["param"]["info"]["fillValue"],$res["param"]["dateModif"]);
411 411
412 if (!empty($res["param"]["info"]["yTitle"])) { 412 if (!empty($res["param"]["info"]["yTitle"])) {
413 $newParamNode->getInfo()->setName($res["param"]["info"]['yTitle']); 413 $newParamNode->getInfo()->setName($res["param"]["info"]['yTitle']);
src/InputOutput/IHMImpl/Tools/IHMUserParamLoaderClass.php
@@ -37,6 +37,7 @@ class IHMUserParamLoaderClass @@ -37,6 +37,7 @@ class IHMUserParamLoaderClass
37 private static $infoUploadedTypeNode = 'type'; 37 private static $infoUploadedTypeNode = 'type';
38 private static $infoUploadedSizeNode = 'size'; 38 private static $infoUploadedSizeNode = 'size';
39 private static $infoUploadedVIIdNode = 'vi'; 39 private static $infoUploadedVIIdNode = 'vi';
  40 + private static $infoUploadedFillValNode = 'fillvalue';
40 private static $infoUploadedPlotTypeNode = 'plottype'; 41 private static $infoUploadedPlotTypeNode = 'plottype';
41 private static $infoUploadedTableDefNode = 'tableDef'; 42 private static $infoUploadedTableDefNode = 'tableDef';
42 private static $infoUploadedUnitsNode = 'units'; 43 private static $infoUploadedUnitsNode = 'units';
@@ -350,6 +351,12 @@ class IHMUserParamLoaderClass @@ -350,6 +351,12 @@ class IHMUserParamLoaderClass
350 $plotTypeNodes = $dom->getElementsByTagName(self::$infoUploadedPlotTypeNode); 351 $plotTypeNodes = $dom->getElementsByTagName(self::$infoUploadedPlotTypeNode);
351 if ($plotTypeNodes->length > 0) 352 if ($plotTypeNodes->length > 0)
352 $result["plotType"] = $plotTypeNodes->item(0)->nodeValue; 353 $result["plotType"] = $plotTypeNodes->item(0)->nodeValue;
  354 +
  355 + //get parameter fil value
  356 + $result["fillValue"] = NULL;
  357 + $fillValueNodes = $dom->getElementsByTagName(self::$infoUploadedFillValNode);
  358 + if (($fillValueNodes->length > 0) && ($fillValueNodes->item(0)->nodeValue != ''))
  359 + $result["fillValue"] = $fillValueNodes->item(0)->nodeValue;
353 360
354 //get parameter y units 361 //get parameter y units
355 $unitsNodes = $dom->getElementsByTagName(self::$infoUploadedUnitsNode); 362 $unitsNodes = $dom->getElementsByTagName(self::$infoUploadedUnitsNode);
src/Request/ParamsRequestImpl/ParamsRequestDataClass.php
@@ -213,12 +213,15 @@ class ParamsRequestDataClass extends ProcessRequestDataClass @@ -213,12 +213,15 @@ class ParamsRequestDataClass extends ProcessRequestDataClass
213 return $this->localParamsToCreateAndCopy; 213 return $this->localParamsToCreateAndCopy;
214 } 214 }
215 215
216 - public function addLocalParamToCreate($paramId, $viId, $realVarId, $minSampling, $maxSampling, $type, $size, $dateModif, $isImpex = false) 216 + public function addLocalParamToCreate($paramId, $viId, $realVarId, $minSampling, $maxSampling, $type, $size, $fillValue, $dateModif, $isImpex = false)
217 { 217 {
218 $newParam = new ParamNodeClass(); 218 $newParam = new ParamNodeClass();
219 $newParam->setId($paramId); 219 $newParam->setId($paramId);
220 220
221 - $newParam->getInfo(); 221 + $infoNode = $newParam->getInfo();
  222 + if (isset($fillValue)) {
  223 + $infoNode->setFillVal($fillValue);
  224 + }
222 225
223 $localParamNode = $newParam->addParamGet(ParamGetTypeEnum::LOCALBASE); 226 $localParamNode = $newParam->addParamGet(ParamGetTypeEnum::LOCALBASE);
224 $localParamNode->setVIId($viId); 227 $localParamNode->setVIId($viId);