view m-toolbox/classes/@LTPDAHelper/generateFunctionList.m @ 30:317b5f447f3e database-connection-manager

Update workspaceBrowser
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 fcns = generateFunctionList()
  
  fcns = [];
  % Get current verbose level
  vl = LTPDAprefs.verboseLevel;
  LTPDAprefs('Display', 'verboseLevel', -1)
  % Add each user class
  ucls = utils.helper.ltpda_userclasses;
  
  %% Build the infrastructure first
  
  % Now go through and add the contents
  for jj=1:numel(ucls)
    disp(sprintf('** Building: %s', ucls{jj}));
    % add each algorithm for this class/category
    [clmethods, infos] = utils.helper.getPublicMethods(ucls{jj});
    % add each method to its subcategory
    for ll=1:numel(clmethods)
      ii = infos(ll);
%       fprintf('  + adding method %s/%s\n', ucls{jj}, clmethods{ll});
      a = local_minfo2algo(ii);
      fcns = [fcns a];
    end
  end
  % set verbose level again
  LTPDAprefs('Display', 'verboseLevel', vl)
  
end

function a = local_minfo2algo(ii)
  
  a = mpipeline.jltpda.LTPDAalgorithm;
  a.setMname(ii.mname);
  a.setMcategory(ii.mcategory);
  a.setMclass(ii.mclass);
  a.setMinInputs(ii.argsmin);
  a.setMaxInputs(ii.argsmax);
  a.setMinOutputs(ii.outmin);
  a.setMaxOutputs(ii.outmax);
  
  % get default plist for this method
  for pp = 1:numel(ii.sets)
    set = ii.sets{pp};
    mpl = ii.plists(pp);
    % build java plist
    jpl = LTPDAworkbench.mpl2jpl(mpl);
    a.addSetPlist(set,jpl);
  end
  
end