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.28 2008/08/08 12:29:17 hewitson 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.28 2008/08/08 12:29:17 hewitson 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,length(as(j).data.y));
0054       dtxt = sprintf('       data:');
0055       for k=1:mi
0056         if length(as(j).data.getX) == length(as(j).data.y)
0057           if isa(as(j).data, 'cdata')
0058             dtxt = [dtxt sprintf(' (%s,%s)', char(as(j).data.getX(k)), mat2str(as(j).data.y(k)))];
0059           else
0060             dtxt = [dtxt sprintf(' (%s,%s)', mat2str(as(j).data.getX(k)), mat2str(as(j).data.y(k)))];
0061           end
0062         else
0063           dtxt = [dtxt sprintf(' %s', mat2str(as(j).data.y(k)))];
0064         end
0065       end
0066       if mi < length(as(j).data.y)
0067         dtxt = [dtxt ' ...'];
0068       end
0069       txt{end+1} = dtxt;
0070 
0071       % Add some data info
0072       w = display(as(j).data);
0073       for k=1:numel(w)
0074         txt{end+1} =  sprintf('             %s', w{k});
0075       end
0076     end
0077     if isempty(as(j).hist)
0078       txt{end+1} = sprintf('       hist:  None');
0079     else
0080       info = as(j).hist.methodInfo;
0081       txt{end+1} = sprintf('       hist:  %s / %s / %s', info.mclass, info.mname, info.mversion);
0082     end
0083     txt{end+1} = sprintf('  mfilename:  %s', as(j).mfilename);
0084     txt{end+1} = sprintf('mdlfilename:  %s', as(j).mdlfilename);
0085 
0086     banner_end(1:length(banner_start)) = '-';
0087     txt{end+1} = banner_end;
0088 
0089     txt{end+1} = ' ';
0090     txt{end+1} = ' ';
0091   end
0092 
0093   if nargout == 0
0094     for ii=1:length(txt)
0095       disp(txt{ii});
0096     end
0097   else
0098     varargout{1} = txt;
0099   end
0100 end
0101 
0102 %--------------------------------------------------------------------------
0103 % Get Info Object
0104 %--------------------------------------------------------------------------
0105 function ii = getInfo(varargin)
0106   if nargin == 1 && strcmpi(varargin{1}, 'None')
0107     sets = {};
0108     pl   = [];
0109   else
0110     sets = {'Default'};
0111     pl   = getDefaultPlist;
0112   end
0113   % Build info object
0114   ii = minfo(mfilename, 'ao', '', 'Output', '$Id: display.m,v 1.28 2008/08/08 12:29:17 hewitson Exp $', sets, pl);
0115 end
0116 
0117 %--------------------------------------------------------------------------
0118 % Get Default Plist
0119 %--------------------------------------------------------------------------
0120 function pl = getDefaultPlist()
0121   pl = plist();
0122 end
0123 
0124

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003