From 91e7647e6509964e779fd4be456a16271e090c2d Mon Sep 17 00:00:00 2001 From: Erdogan Furkan Date: Thu, 28 Jul 2022 07:34:03 +0000 Subject: [PATCH] Integration is now capable to send the fillValue to the kernel --- src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php | 8 +++++++- src/InputOutput/IHMImpl/Params/GenInfoParamImpl/IHMInputOutputParamsInfoGeneratorClass.php | 2 +- src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php | 21 +++++++++++++++------ src/InputOutput/IHMImpl/Tools/IHMUserParamManagerClass.php | 7 +++++++ src/Request/ParamsRequestImpl/ParamsRequestDataClass.php | 7 +++++-- src/Request/ProcessRequestImpl/Process/ProcessClass.php | 4 ++-- 6 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php b/src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php index 30c40be..9faf10d 100644 --- a/src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php +++ b/src/InputOutput/IHMImpl/Params/DataMiningImpl/IHMInputOutputParamsDataMiningClass.php @@ -42,7 +42,13 @@ class IHMInputOutputParamsDataMiningClass extends IHMInputOutputParamsAbstractCl //create a derived param for the expression $this->paramManager->addProcessParam($paramId, $expressionInfo["expression"], $input->expression, $expressionInfo['params'], $input->sampling_mode, $input->sampling, $input->reference_param, - $input->gap,time(),"","",$this->paramsData); + $input->gap, + time(), + "", + "", + "", + $this->paramsData + ); //add derived param to output $paramsNode->addParam($paramId); diff --git a/src/InputOutput/IHMImpl/Params/GenInfoParamImpl/IHMInputOutputParamsInfoGeneratorClass.php b/src/InputOutput/IHMImpl/Params/GenInfoParamImpl/IHMInputOutputParamsInfoGeneratorClass.php index e30aadb..129c670 100644 --- a/src/InputOutput/IHMImpl/Params/GenInfoParamImpl/IHMInputOutputParamsInfoGeneratorClass.php +++ b/src/InputOutput/IHMImpl/Params/GenInfoParamImpl/IHMInputOutputParamsInfoGeneratorClass.php @@ -18,7 +18,7 @@ class IHMInputOutputParamsInfoGeneratorClass extends IHMInputOutputParamsAbstrac $this->paramsData->setBatchEnable(FALSE); - $this->paramManager->addGeneratedParam($input->paramId, $input->buildchain, $input->sampling_mode, $input->timestep, $input->reference_param, $this->paramsData); + $this->paramManager->addGeneratedParam($input->paramId, $input->buildchain, $input->sampling_mode, $input->timestep, $input->reference_param, $input->fill_value, $this->paramsData); return $this->paramsData; } diff --git a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php index b509118..ff0c9fb 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php @@ -22,7 +22,7 @@ class IHMParamManagerClass $this->cacheExpressionParser = array(); } - public function addGeneratedParam($paramId, $expression, $sampling_mode, $sampling_step, $ref_param, $paramsData) + public function addGeneratedParam($paramId, $expression, $sampling_mode, $sampling_step, $ref_param, $fillvalue, $paramsData) { $expressionInfo = $this->parseExpression($expression, $paramsData->getWorkingPath()); if (!$expressionInfo['success']) { @@ -32,7 +32,13 @@ class IHMParamManagerClass //create a process param for the derived parameter $this->addProcessParam($paramId, $expressionInfo["expression"], $expression, $expressionInfo['params'], $sampling_mode, $sampling_step, $ref_param, - 0, time(), "", "", $paramsData); + 0, + time(), + "", + "", + $fillvalue, + $paramsData + ); } /* @@ -54,9 +60,9 @@ class IHMParamManagerClass /* * @brief Add a process parameter */ - public function addProcessParam($paramId,$expression,$expression_info,$params, $sampling_mode, $sampling_step, $ref_param, $gap,$dateModif,$units,$ytitle,$paramsData) + public function addProcessParam($paramId, $expression, $expression_info, $params, $sampling_mode, $sampling_step, $ref_param, $gap, $dateModif, $units, $ytitle, $fillvalue, $paramsData) { - $paramsData->addProcessParamToCreate($paramId, $expression, $expression_info, $params, $sampling_mode, $sampling_step, $ref_param, $gap,$dateModif, $units, $ytitle); + $paramsData->addProcessParamToCreate($paramId, $expression, $expression_info, $params, $sampling_mode, $sampling_step, $ref_param, $gap, $dateModif, $units, $ytitle, $fillvalue); foreach ($params as $param) { $template_args = NULL; @@ -327,12 +333,15 @@ class IHMParamManagerClass $res_split = $this->splitParamComponents($reference_param); $reference_param = $res_split['param']; } - + //create a process param for the derived parameter $this->addProcessParam($paramId, $expressionInfo["expression"], $res["param"]["expression"], $expressionInfo['params'], $res["param"]["info"]["sampling_mode"], $res["param"]["info"]["timestep"], $reference_param, 0,$res["param"]["dateModif"],!empty($res["param"]["info"]["units"]) ? $res["param"]["info"]["units"] : "", - !empty($res["param"]["info"]["yTitle"]) ? $res["param"]["info"]["yTitle"] : "", $paramsData); + !empty($res["param"]["info"]["yTitle"]) ? $res["param"]["info"]["yTitle"] : "", + $res["param"]["info"]["fill_value"], + $paramsData + ); return array("id" => $paramId, "indexes" => $indexes, "calib_infos" => array()); } diff --git a/src/InputOutput/IHMImpl/Tools/IHMUserParamManagerClass.php b/src/InputOutput/IHMImpl/Tools/IHMUserParamManagerClass.php index a83f13e..53943f9 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMUserParamManagerClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMUserParamManagerClass.php @@ -19,6 +19,7 @@ class IHMUserParamManagerClass //additional info for derived parameter private static $infoDerivedUnitsNode = 'units'; private static $infoDerivedYTitleNode = 'ytitle'; + private static $infoDerivedFillValueNode = 'fill_value'; private static $infoDerivedDescriptionNode = 'description'; private static $infoDerivedParsedExpNode = 'parsedExp'; private static $infoDerivedParsedExpValAtt = 'exp'; @@ -321,6 +322,12 @@ class IHMUserParamManagerClass $result["yTitle"] = ""; } } + + //get parameter fill value + $fillValueNodes = $dom->getElementsByTagName(self::$infoDerivedFillValueNode); + if ($fillValueNodes->length > 0) { + $result["fill_value"] = $fillValueNodes->item(0)->nodeValue; + } //get parameter description $descNodes = $dom->getElementsByTagName(self::$infoDerivedDescriptionNode); diff --git a/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php b/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php index 06a4116..28da392 100644 --- a/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php +++ b/src/Request/ParamsRequestImpl/ParamsRequestDataClass.php @@ -140,14 +140,17 @@ class ParamsRequestDataClass extends ProcessRequestDataClass { $this->datasetId[] = $dsId; } - - public function addProcessParamToCreate($paramId, $expression, $expression_info, $getParams, $sampling_mode, $sampling_step, $ref_param, $gap, $dateModif, $units, $ytitle) + + public function addProcessParamToCreate($paramId, $expression, $expression_info, $getParams, $sampling_mode, $sampling_step, $ref_param, $gap, $dateModif, $units, $ytitle, $fillvalue) { $newParam = new ParamNodeClass(); $newParam->setId($paramId); if (!empty($units)) { $newParam->getInfo()->setUnits($units); } + if ($fillvalue != "") { + $newParam->getInfo()->setFillVal($fillvalue); + } if (!empty($ytitle)) { $newParam->getInfo()->setShortName($ytitle); } diff --git a/src/Request/ProcessRequestImpl/Process/ProcessClass.php b/src/Request/ProcessRequestImpl/Process/ProcessClass.php index 540d177..58d9689 100644 --- a/src/Request/ProcessRequestImpl/Process/ProcessClass.php +++ b/src/Request/ProcessRequestImpl/Process/ProcessClass.php @@ -280,8 +280,8 @@ class ProcessClass if (!chdir($this->runningPath)) return false; - if (!$keep_log && file_exists($this->outputFile)) - unlink($this->outputFile); + //if (!$keep_log && file_exists($this->outputFile)) + // unlink($this->outputFile); if (file_exists($this->exitCodeFile)) unlink($this->exitCodeFile); -- libgit2 0.21.2