comparison m-toolbox/classes/@LTPDAworkbench/runPipeline.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 % RUNPIPELINE runs the currently active pipeline from the beginning.
2 %
3 % CALL: wb.runPipeline
4 %
5 % M Hewitson 13-11-08
6 %
7 % $Id: runPipeline.m,v 1.21 2011/03/29 13:40:16 hewitson Exp $
8 %
9 function varargout = runPipeline(varargin)
10
11 wb = varargin{1};
12 if ~isa(wb, 'LTPDAworkbench')
13 error('runPipeline needs an LTPDAworkbench instance as the first input.');
14 end
15
16 % Assume running is successful
17 res = true;
18
19 setappdata(0, 'LTPDAworkbench', wb);
20 wb.reset(false);
21
22 wb.mp.setExecuting(true);
23 if wb.mp.popupConsoleOnExecution()
24 wb.mp.showConsole();
25 end
26
27 try
28
29 LTPDAworkbench.executeConstants(wb);
30
31 % Now execute all other blocks
32 cmds = {};
33 while awtinvoke(wb.mp, 'countReadyBlocks') > 0
34 try
35 wb.stepForward;
36 catch exception
37 utils.helper.errorDlg([exception.message], 'Execution error');
38 wb.addErrorMessage(exception.cause{1}.message);
39 utils.helper.err(exception.message);
40 res = false;
41 end
42 drawnow;
43 end
44 catch
45 wb.mp.setExecuting(false);
46 res = false;
47 end
48 wb.mp.setExecuting(false);
49
50 setappdata(0, 'LTPDAworkbench', []);
51
52 if nargout == 1
53 varargout{1} = res;
54 end
55
56 end
57