Home > classes > @ao > display.m

display

PURPOSE ^

DISPLAY implement terminal display for analysis object.

SYNOPSIS ^

function txt = display(ao, varargin)

DESCRIPTION ^

 DISPLAY implement terminal display for analysis object.

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

 DESCRIPTION: DISPLAY implement terminal display for analysis object.

 CALL:        txt = display(ao)
              ao                     % without a semicolon

 VERSION:     $Id: display.m,v 1.14 2008/01/08 16:39:11 ingo Exp $

 HISTORY:     31-01-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function txt = display(ao, varargin)
0002 % DISPLAY implement terminal display for analysis object.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: DISPLAY implement terminal display for analysis object.
0007 %
0008 % CALL:        txt = display(ao)
0009 %              ao                     % without a semicolon
0010 %
0011 % VERSION:     $Id: display.m,v 1.14 2008/01/08 16:39:11 ingo Exp $
0012 %
0013 % HISTORY:     31-01-2007 M Hewitson
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION = '$Id: display.m,v 1.14 2008/01/08 16:39:11 ingo Exp $';
0019 
0020 %% Check if this is a call for parameters
0021 if nargin == 2
0022   if isa(ao, 'ao') && ischar(varargin{1})
0023     in = char(varargin{1});
0024     if strcmp(in, 'Params')
0025       txt = plist();
0026       return
0027     elseif strcmp(in, 'Version')
0028       txt = VERSION;
0029       return
0030     end
0031   end
0032 end
0033 
0034 txt = {};
0035 
0036 for i=1:numel(ao)
0037   a = ao(i);
0038   data   = get(a, 'data');
0039   dinfo  = whos('data');
0040   hist   = get(a, 'hist');
0041   hinfo  = whos('hist');
0042 
0043   if nargin ~= length(ao)
0044     banner_start = sprintf('----------- ao %02d -----------', i);
0045   else
0046     banner_start = sprintf('----------- ao: %s -----------', inputname(i));
0047   end
0048 
0049   txt{end+1} = banner_start;
0050   txt{end+1} = ' ';
0051   txt{end+1} = sprintf('       name:  %s', get(a, 'name'));
0052   txt{end+1} = sprintf(' provenance:  %s', char(get(a, 'provenance')));
0053   txt{end+1} = sprintf('description:  %s', char(get(a, 'description')));
0054   if isa(data, 'cell')
0055     txt{end+1} = sprintf('       data:  None');
0056   else
0057     txt{end+1} = sprintf('       data:  %s / %s', dinfo.class, get(data, 'name'));
0058   end
0059   if isa(hist, 'cell')
0060     txt{end+1} = sprintf('       hist:  None');
0061   else
0062     txt{end+1} = sprintf('       hist:  %s / %s / %s', hinfo.class, get(hist, 'name'), get(hist, 'version'));
0063   end
0064   txt{end+1} = sprintf('  mfilename:  %s', a.mfilename);
0065 
0066   banner_end(1:length(banner_start)) = '-';
0067   txt{end+1} = banner_end;
0068 
0069   txt{end+1} = ' ';
0070   txt{end+1} = ' ';
0071 end
0072 
0073 if nargout == 0
0074   for ii=1:length(txt)
0075     disp(txt{ii});
0076   end
0077 end
0078 
0079 % END

Generated on Tue 22-Jan-2008 10:39:13 by m2html © 2003