comparison m-toolbox/classes/@ssm/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 = ssm.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 amats
22 childNode = utils.xml.getChildByName(node, 'amats');
23 if ~isempty(childNode)
24 obj.amats = utils.xml.getCell(childNode, inhists);
25 end
26
27 % Get bmats
28 childNode = utils.xml.getChildByName(node, 'bmats');
29 if ~isempty(childNode)
30 obj.bmats = utils.xml.getCell(childNode, inhists);
31 end
32
33 % Get cmats
34 childNode = utils.xml.getChildByName(node, 'cmats');
35 if ~isempty(childNode)
36 obj.cmats = utils.xml.getCell(childNode, inhists);
37 end
38
39 % Get dmats
40 childNode = utils.xml.getChildByName(node, 'dmats');
41 if ~isempty(childNode)
42 obj.dmats = utils.xml.getCell(childNode, inhists);
43 end
44
45 % Get timestep
46 childNode = utils.xml.getChildByName(node, 'timestep');
47 if ~isempty(childNode)
48 obj.timestep = utils.xml.getNumber(childNode);
49 end
50
51 % Get inputs
52 childNode = utils.xml.getChildByName(node, 'inputs');
53 if ~isempty(childNode)
54 obj.inputs = utils.xml.getObject(childNode, inhists);
55 end
56
57 % Get states
58 childNode = utils.xml.getChildByName(node, 'states');
59 if ~isempty(childNode)
60 obj.states = utils.xml.getObject(childNode, inhists);
61 end
62
63 % Get outputs
64 childNode = utils.xml.getChildByName(node, 'outputs');
65 if ~isempty(childNode)
66 obj.outputs = utils.xml.getObject(childNode, inhists);
67 end
68
69 % Get numparams
70 childNode = utils.xml.getChildByName(node, 'numparams');
71 if ~isempty(childNode)
72 obj.numparams = utils.xml.getObject(childNode, inhists);
73 end
74
75 % Get params
76 childNode = utils.xml.getChildByName(node, 'params');
77 if ~isempty(childNode)
78 obj.params = utils.xml.getObject(childNode, inhists);
79 end
80
81 end
82
83 end