view m-toolbox/classes/@plist/getDefaultAxisPlist.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents f0afece42f48
children
line wrap: on
line source

% GETDEFAULTAXISPLIST returns the default plist for the axis key based on
% the input set.
% 
% CALL:
%          pl = plist.getDefaultAxisPlist(set)
% 
% Supported sets: '1D', '2D', '3D'
% 
% VERSION $Id: getDefaultAxisPlist.m,v 1.2 2011/04/19 16:20:21 ingo Exp $
% 
function plout = getDefaultAxisPlist(varargin)
  
  if nargin == 0
    set = '';
  else
    set = varargin{1};
    
    if ~ischar(varargin{1})
      error('Incorrect usage: the set needs to be a string.');
    end
  end
  
%   persistent pl;
%   persistent lastset;
%   if exist('pl', 'var')==0 || isempty(pl) || ~strcmp(lastset, set)
    pl = buildplist(set);
%     lastset = set;
%   end
  plout = pl;
  
end

function pl = buildplist(set)

  switch set
    case '1D'
      pl = plist.AXIS_1D_PLIST;
    case '2D'
      pl = plist.AXIS_2D_PLIST;
    case '3D'
      pl = plist.AXIS_3D_PLIST;
    case ''
      pl = plist.AXIS_3D_PLIST;
    otherwise
      error('Unsupported set for default axis plist [%s]', set);
  end
  
end