Home > classes > @ao > display.m

display

PURPOSE ^

DISPLAY implement terminal display for analysis object.

SYNOPSIS ^

function varargout = display(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

 M-FILE INFO: Get information about this methods by calling
              >> ao.getInfo('display')

              Get information about a specified set-plist by calling:
              >> ao.getInfo('display', 'None')

 VERSION:     $Id: display.m,v 1.30 2008/09/05 11:05:29 ingo Exp $

 HISTORY:     31-01-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % DISPLAY implement terminal display for analysis object.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: DISPLAY implement terminal display for analysis object.
0005 %
0006 % CALL:        txt = display(ao)
0007 %              ao                     % without a semicolon
0008 %
0009 % M-FILE INFO: Get information about this methods by calling
0010 %              >> ao.getInfo('display')
0011 %
0012 %              Get information about a specified set-plist by calling:
0013 %              >> ao.getInfo('display', 'None')
0014 %
0015 % VERSION:     $Id: display.m,v 1.30 2008/09/05 11:05:29 ingo Exp $
0016 %
0017 % HISTORY:     31-01-2007 M Hewitson
0018 %                 Creation
0019 %
0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0021 
0022 function varargout = display(varargin)
0023 
0024   % Check if this is a call for parameters
0025   if utils.helper.isinfocall(varargin{:})
0026     varargout{1} = getInfo(varargin{3});
0027     return
0028   end
0029 
0030   import utils.const.*
0031   utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename);
0032   
0033   % Collect input variable names
0034   in_names = cell(size(varargin));
0035   for ii = 1:nargin,in_names{ii} = inputname(ii);end
0036 
0037   % Collect all AOs
0038   [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names);
0039 
0040   % Loop over AOs
0041   txt = {};
0042   for j=1:numel(as)
0043     banner_start = sprintf('----------- ao: %s -----------', ao_invars{j});
0044 
0045     txt{end+1} = banner_start;
0046     txt{end+1} = ' ';
0047     txt{end+1} = sprintf('       name:  %s', as(j).name);
0048     txt{end+1} = sprintf('    creator:  %s', char(as(j).creator));
0049     txt{end+1} = sprintf('description:  %s', char(as(j).description));
0050     if isempty(as(j).data)
0051       txt{end+1} = sprintf('       data:  None');
0052     else
0053       mi = min(5, numel(as(j).data.y));
0054       dtxt = sprintf('       data:');
0055       if ~isa(as(j).data, 'cdata')
0056         for k=1:mi
0057           dtxt = [dtxt sprintf(' (%s,%s)', mat2str(as(j).data.getX(k)), mat2str(as(j).data.y(k)))];
0058         end
0059         if mi < length(as(j).data.y)
0060           dtxt = [dtxt ' ...'];
0061         end
0062       else
0063         dtxt = [dtxt sprintf(' %s', mat2str(as(j).data.getY))];
0064         if length(dtxt) > 44
0065           dtxt = [dtxt(1:44) '...'];
0066         end
0067       end
0068       txt{end+1} = dtxt;
0069 
0070       % Add some data info
0071       w = display(as(j).data);
0072       for k=1:numel(w)
0073         txt{end+1} =  sprintf('             %s', w{k});
0074       end
0075     end
0076     if isempty(as(j).hist)
0077       txt{end+1} = sprintf('       hist:  None');
0078     else
0079       info = as(j).hist.methodInfo;
0080       txt{end+1} = sprintf('       hist:  %s / %s / %s', info.mclass, info.mname, info.mversion);
0081     end
0082     txt{end+1} = sprintf('  mfilename:  %s', as(j).mfilename);
0083     txt{end+1} = sprintf('mdlfilename:  %s', as(j).mdlfilename);
0084 
0085     banner_end(1:length(banner_start)) = '-';
0086     txt{end+1} = banner_end;
0087 
0088     txt{end+1} = ' ';
0089     txt{end+1} = ' ';
0090   end
0091 
0092   if nargout == 0
0093     for ii=1:length(txt)
0094       disp(txt{ii});
0095     end
0096   else
0097     varargout{1} = txt;
0098   end
0099 end
0100 
0101 %--------------------------------------------------------------------------
0102 % Get Info Object
0103 %--------------------------------------------------------------------------
0104 function ii = getInfo(varargin)
0105   if nargin == 1 && strcmpi(varargin{1}, 'None')
0106     sets = {};
0107     pl   = [];
0108   else
0109     sets = {'Default'};
0110     pl   = getDefaultPlist;
0111   end
0112   % Build info object
0113   ii = minfo(mfilename, 'ao', '', utils.const.categories.output, '$Id: display.m,v 1.30 2008/09/05 11:05:29 ingo Exp $', sets, pl);
0114 end
0115 
0116 %--------------------------------------------------------------------------
0117 % Get Default Plist
0118 %--------------------------------------------------------------------------
0119 function pl = getDefaultPlist()
0120   pl = plist();
0121 end
0122 
0123

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003