Mercurial > hg > ltpda
comparison m-toolbox/sltpda/getVarBlockCommands.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 function cmds = getVarBlockCommands(blocks) | |
2 | |
3 % GETVARBLOCKCOMMANDS get a set of commands from a set of sLTPDA variable blocks. | |
4 % | |
5 % M Hewitson 27-03-07 | |
6 % | |
7 | |
8 | |
9 disp(' + compiling variable block list'); | |
10 | |
11 cmds = []; | |
12 | |
13 for j=1:length(blocks) | |
14 b = blocks(j); | |
15 blocktype = get(b, 'BlockType'); | |
16 name = get(b, 'Name'); | |
17 if strcmp(name, 'variable') | |
18 parent = get(b, 'Parent'); | |
19 name = [parent '_' name]; | |
20 name = sltpda_reduceVarName(name); | |
21 | |
22 vname = get(b, 'vname'); | |
23 vval = sltpda_getvar(b, 'vval'); | |
24 % store info | |
25 info.fcn = ''; | |
26 info.params = ''; | |
27 info.plist = plist(); | |
28 info.ins = cellstr(vval); | |
29 info.outs = cellstr(vname); | |
30 info.outsUsed = []; | |
31 info.cmd = ['global ' vname '; ' vname ' = [' vval '];'] | |
32 info.name = get(b, 'Name'); | |
33 info.handle = get(b, 'Handle'); | |
34 info.ranges = []; | |
35 | |
36 cmds = [cmds info]; | |
37 end | |
38 end |