Mercurial > hg > ltpda
comparison m-toolbox/classes/@LTPDAworkbench/cb_submitObjects.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children | a26669b59d7e |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % CB_SUBMITOBJECTS submits the selected blocks outputs to a repository | |
2 % | |
3 % CALL: LTPDAworkbench.cb_submitObjects | |
4 % | |
5 % M Hewitson 13-11-08 | |
6 % | |
7 % $Id: cb_submitObjects.m,v 1.9 2010/08/06 19:10:49 ingo Exp $ | |
8 % | |
9 function cb_submitObjects(varargin) | |
10 | |
11 wb = varargin{1}; | |
12 | |
13 % Get all selected blocks | |
14 sbs = awtinvoke(wb.mp, 'getSelectedBlocks'); | |
15 | |
16 outvars = {}; | |
17 for ii=0:sbs.size()-1 | |
18 block = sbs.get(ii); | |
19 | |
20 % if this is a MElementWithPorts | |
21 if isa(block, 'mpipeline.canvas.MElementWithPorts') | |
22 | |
23 % loop over all outputs | |
24 outports = block.getOutputs(); | |
25 for kk=0:outports.size()-1 | |
26 op = outports.get(kk); | |
27 % get variable name | |
28 outvar = LTPDAworkbench.getWS_VarName(wb.UUID, block, op.getNumber); | |
29 outvars = [outvars {outvar}]; | |
30 end | |
31 end | |
32 end | |
33 | |
34 jsinfo = wb.mp.getSubmissionInfo(); | |
35 | |
36 sinfo.experiment_title = char(jsinfo.getExperimentTitle); | |
37 sinfo.experiment_description = char(jsinfo.getExperimentDescription); | |
38 sinfo.analysis_description = char(jsinfo.getAnalysisDescription); | |
39 sinfo.quantity = char(jsinfo.getQuantity); | |
40 sinfo.keywords = char(jsinfo.getKeywords); | |
41 sinfo.reference_ids = char(jsinfo.getReferenceIDs); | |
42 sinfo.additional_comments = char(jsinfo.getAdditionalComments); | |
43 sinfo.additional_authors = char(jsinfo.getAdditionalAuthors); | |
44 | |
45 cmd = '[ids, cids] = submit('; | |
46 | |
47 for kk=1:numel(outvars) | |
48 cmd = [cmd outvars{kk} ',']; | |
49 end | |
50 | |
51 cmd = [cmd 'sinfo, plist(''hostname'', ''''));']; | |
52 | |
53 assignin('base', 'sinfo', sinfo); | |
54 try | |
55 evalin('base', cmd); | |
56 catch me | |
57 fprintf(2, [me.message '\n']); | |
58 utils.helper.errorDlg('Unable to submit selected object. Has the pipeline been executed?', 'Submission error'); | |
59 end | |
60 | |
61 end | |
62 |