ParamClbManualNodeClass.php 1.13 KB
<?php

define ("PARAMCLBMANUAL_TAGNAME", "clbManual");
define ("PARAMCLBMANUAL_NAME", "name");
define ("PARAMCLBMANUAL_VALUE", "value");

/**
 * @class ParamClbManualNodeClass
 * @brief Definition of a manual calibration info for a parameter
 * @details
 */
class ParamClbManualNodeClass extends NodeClass
{
	public function __construct()
	{
		parent::__construct(PARAMCLBMANUAL_TAGNAME);
	}
	
	public function setClbName($name)
	{
		$this->setAttribute(PARAMCLBMANUAL_NAME, $name);
	}
	
	public function getClbName($name)
	{
		return $this->getAttribute(PARAMCLBMANUAL_NAME);
	}
	
	public function addClbValue($value)
	{
		$valueNode = new NodeClass(PARAMCLBMANUAL_VALUE);
		$valueNode->setValue($value);
		$this->addChild($valueNode);
		return $valueNode;
	}
	
	public function getClbValues()
	{
		return $this->getChildrenByName(PARAMCLBMANUAL_VALUE);
	}
	
	public function loadFromNode($xmlNode)
	{
		$this->setClbName($this->getXmlNodeAttribute($xmlNode, PARAMCLBMANUAL_NAME));
		
		foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMCLBMANUAL_VALUE) as $clbXmlNode) {
			$this->addClbValue($this->getXmlNodeValue($clbXmlNode));
		}
	}
}

?>