InfoParamNodeClass.php
2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
define ("INFOPARAM_TAGNAME", "info");
define ("INFOPARAM_NAME", "name");
define ("INFOPARAM_SHORTNAME", "short_name");
define ("INFOPARAM_COMPONENTS", "components");
define ("INFOPARAM_UNITS", "units");
define ("INFOPARAM_COORDSYS", "coordinates_system");
define ("INFOPARAM_TENSORORDER", "tensor_order");
define ("INFOPARAM_SICONV", "si_conversion");
define ("INFOPARAM_TABLE", "table");
define ("INFOPARAM_FILLVAL", "fill_value");
define ("INFOPARAM_UCD", "ucd");
//define ("INFOPARAM_STATUSDEF", "status_def");
define ("INFOPARAM_DATASETID", "dataset_id");
/**
*
*/
abstract class InfoParamTableTypeEnum
{
const BOUNDS = "Bounds";
const MINMAX = "MinMax";
const CENTER = "Center";
const CENTERWIDTH = "CenterWidth";
}
/**
* @class InfoParamNodeClass
* @brief Definition of information about a parameter
* @details
*/
class InfoParamNodeClass extends NodeClass
{
public function __construct()
{
parent::__construct(INFOPARAM_TAGNAME);
$this->getChildInstanceByName(INFOPARAM_NAME,true);
$this->getChildInstanceByName(INFOPARAM_SHORTNAME,true);
$this->getChildInstanceByName(INFOPARAM_COMPONENTS,true);
$this->getChildInstanceByName(INFOPARAM_UNITS,true);
$this->getChildInstanceByName(INFOPARAM_COORDSYS,true);
$this->getChildInstanceByName(INFOPARAM_TENSORORDER,true);
$this->getChildInstanceByName(INFOPARAM_SICONV,true);
$this->getChildInstanceByName(INFOPARAM_TABLE,true);
$this->getChildInstanceByName(INFOPARAM_FILLVAL,true);
$this->getChildInstanceByName(INFOPARAM_UCD,true);
//$this->getChildInstanceByName(INFOPARAM_STATUSDEF,true);
$this->getChildInstanceByName(INFOPARAM_DATASETID,true);
}
public function setName($name)
{
$node = $this->getChildInstanceByName(INFOPARAM_NAME,true);
$node->setValue($sampling);
}
public function addTable($type, $name)
{
$node = $this->getChildInstanceByName(INFOPARAM_TABLE, true);
switch ($type)
{
case InfoParamTableTypeEnum::BOUNDS :
$tableDef = new InfoParamTableDefBoundsNodeClass();
break;
case InfoParamTableTypeEnum::MINMAX :
$tableDef = new InfoParamTableDefMinMaxNodeClass();
break;
case InfoParamTableTypeEnum::CENTER :
$tableDef = new InfoParamTableDefCenterNodeClass();
break;
case InfoParamTableTypeEnum::CENTERWIDTH :
$tableDef = new InfoParamTableDefCenterWidthNodeClass();
break;
default :
throw new Exception('Table definition node not implemented');
}
$tableDef->setTableName($name);
$node->addChild($tableDef);
return $tableDef;
}
}
?>