From e916534262a4d226073e2a2b684a203dc460102c Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 3 Nov 2017 18:21:57 +0100 Subject: [PATCH] Write data mining expression in description attribute --- src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php | 4 ++-- src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php | 6 +++--- src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php | 6 ++++-- src/Request/ParamsRequestImpl/ParamsRequestDataClass.php | 8 ++++---- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php b/src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php index 2dedbcc..c258d1e 100644 --- a/src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php +++ b/src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php @@ -36,7 +36,7 @@ class IHMInputOutputParamsDataMiningClass extends IHMInputOutputParamsAbstractCl $paramId = "datamining_".md5($expressionInfo["expression"]); //create a derived param for the expression - $this->paramManager->addProcessParam($paramId, $expressionInfo["expression"], + $this->paramManager->addProcessParam($paramId, $expressionInfo["expression"], $input->expression, $expressionInfo['params'], $input->sampling, $input->gap,time(),$this->paramsData); @@ -64,4 +64,4 @@ class IHMInputOutputParamsDataMiningClass extends IHMInputOutputParamsAbstractCl return $this->commonMarshallResult($data,DATAMINING_RESULT_FILE_KEY); } } -?> \ No newline at end of file +?> diff --git a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php index 5c1ba35..fd7f84b 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php @@ -39,9 +39,9 @@ class IHMParamManagerClass /* * @brief Add a process parameter */ - public function addProcessParam($paramId,$expression,$params,$sampling,$gap,$dateModif,$paramsData) + public function addProcessParam($paramId,$expression,$expression_info,$params,$sampling,$gap,$dateModif,$paramsData) { - $paramsData->addProcessParamToCreate($paramId, $expression, $params, $sampling, $gap,$dateModif); + $paramsData->addProcessParamToCreate($paramId, $expression, $expression_info, $params, $sampling, $gap,$dateModif); foreach ($params as $param) { $template_args = NULL; @@ -192,7 +192,7 @@ class IHMParamManagerClass $paramId = $param; //create a process param for the derived parameter - $this->addProcessParam($paramId, $expressionInfo["expression"], + $this->addProcessParam($paramId, $expressionInfo["expression"], $res["param"]["expression"], $expressionInfo['params'], $res["param"]["timestep"], 0,$res["param"]["dateModif"],$paramsData); diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php index e02a574..e57e32e 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php @@ -13,6 +13,7 @@ define ("PARAM_SAMPLING", "time_resolution"); define ("PARAM_GAP", "gap_threshold"); define ("PARAM_GET", "get"); define ("PARAM_PROCESS", "process"); +define ("PARAM_PROCESS_DESCRIPTION", "description"); define ("PARAM_OUTPUT", "output"); abstract class ParamGetTypeEnum @@ -108,10 +109,11 @@ class ParamNodeClass extends NodeClass return NULL; } - public function setProcess($process) + public function setProcess($process, $process_info) { $node = $this->getChildInstanceByName(PARAM_PROCESS, true); $node->setValue($process); + $node->setAttribute(PARAM_PROCESS_DESCRIPTION, $process_info); } public function setOutput() @@ -164,7 +166,7 @@ class ParamNodeClass extends NodeClass $processXmlNode = $this->getXmlNodeChildByTagName($xmlNode, PARAM_PROCESS); if (isset($processXmlNode)) - $this->setProcess($this->getXmlNodeValue($processXmlNode)); + $this->setProcess($this->getXmlNodeValue($processXmlNode),$this->getXmlNodeAttribute($processXmlNode,PARAM_PROCESS_DESCRIPTION)); $outputNode = $this->setOutput(); $outputXmlNode = $this->getXmlNodeChildByTagName($xmlNode, PARAM_OUTPUT); diff --git a/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php b/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php index 11dd960..4a21c41 100644 --- a/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php +++ b/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php @@ -117,7 +117,7 @@ class ParamsRequestDataClass extends ProcessRequestDataClass return $this->processParamsToCreate; } - public function addProcessParamToCreate($paramId, $expression, $getParams, $sampling, $gap, $dateModif) + public function addProcessParamToCreate($paramId, $expression, $expression_info, $getParams, $sampling, $gap, $dateModif) { $newParam = new ParamNodeClass(); $newParam->setId($paramId); @@ -132,7 +132,7 @@ class ParamsRequestDataClass extends ProcessRequestDataClass else $amdaParamNode->setParamName($getParam['paramid']); } - $newParam->setProcess($expression); + $newParam->setProcess($expression, $expression_info); $newParam->setOutput(); $this->processParamsToCreate[$paramId] = array('param' => $newParam, 'dateModif' => $dateModif); @@ -160,7 +160,7 @@ class ParamsRequestDataClass extends ProcessRequestDataClass $localParamNode->addLocalParam($realVarId, $minSampling, $maxSampling, $type, $size); - $newParam->setProcess(""); + $newParam->setProcess("",""); $newParam->setOutput(); if ($isImpex) @@ -176,4 +176,4 @@ class ParamsRequestDataClass extends ProcessRequestDataClass } } -?> \ No newline at end of file +?> -- libgit2 0.21.2