Mercurial > hg > ltpda
comparison m-toolbox/classes/@pest/fromDom.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 | |
2 function obj = fromDom(obj, node, inhists) | |
3 | |
4 % Get shape | |
5 objShape = utils.xml.getShape(node); | |
6 | |
7 if any(objShape==0) | |
8 | |
9 obj = pest.initObjectWithSize(objShape(1), objShape(2)); | |
10 | |
11 else | |
12 | |
13 %%%%%%%%%% Call super-class | |
14 | |
15 fromDom@ltpda_uoh(obj, node, inhists); | |
16 | |
17 %%%%%%%%%% Get properties from the node attributes | |
18 | |
19 %%%%%%%%%% Get properties from the child nodes | |
20 | |
21 % Get dy | |
22 childNode = utils.xml.getChildByName(node, 'dy'); | |
23 if ~isempty(childNode) | |
24 obj.dy = utils.xml.getNumber(childNode); | |
25 end | |
26 | |
27 % Get y | |
28 childNode = utils.xml.getChildByName(node, 'y'); | |
29 if ~isempty(childNode) | |
30 obj.y = utils.xml.getNumber(childNode); | |
31 end | |
32 | |
33 % Get names | |
34 childNode = utils.xml.getChildByName(node, 'names'); | |
35 if ~isempty(childNode) | |
36 obj.names = eval(utils.xml.mchar(childNode.getTextContent())); | |
37 end | |
38 | |
39 % Get yunits | |
40 childNode = utils.xml.getChildByName(node, 'yunits'); | |
41 if ~isempty(childNode) | |
42 obj.yunits = utils.xml.getObject(childNode, inhists); | |
43 end | |
44 | |
45 % Get pdf | |
46 childNode = utils.xml.getChildByName(node, 'pdf'); | |
47 if ~isempty(childNode) | |
48 obj.pdf = utils.xml.getNumber(childNode); | |
49 end | |
50 | |
51 % Get cov | |
52 childNode = utils.xml.getChildByName(node, 'cov'); | |
53 if ~isempty(childNode) | |
54 obj.cov = utils.xml.getNumber(childNode); | |
55 end | |
56 | |
57 % Get corr | |
58 childNode = utils.xml.getChildByName(node, 'corr'); | |
59 if ~isempty(childNode) | |
60 obj.corr = utils.xml.getNumber(childNode); | |
61 end | |
62 | |
63 % Get chi2 | |
64 childNode = utils.xml.getChildByName(node, 'chi2'); | |
65 if ~isempty(childNode) | |
66 obj.chi2 = utils.xml.getNumber(childNode); | |
67 end | |
68 | |
69 % Get dof | |
70 childNode = utils.xml.getChildByName(node, 'dof'); | |
71 if ~isempty(childNode) | |
72 obj.dof = utils.xml.getNumber(childNode); | |
73 end | |
74 | |
75 % Get chain | |
76 childNode = utils.xml.getChildByName(node, 'chain'); | |
77 if ~isempty(childNode) | |
78 obj.chain = utils.xml.getNumber(childNode); | |
79 end | |
80 | |
81 % Get models | |
82 childNode = utils.xml.getChildByName(node, 'models'); | |
83 if ~isempty(childNode) | |
84 obj.models = utils.xml.getObject(childNode, inhists); | |
85 end | |
86 | |
87 end | |
88 | |
89 end |