diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/m/gui/gltpda/g_BuildParamCommand.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,34 @@
+function paramcommand = g_BuildParamCommand(paramlist,varargin)
+   % Reconstruct the command line necessary to build a given plist
+   
+   global params paramEnabled paramSets noParamsReq %#ok<NUSED>
+   
+   % Initialize of the paramcommand object:
+   paramcommand = strcat('params=',string(paramlist),';');
+   
+   if strcmpi(get_param(gcbh,'Tag'),'arithmetic'), return; end
+   
+   if exist('paramEnabled','var') && ~isempty(paramEnabled)
+      paramcommand = [paramcommand,' paramEnabled=',mat2str(paramEnabled),';'];
+   end
+   
+   if ~exist('params','var') || nparams(paramlist)==0, paramcommand='params=plist(); paramEnabled=[];'; end
+   
+   if exist('noParamsReq','var') && noParamsReq==1
+      paramcommand = [paramcommand,' noParamsReq=1;'];
+   end
+   
+   description = get_param(gcbh,'Description');
+   funcname = findstr('functionName=',description);
+   if funcname
+      i = funcname+14;
+      while ~strcmp(description(i),';'), i=i+1; end
+      funcname = description(funcname+13:i-1);
+      paramcommand = [paramcommand,' functionName=',funcname,';'];
+   end
+   
+   if exist('paramSets','var') && ~isempty(paramSets)
+      paramcommand = [paramcommand,' paramSets=',string(paramSets),';'];
+   end
+   
+end