setAttribute(REQUESTOUTPUTDOWNLOADPARAM_ID, $id); } public function getId() { return $this->getAttribute(REQUESTOUTPUTDOWNLOADPARAM_ID); } public function addIndex($index = "") { if ($this->indexExist($index)) return $this->getIndex($index); $node = new NodeClass(REQUESTOUTPUTDOWNLOADPARAM_INDEX); $node->setValue($index); $this->addChild($node); return $node; } public function getIndex($index) { $indexNodes = $this->getChildrenByName(REQUESTOUTPUTDOWNLOADPARAM_INDEX); foreach ($indexNodes as $indexNode) if ($indexNode->getValue() == $index) return $indexNode; return NULL; } public function indexExist($index) { return ($this->getIndex($index) != NULL); } public function addCalibInfo($calibInfo) { if ($this->calibInfoExist($calibInfo)) return $this->getCalibInfo($calibInfo); $node = new NodeClass(REQUESTOUTPUTDOWNLOADPARAM_CALIB); $node->setValue($calibInfo); $this->addChild($node); return $node; } public function getCalibInfo($calibInfo) { $calibNodes = $this->getChildrenByName(REQUESTOUTPUTDOWNLOADPARAM_CALIB); foreach ($calibNodes as $calibNode) if ($calibNode->getValue() == $calibInfo) return $calibNode; return NULL; } public function calibInfoExist($calibInfo) { return ($this->getCalibInfo($calibInfo) != NULL); } public function loadFromNode($xmlNode) { $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTDOWNLOADPARAM_ID)); foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTDOWNLOADPARAM_INDEX) as $indexXmlNode) { $this->addIndex($this->getXmlNodeValue($indexXmlNode)); } foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTDOWNLOADPARAM_CALIB) as $calibInfoXmlNode) { $this->addCalibInfo($this->getXmlNodeValue($calibInfoXmlNode)); } } } /** * @class RequestOutputDownloadNodeClass * @brief Definition of a request download output node for AMDA_Kernel * @details */ class RequestOutputDownloadNodeClass extends NodeClass { public function __construct() { parent::__construct(REQUESTOUTPUTDOWNLOAD_NAME); } public function setTimeFormat($type) { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_TIMEFORMAT, true); $node->setValue($type); } public function getTimeFormat() { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_TIMEFORMAT); return (($node == NULL) ? RequestOutputDownloadTimeFormatEnum::UNKNOWN : $node->getValue()); } public function setFileFormat($type) { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_FILEFORMAT, true); $node->setValue($type); } public function getFileFormat() { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_FILEFORMAT); return (($node == NULL) ? RequestOutputDownloadFileFormatEnum::UNKNOWN : $node->getValue()); } public function setFileName($name) { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_FILENAME, true); $node->setValue($name); } public function getFileName() { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_FILENAME); return (($node == NULL) ? "" : $node->getValue()); } public function setSamplingTime($sampling) { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_SAMPLING, true); $node->setValue($sampling); } public function getSamplingTime() { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_SAMPLING); return (($node == NULL) ? "" : $node->getValue()); } public function setStructure($type) { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_STRUCTURE, true); $node->setValue($type); } public function getStructure() { $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_STRUCTURE); return (($node == NULL) ? RequestOutputDownloadStructureEnum::UNKNOWN : $node->getValue()); } public function setPrecision($precision) { $this->setAttribute(REQUESTOUTPUTDOWNLOAD_PRECISION, $precision); } public function getPrecision() { return $this->getAttribute(REQUESTOUTPUTDOWNLOAD_PRECISION); } public function addParam($id = "", $indexes = NULL, $calib_infos = NULL) { $node = new RequestOutputDownloadParamNodeClass(); $node->setId($id); if (isset($indexes)) { foreach ($indexes as $index) $node->addIndex($index); } if (isset($calib_infos)) { foreach ($calib_infos as $calib_info) $node->addCalibInfo($calib_infos); } $this->addChild($node); return $node; } public function getParam($id) { $nodes = $this->getChildrenByName(REQUESTOUTPUTDOWNLOADPARAM_NAME); foreach ($nodes as $node) if ($node->getId() == $id) return $node; return NULL; } public function addPostProcessing($process = "") { $node = $this->getChildInstanceByName(REQUESTOUTPUTPOSTPROCESSING_NAME); if ($node == NULL) { $node = new RequestOutputPostProcessingNodeClass(); $this->addChild($node); } if ($process != "") $node->addPostProcessing($process); return $node; } public function isPostProcessing($process) { $node = $this->getChildInstanceByName(REQUESTOUTPUTPOSTPROCESSING_NAME); if ($node == NULL) return false; return $node->isPostProcessing($process); } public function loadFromNode($xmlNode) { $timeformatXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_TIMEFORMAT); if (isset($timeformatXmlNode)) $this->setTimeFormat($this->getXmlNodeValue($timeformatXmlNode)); $fileformatXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_FILEFORMAT); if (isset($fileformatXmlNode)) $this->FileFormat($this->getXmlNodeValue($fileformatXmlNode)); $filenameXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_FILENAME); if (isset($filenameXmlNode)) $this->setFileName($this->getXmlNodeValue($filenameXmlNode)); $structureXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_STRUCTURE); if (isset($structureXmlNode)) $this->setStructure($this->getXmlNodeValue($structureXmlNode)); $precisionXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_PRECISION); if (isset($precisionXmlNode)) $this->setPrecision($this->getXmlNodeValue($precisionXmlNode)); $paramXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOADPARAM_NAME); if (isset($paramXmlNode)) $this->addParam()->loadFromNode($paramXmlNode); $postProcessingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPOSTPROCESSING_NAME); if (isset($postProcessingXmlNode)) $this->addPostProcessing()->loadFromNode($postProcessingXmlNode); } } ?>