From e99d9ed4d8dd6bc235091f6a0250e9f34bd32102 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 1 Apr 2020 08:21:04 +0200 Subject: [PATCH] Support fillValue for uploaded parameters (#7749) --- src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php | 4 ++-- src/InputOutput/IHMImpl/Tools/IHMUserParamLoaderClass.php | 7 +++++++ src/Request/ParamsRequestImpl/ParamsRequestDataClass.php | 7 +++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php index b4d70b3..a0b644b 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php @@ -333,7 +333,7 @@ class IHMParamManagerClass $res["param"]["info"]["viId"], $res["param"]["info"]["realVar"], $res["param"]["info"]["minSampling"], $res["param"]["info"]["maxSampling"], $res["param"]["info"]["type"],$res["param"]["info"]["size"], - $res["param"]["dateModif"],true); + NULL,$res["param"]["dateModif"],true); $newParamNode->getInfo()->setName($res["param"]["info"]['name']); $newParamNode->getInfo()->setShortName($res["param"]["info"]['name']); @@ -407,7 +407,7 @@ class IHMParamManagerClass $res["param"]["info"]["viId"], $res["param"]["info"]["realVar"], $res["param"]["info"]["minSampling"], $res["param"]["info"]["maxSampling"], $res["param"]["info"]["type"],$res["param"]["info"]["size"], - $res["param"]["dateModif"]); + $res["param"]["info"]["fillValue"],$res["param"]["dateModif"]); if (!empty($res["param"]["info"]["yTitle"])) { $newParamNode->getInfo()->setName($res["param"]["info"]['yTitle']); diff --git a/src/InputOutput/IHMImpl/Tools/IHMUserParamLoaderClass.php b/src/InputOutput/IHMImpl/Tools/IHMUserParamLoaderClass.php index eb73318..b643c96 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMUserParamLoaderClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMUserParamLoaderClass.php @@ -37,6 +37,7 @@ class IHMUserParamLoaderClass private static $infoUploadedTypeNode = 'type'; private static $infoUploadedSizeNode = 'size'; private static $infoUploadedVIIdNode = 'vi'; + private static $infoUploadedFillValNode = 'fillvalue'; private static $infoUploadedPlotTypeNode = 'plottype'; private static $infoUploadedTableDefNode = 'tableDef'; private static $infoUploadedUnitsNode = 'units'; @@ -350,6 +351,12 @@ class IHMUserParamLoaderClass $plotTypeNodes = $dom->getElementsByTagName(self::$infoUploadedPlotTypeNode); if ($plotTypeNodes->length > 0) $result["plotType"] = $plotTypeNodes->item(0)->nodeValue; + + //get parameter fil value + $result["fillValue"] = NULL; + $fillValueNodes = $dom->getElementsByTagName(self::$infoUploadedFillValNode); + if (($fillValueNodes->length > 0) && ($fillValueNodes->item(0)->nodeValue != '')) + $result["fillValue"] = $fillValueNodes->item(0)->nodeValue; //get parameter y units $unitsNodes = $dom->getElementsByTagName(self::$infoUploadedUnitsNode); diff --git a/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php b/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php index 24d1ed9..c4356a2 100644 --- a/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php +++ b/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php @@ -213,12 +213,15 @@ class ParamsRequestDataClass extends ProcessRequestDataClass return $this->localParamsToCreateAndCopy; } - public function addLocalParamToCreate($paramId, $viId, $realVarId, $minSampling, $maxSampling, $type, $size, $dateModif, $isImpex = false) + public function addLocalParamToCreate($paramId, $viId, $realVarId, $minSampling, $maxSampling, $type, $size, $fillValue, $dateModif, $isImpex = false) { $newParam = new ParamNodeClass(); $newParam->setId($paramId); - $newParam->getInfo(); + $infoNode = $newParam->getInfo(); + if (isset($fillValue)) { + $infoNode->setFillVal($fillValue); + } $localParamNode = $newParam->addParamGet(ParamGetTypeEnum::LOCALBASE); $localParamNode->setVIId($viId); -- libgit2 0.21.2