Mercurial > hg > ltpda
comparison m-toolbox/classes/@specwin/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 = specwin.initObjectWithSize(objShape(1), objShape(2)); | |
10 | |
11 else | |
12 | |
13 %%%%%%%%%% Call super-class | |
14 | |
15 fromDom@ltpda_nuo(obj, node, inhists); | |
16 | |
17 %%%%%%%%%% Get properties from the node attributes | |
18 | |
19 %%%%%%%%%% Get properties from the child nodes | |
20 | |
21 % Get type | |
22 childNode = utils.xml.getChildByName(node, 'type'); | |
23 if ~isempty(childNode) | |
24 obj.type = utils.xml.getString(childNode); | |
25 end | |
26 | |
27 % Get alpha | |
28 childNode = utils.xml.getChildByName(node, 'alpha'); | |
29 if ~isempty(childNode) | |
30 obj.alpha = utils.xml.getNumber(childNode); | |
31 end | |
32 | |
33 % Get psll | |
34 childNode = utils.xml.getChildByName(node, 'psll'); | |
35 if ~isempty(childNode) | |
36 obj.psll = utils.xml.getNumber(childNode); | |
37 end | |
38 | |
39 % Get rov | |
40 childNode = utils.xml.getChildByName(node, 'rov'); | |
41 if ~isempty(childNode) | |
42 obj.rov = utils.xml.getNumber(childNode); | |
43 end | |
44 | |
45 % Get nenbw | |
46 childNode = utils.xml.getChildByName(node, 'nenbw'); | |
47 if ~isempty(childNode) | |
48 obj.nenbw = utils.xml.getNumber(childNode); | |
49 end | |
50 | |
51 % Get w3db | |
52 childNode = utils.xml.getChildByName(node, 'w3db'); | |
53 if ~isempty(childNode) | |
54 obj.w3db = utils.xml.getNumber(childNode); | |
55 end | |
56 | |
57 % Get flatness | |
58 childNode = utils.xml.getChildByName(node, 'flatness'); | |
59 if ~isempty(childNode) | |
60 obj.flatness = utils.xml.getNumber(childNode); | |
61 end | |
62 | |
63 % Get levelorder | |
64 childNode = utils.xml.getChildByName(node, 'levelorder'); | |
65 if ~isempty(childNode) | |
66 obj.levelorder = utils.xml.getNumber(childNode); | |
67 end | |
68 | |
69 % Get skip | |
70 childNode = utils.xml.getChildByName(node, 'skip'); | |
71 if ~isempty(childNode) | |
72 obj.skip = utils.xml.getNumber(childNode); | |
73 end | |
74 | |
75 % Get len | |
76 childNode = utils.xml.getChildByName(node, 'len'); | |
77 if ~isempty(childNode) | |
78 obj.len = utils.xml.getNumber(childNode); | |
79 end | |
80 | |
81 % Get win | |
82 childNode = utils.xml.getChildByName(node, 'win'); | |
83 if ~isempty(childNode) | |
84 obj.len = length(utils.xml.getNumber(childNode)); | |
85 end | |
86 | |
87 end | |
88 | |
89 end |