view m-toolbox/m/gui/gltpda/g_BuildParamCommand.m @ 11:9174aadb93a5 database-connection-manager

Add LTPDA Repository utility functions into utils.repository
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

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