Home > classes > @plist > display.m

display

PURPOSE ^

DISPLAY display plist object.

SYNOPSIS ^

function txt = display(pls, varargin)

DESCRIPTION ^

 DISPLAY display plist object.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: DISPLAY display plist object.

 VERSION: $Id: display.m,v 1.5 2008/02/14 08:29:09 mauro Exp $

 HISTORY: 30-01-2007 M Hewitson
             Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function txt = display(pls, varargin)
0002 % DISPLAY display plist object.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: DISPLAY display plist object.
0007 %
0008 % VERSION: $Id: display.m,v 1.5 2008/02/14 08:29:09 mauro Exp $
0009 %
0010 % HISTORY: 30-01-2007 M Hewitson
0011 %             Creation
0012 %
0013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0014 
0015 VERSION = '$Id: display.m,v 1.5 2008/02/14 08:29:09 mauro Exp $';
0016 CATEGORY = 'Output';
0017 
0018 % Check if this is a call for parameters
0019 if nargin == 2
0020   if isa(pls, 'plist') && ischar(varargin{1})
0021     in = char(varargin{1});
0022     if strcmp(in, 'Params')
0023       txt = plist();
0024       return
0025     elseif strcmp(in, 'Version')
0026       txt = VERSION;
0027       return
0028     elseif strcmp(in, 'Category')
0029       txt = CATEGORY;
0030       return
0031     end
0032   end
0033 end
0034 
0035 txt = {};
0036 
0037 for ii=1:numel(pls)
0038   pl = pls(ii);
0039   n  = nparams(pl);
0040 
0041   banner_start = sprintf('----------- plist %02d -----------', ii);
0042   txt{end+1} = banner_start;
0043 
0044   txt{end+1} = sprintf('n params: %d', n);
0045   params = get(pl, 'params');
0046   if n>0
0047     txt{end+1} = display(params);
0048   end
0049 
0050   txt = single_cell(txt);
0051 
0052   banner_end(1:length(banner_start)) = '-';
0053   txt{end+1} = banner_end;
0054 
0055 end
0056 
0057 if nargout == 0
0058   for ii=1:length(txt)
0059     disp(txt{ii});
0060   end
0061 end
0062 
0063 
0064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0065 
0066 function new_txt = single_cell(txt_field)
0067 
0068 new_txt = {};
0069 for ii=1:length(txt_field)
0070   if iscell(txt_field{ii})
0071     hh = single_cell(txt_field{ii});
0072     new_txt(end+1:end+length(hh)) = hh(1:end);
0073   else
0074     new_txt{end+1} = txt_field{ii};
0075   end
0076 end
0077 
0078 % END

Generated on Mon 31-Mar-2008 13:54:54 by m2html © 2003