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.11 2007/10/23 16:30:44 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.11 2007/10/23 16:30:44 ingo Exp $
0012 %
0013 % HISTORY:     31-01-2007 M Hewitson
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION = '$Id: display.m,v 1.11 2007/10/23 16:30:44 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 ao  = reshape(ao, numel(ao), 1);
0037 
0038 for i=1:length(ao)
0039   a = ao(i);
0040   data   = get(a, 'data');
0041   dinfo  = whos('data');
0042   hist   = get(a, 'hist');
0043   hinfo  = whos('hist');
0044 
0045   if nargin ~= length(ao)
0046     banner_start = sprintf('----------- ao %02d -----------', i);
0047   else
0048     banner_start = sprintf('----------- ao: %s -----------', inputname(i));
0049   end
0050 
0051   txt{end+1} = banner_start;
0052   txt{end+1} = ' ';
0053   txt{end+1} = sprintf('       tag:  %06d', get(a, 'tag'));
0054   txt{end+1} = sprintf('      name:  %s', get(a, 'name'));
0055   txt{end+1} = sprintf('provenance:  %s', char(get(a, 'provenance')));
0056   txt{end+1} = sprintf('   comment:  %s', char(get(a, 'comment')));
0057   if isa(data, 'cell')
0058     txt{end+1} = sprintf('      data:  None');
0059   else
0060     txt{end+1} = sprintf('      data:  %s / %s', dinfo.class, get(data, 'name'));
0061   end
0062   if isa(hist, 'cell')
0063     txt{end+1} = sprintf('      hist:  None');
0064   else
0065     txt{end+1} = sprintf('      hist:  %s / %s / %s', hinfo.class, get(hist, 'name'), get(hist, 'version'));
0066   end
0067   txt{end+1} = sprintf('     mfile:  %s', a.mfilename);
0068 
0069   banner_end(1:length(banner_start)) = '-';
0070   txt{end+1} = banner_end;
0071 
0072   txt{end+1} = ' ';
0073   txt{end+1} = ' ';
0074 end
0075 
0076 if nargout == 0
0077   for ii=1:length(txt)
0078     disp(txt{ii});
0079   end
0080 end
0081 
0082 % END

Generated on Fri 02-Nov-2007 19:39:27 by m2html © 2003