diff --git a/src/InputOutput/IHMImpl/Config/IHMConfigClass.php b/src/InputOutput/IHMImpl/Config/IHMConfigClass.php index 441f6ee..67ac8d5 100644 --- a/src/InputOutput/IHMImpl/Config/IHMConfigClass.php +++ b/src/InputOutput/IHMImpl/Config/IHMConfigClass.php @@ -53,8 +53,8 @@ class IHMConfigClass private static $userHost; - public static $remoteDataDir = "/home/budnik/RemoteDataCenter/MAJ/"; - + public static $remoteDataDir = "RemoteData/"; + public static function setUserName($userName) { self::$userName = $userName; @@ -215,8 +215,7 @@ class IHMConfigClass public static function getRemoteParamsFile() { $remoteBasePath = self::getUserPath().self::$wsDir; - - + return $remoteBasePath.'RemoteParams.xml'; } @@ -229,6 +228,14 @@ class IHMConfigClass return $requestPath; } + + public static function getRemoteDataPath() + { + $remoteDataPath = IHM_SRC_DIR.self::$genericDataDir.self::$remoteDataDir; + + return $remoteDataPath; + } + } ?> diff --git a/src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php b/src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php index dfe7d62..b0456fc 100644 --- a/src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php +++ b/src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php @@ -100,7 +100,7 @@ class IHMInputOutputParamInfoClass implements InputOutputInterface $templatedParams = $this->paramImpexMgr->getParamTemplates(); $simRegion = $this->paramImpexMgr->getSimulationRegion($input->paramId); - + // No SimulationRuns (LESIA) if ($simRegion == "UNKNOWN") $simRegion = $this->paramImpexMgr->getResourceID($input->paramId); diff --git a/src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php b/src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php index 18a0569..604bdf8 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php @@ -132,7 +132,7 @@ class IHMImpexParamClass extends IHMParamTemplateClass public function setParamTemplateListFilePath($paramId) { - $this->paramTemplateListFilePath = IHMConfigClass::$remoteDataDir.$this->getDataProducer($paramId).'_Templates.xml'; + $this->paramTemplateListFilePath = IHMConfigClass::getRemoteDataPath().$this->getDataProducer($paramId)."/".$this->getDataProducer($paramId).'_Templates.xml'; } /* @@ -252,7 +252,7 @@ class IHMImpexParamClass extends IHMParamTemplateClass if ($this->getDataProducer($paramId) != "IPIM" && !$this->isSpectra($paramId)) return null; - $templateXml = IHMConfigClass::$remoteDataDir.$this->getDataProducer($paramId).'_PlotSettings.xml'; + $templateXml = IHMConfigClass::getRemoteDataPath().$this->getDataProducer($paramId)."/".$this->getDataProducer($paramId).'_PlotSettings.xml'; if (!file_exists($templateXml)) throw new Exception("No $templateXml"); @@ -285,4 +285,32 @@ class IHMImpexParamClass extends IHMParamTemplateClass return $paramNode->hasAttribute('isSpectra'); } + + public function getEnergyTableName($paramId) + { + $paramNode = $this->dom->getElementById($paramId); + if (!$paramNode) + throw new Exception("No $paramId"); + + return $paramNode->getAttribute('energyRange'); + + } + + public function getEnergyUnits($paramId) + { + $paramNode = $this->dom->getElementById($paramId); + if (!$paramNode) + throw new Exception("No $paramId"); + + return $paramNode->getAttribute('energyUnits'); + } + + public function getUnits($paramId) + { + $paramNode = $this->dom->getElementById($paramId); + if (!$paramNode) + throw new Exception("No $paramId"); + + return $paramNode->getAttribute('units'); + } } \ No newline at end of file diff --git a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php index 8e54aa3..5c1ba35 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php @@ -233,10 +233,45 @@ class IHMParamManagerClass $res["param"]["info"]["type"],$res["param"]["info"]["size"], $res["param"]["dateModif"],true); + $newParamNode->getInfo()->setName($res["param"]["info"]['name']); + $newParamNode->getInfo()->setShortName($res["param"]["info"]['name']); + $newParamNode->getInfo()->setUnits($res["param"]["info"]['units']); + $tableDef = $res["param"]["info"]["tableDef"]; if (isset($tableDef) && array_key_exists('tableDefType', $tableDef) && ($tableDef['tableDefType'] != 'NONE')) { - + switch ($tableDef['channelsDefType']) + { + case 'BOUND' : + $boundTable = $newParamNode->getInfo()->addTable(InfoParamTableTypeEnum::BOUNDS, $res["param"]["info"]["yTitle"]); + $boundTable->setUnits($res["param"]["info"]["yUnits"]); + switch ($tableDef['tableDefType']) + { + case 'SELECT' : + $boundTable->setBoundsName($tableDef['data']['bound']); + $newParamNode->getParamGet()->getLocalParam($res["param"]["info"]["realVar"])->addCalibInfo($tableDef['data']['bound']); + break; + default : + throw new Exception("Unknown tableDefType ".$tableDef['tableDefType']); + } + break; + case 'CENTER' : + $centerTable = $newParamNode->getInfo()->addTable(InfoParamTableTypeEnum::CENTER, $res["param"]["info"]["yTitle"]); + $centerTable->setUnits($res["param"]["info"]["yUnits"]); + $centerTable->setSize($tableDef['data']['width']); + switch ($tableDef['tableDefType']) + { + case 'SELECT' : + $centerTable->setCenterName($tableDef['data']['center']); + $newParamNode->getParamGet()->getLocalParam($res["param"]["info"]["realVar"])->addCalibInfo($tableDef['data']['center']); + break; + default : + throw new Exception("Unknown tableDefType ".$tableDef['tableDefType']); + } + break; + default : + throw new Exception("Unknown tableDefType ".$tableDef['channelsDefType']); + } } return array("id" => $res["param"]["id"], "plotType" => $res["param"]["info"]["plotType"]); diff --git a/src/RequestManager.php b/src/RequestManager.php index e0c7ec8..9029c5f 100644 --- a/src/RequestManager.php +++ b/src/RequestManager.php @@ -27,19 +27,37 @@ function amdaintegration_autoload($class_name) 'Request/ParamsRequestImpl/Nodes/Requests', 'Request/ProcessRequestImpl', 'Request/ProcessRequestImpl/Process', - 'Request/TTRequestImpl', - 'RemoteDataCenter' + 'Request/TTRequestImpl' ); - + + $ihm_dirs = array( + IHM_SRC_DIR.'php/classes', + IHM_SRC_DIR.'php/RemoteDataCenter' + ); + + $find = false; + foreach($dirs as $dir) { $file = __DIR__.'/'.$dir.'/'.$class_name.'.php'; if (file_exists($file)) { require $file; + $find = true; break; } } + + if (!$find) + foreach($ihm_dirs as $dir) + { + $file = $dir.'/'.$class_name.'.php'; + if (file_exists($file)) + { + require $file; + break; + } + } } spl_autoload_register('amdaintegration_autoload'); -- libgit2 0.21.2