Mercurial > hg > ltpda
comparison m-toolbox/classes/@LTPDAworkbench/addBlock.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 % ADDBLOCK adds a block to the current pipeline | |
2 % | |
3 % CALL: addBlock(wb, name, info) | |
4 % addBlock(wb, name, info, x, y) | |
5 % | |
6 % M Hewitson 11-10-08 | |
7 % | |
8 % $Id: addBlock.m,v 1.3 2010/08/06 19:10:48 ingo Exp $ | |
9 % | |
10 function varargout = addBlock(varargin) | |
11 | |
12 wb = varargin{1}; | |
13 name = varargin{2}; | |
14 info = varargin{3}; | |
15 if nargin > 4 | |
16 x = varargin{4}; | |
17 y = varargin{5}; | |
18 end | |
19 | |
20 disp(sprintf('adding block: %s', name)); | |
21 algo = LTPDAworkbench.minfo2algo(info); | |
22 if nargin == 2 | |
23 name = awtinvoke(wb.mp, 'AddBlock(Ljava.lang.String;Lmpipeline.jltpda.LTPDAalgorithm;)', name, algo); | |
24 else | |
25 name = awtinvoke(wb.mp, 'AddBlock(Ljava.lang.String;Lmpipeline.jltpda.LTPDAalgorithm;II)', name, algo,x,y); | |
26 end | |
27 | |
28 % Set default plist | |
29 idx = find(strcmp('Default', info.sets)); | |
30 if isempty(idx) | |
31 wb.uploadPlist(name, info.plists(1)); | |
32 else | |
33 wb.uploadPlist(name, info.plists(idx)); | |
34 end | |
35 | |
36 if nargout > 0 | |
37 varargout{1} = char(name); | |
38 end | |
39 | |
40 end |