ParamGetDDBaseNodeClass.php 1.32 KB
<?php

require_once "ParamGetDDBaseBaseParamNodeClass.php";

define ("PARAMGETDDBASE_NAME", "vi");
define ("PARAMGETDDBASE_NAMEATT", "name");

/**
 * @class ParamGetAmdaParamNodeClass
 * @brief Definition of a ddbase getter for AMDA_Kernel
 * @details
*/
class ParamGetDDBaseNodeClass extends NodeClass
{
	public function __construct()
	{
		parent::__construct(PARAMGETDDBASE_NAME);
	}

	public function setVIName($name)
	{
		$this->setAttribute(PARAMGETDDBASE_NAMEATT, $name);
	}

	public function getVIName()
	{
		return $this->getAttribute(PARAMGETDDBASE_NAMEATT);
	}

	public function addBaseParam($name = "", $calib_info_list = array(), $tensor_order = -1)
	{
		$baseParamNode = new ParamGetDDBaseBaseParamNodeClass();
		$baseParamNode->setParamName($name);
		if ($tensor_order > -1)
			$baseParamNode->setTensorOrder($tensor_order);
		foreach ($calib_info_list as $calib_info)
			$baseParamNode->addCalibInfo($calib_info);
		$this->addChild($baseParamNode);
		return $baseParamNode;
	}
	
	public function loadFromNode($xmlNode)
	{
		$this->setVIName($this->getXmlNodeAttribute($xmlNode, PARAMGETDDBASE_NAMEATT));
	
		foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMGETDDBASEBASEPARAM_NAME) as $baseParamXmlNode) {
			$this->addBaseParam()->loadFromNode($baseParamXmlNode);
		}
	}
}

?>