comparison m-toolbox/classes/@LTPDAworkbench/cb_executePlan.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 % cb_executePlan execute the execution plan
2 %
3 % M Hewitson 27-05-09
4 %
5 % $Id: cb_executePlan.m,v 1.4 2011/03/30 07:59:30 hewitson Exp $
6 %
7 function cb_executePlan(varargin)
8
9 disp('*** executing plan...');
10
11 wb = varargin{1};
12
13 % Get all selected blocks
14 execPlan = awtinvoke(wb.mp, 'getExecPlan');
15 steps = execPlan.getSteps();
16
17 wb.mp.setExecuting(true);
18
19 try
20 % Go through each step
21 for kk=1:steps.size
22 % Get the execution step
23 step = steps.get(kk-1);
24 if step.isActive
25 % Get diagram
26 bd = step.getDiag;
27 disp('===================================');
28 disp(['== Executing ' char(bd.getName) ]);
29 disp('===================================');
30 % set to active diagram
31 bd.setVisible(true);
32 bd.setSelected(true);
33 % run this diagram
34 res = wb.runPipeline;
35 if ~res
36 bname = questdlg(sprintf('Execution of pipeline "%s" failed. Do you want to continue?', char(bd.getName)), ...
37 'Pipeline Execution Failure', ...
38 'Continue', 'Abort', 'Abort');
39
40 switch lower(bname)
41 case 'continue'
42 case 'abort'
43 break;
44 end
45
46 end
47 end
48 end
49
50 catch
51 wb.mp.setExecuting(false);
52 end
53
54 wb.mp.setExecuting(false);
55
56 end