0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 function paramcommand = g_BuildParamCommand(paramlist,varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 % Reconstruct the command line necessary to build a given plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 global params paramEnabled paramSets noParamsReq %#ok<NUSED>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 % Initialize of the paramcommand object:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 paramcommand = strcat('params=',string(paramlist),';');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 if strcmpi(get_param(gcbh,'Tag'),'arithmetic'), return; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 if exist('paramEnabled','var') && ~isempty(paramEnabled)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 paramcommand = [paramcommand,' paramEnabled=',mat2str(paramEnabled),';'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 if ~exist('params','var') || nparams(paramlist)==0, paramcommand='params=plist(); paramEnabled=[];'; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 if exist('noParamsReq','var') && noParamsReq==1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 paramcommand = [paramcommand,' noParamsReq=1;'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 description = get_param(gcbh,'Description');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 funcname = findstr('functionName=',description);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 if funcname
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 i = funcname+14;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 while ~strcmp(description(i),';'), i=i+1; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 funcname = description(funcname+13:i-1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 paramcommand = [paramcommand,' functionName=',funcname,';'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 if exist('paramSets','var') && ~isempty(paramSets)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 paramcommand = [paramcommand,' paramSets=',string(paramSets),';'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 end
|