Blame view

src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseNodeClass.php 1.32 KB
22521f1c   Benjamin Renard   First commit
1
2
<?php

966bd5f8   Benjamin Renard   Add request to ge...
3
4
require_once "ParamGetDDBaseBaseParamNodeClass.php";

22521f1c   Benjamin Renard   First commit
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
	}

966bd5f8   Benjamin Renard   Add request to ge...
20
	public function setVIName($name)
22521f1c   Benjamin Renard   First commit
21
22
23
24
	{
		$this->setAttribute(PARAMGETDDBASE_NAMEATT, $name);
	}

966bd5f8   Benjamin Renard   Add request to ge...
25
	public function getVIName()
22521f1c   Benjamin Renard   First commit
26
27
28
29
	{
		return $this->getAttribute(PARAMGETDDBASE_NAMEATT);
	}

966bd5f8   Benjamin Renard   Add request to ge...
30
	public function addBaseParam($name = "", $calib_info_list = array(), $tensor_order = -1)
22521f1c   Benjamin Renard   First commit
31
	{
966bd5f8   Benjamin Renard   Add request to ge...
32
33
		$baseParamNode = new ParamGetDDBaseBaseParamNodeClass();
		$baseParamNode->setParamName($name);
22521f1c   Benjamin Renard   First commit
34
35
36
37
		if ($tensor_order > -1)
			$baseParamNode->setTensorOrder($tensor_order);
		foreach ($calib_info_list as $calib_info)
			$baseParamNode->addCalibInfo($calib_info);
966bd5f8   Benjamin Renard   Add request to ge...
38
39
40
41
42
43
44
45
46
47
48
		$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);
		}
22521f1c   Benjamin Renard   First commit
49
50
51
52
	}
}

?>