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