From e8ff4ba753f9e12e281465af1be9d09b42a56d87 Mon Sep 17 00:00:00 2001 From: Elena.Budnik <ebudnik@irap.omp.eu> Date: Thu, 19 Jan 2017 18:02:40 +0100 Subject: [PATCH] integration of ascii mydata params --- src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php | 2 ++ src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php | 4 +++- src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php | 18 +++++++++++++++++- src/Request/ParamsRequestImpl/ParamsRequestDataClass.php | 4 ++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php index e30a89d..915fb55 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php @@ -202,7 +202,9 @@ class IHMParamManagerClass $newParamNode = $paramsData->addLocalParamToCreate($res["param"]["id"], $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"]); + $tableDef = $res["param"]["info"]["tableDef"]; if (isset($tableDef) && array_key_exists('tableDefType', $tableDef) && ($tableDef['tableDefType'] != 'NONE')) diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php index 3ee043b..8aff1cd 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php @@ -32,13 +32,15 @@ class ParamGetLocalBaseNodeClass extends NodeClass return NULL; } - public function addLocalParam($id = "", $minSampling = "", $maxSampling = "") + public function addLocalParam($id = "", $minSampling = "", $maxSampling = "", $parameterType = "", $parameterSize = "") { $paramNode = new ParamGetLocalBaseParamNodeClass(); $paramNode->setId($id); $paramNode->setMinSampling($minSampling); $paramNode->setMaxSampling($maxSampling); + $paramNode->setParameterType($parameterType); + $paramNode->setParameterSize($parameterSize); $this->addChild($paramNode); diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php index 395878a..8828367 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php @@ -4,6 +4,8 @@ define ("PARAMGETLOCALBASEPARAM_NAME", "param"); define ("PARAMGETLOCALBASEPARAM_ID", "id"); define ("PARAMGETLOCALBASEPARAM_MINSAMPLING", "minSampling"); define ("PARAMGETLOCALBASEPARAM_MAXSAMPLING", "maxSampling"); +define ("PARAMGETLOCALBASEPARAM_TYPE", "type"); +define ("PARAMGETLOCALBASEPARAM_SIZE", "size"); define ("PARAMGETLOCALBASEPARAM_CALIB", "clb"); define ("PARAMGETLOCALBASEPARAM_CALIBNAME", "name"); @@ -40,6 +42,16 @@ class ParamGetLocalBaseParamNodeClass extends NodeClass $this->setAttribute(PARAMGETLOCALBASEPARAM_MAXSAMPLING, $maxSampling); } + public function setParameterType($parameterType) + { + $this->setAttribute(PARAMGETLOCALBASEPARAM_TYPE, strtolower($parameterType)); + } + + public function setParameterSize($parameterSize) + { + $this->setAttribute(PARAMGETLOCALBASEPARAM_SIZE, $parameterSize); + } + public function addCalibInfo($calibInfo = "") { if ($this->calibInfoExist($calibInfo)) @@ -70,7 +82,11 @@ class ParamGetLocalBaseParamNodeClass extends NodeClass $this->setMinSampling($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_MINSAMPLING)); $this->setMaxSampling($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_MAXSAMPLING)); - + + $this->setParameterType($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_TYPE)); + + $this->setParameterSize($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_SIZE)); + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMGETLOCALBASEPARAM_CALIB) as $calibXmlNode) { $this->addCalibInfo($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_CALIBNAME)); } diff --git a/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php b/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php index 76c8ff9..e26d4b7 100644 --- a/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php +++ b/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php @@ -141,7 +141,7 @@ class ParamsRequestDataClass extends ProcessRequestDataClass return $this->localParamsToCreate; } - public function addLocalParamToCreate($paramId, $viId, $realVarId, $minSampling, $maxSampling, $dateModif) + public function addLocalParamToCreate($paramId, $viId, $realVarId, $minSampling, $maxSampling, $type, $size, $dateModif) { $newParam = new ParamNodeClass(); $newParam->setId($paramId); @@ -151,7 +151,7 @@ class ParamsRequestDataClass extends ProcessRequestDataClass $localParamNode = $newParam->addParamGet(ParamGetTypeEnum::LOCALBASE); $localParamNode->setVIId($viId); - $localParamNode->addLocalParam($realVarId, $minSampling, $maxSampling); + $localParamNode->addLocalParam($realVarId, $minSampling, $maxSampling, $type, $size); $newParam->setProcess(""); $newParam->setOutput(); -- libgit2 0.21.2