DISPLAY implement terminal display for cdata object. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: DISPLAY implement terminal display for cdata object. M-FILE INFO: Get information about this methods by calling >> cdata.getInfo('display') Get information about a specified set-plist by calling: >> cdata.getInfo('display', 'None') VERSION: $Id: display.m,v 1.14 2008/09/05 14:17:51 hewitson Exp $ HISTORY: 31-01-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % DISPLAY implement terminal display for cdata object. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: DISPLAY implement terminal display for cdata object. 0005 % 0006 % M-FILE INFO: Get information about this methods by calling 0007 % >> cdata.getInfo('display') 0008 % 0009 % Get information about a specified set-plist by calling: 0010 % >> cdata.getInfo('display', 'None') 0011 % 0012 % VERSION: $Id: display.m,v 1.14 2008/09/05 14:17:51 hewitson Exp $ 0013 % 0014 % HISTORY: 31-01-2007 M Hewitson 0015 % Creation 0016 % 0017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0018 0019 function varargout = display(varargin) 0020 0021 %%% Check if this is a call for parameters 0022 if utils.helper.isinfocall(varargin{:}) 0023 varargout{1} = getInfo(varargin{3}); 0024 return 0025 end 0026 0027 cdatas = utils.helper.collect_objects(varargin(:), 'cdata'); 0028 0029 txt = {}; 0030 0031 for i=1:numel(cdatas) 0032 banner = sprintf('-------- cdata %02d ------------', i); 0033 txt{end+1} = banner; 0034 0035 y = cdatas(i).y; 0036 yinfo = whos('y'); 0037 0038 txt{end+1} = sprintf(' y: [%dx%d], %s', yinfo.size(1), yinfo.size(2), yinfo.class); 0039 txt{end+1} = sprintf('yunits: %s', char(cdatas(i).yunits)); 0040 0041 banner_end(1:length(banner)) = '-'; 0042 txt{end+1} = banner_end; 0043 0044 txt{end+1} = ' '; 0045 end 0046 0047 if nargout == 0 0048 for ii=1:length(txt) 0049 disp(txt{ii}); 0050 end 0051 end 0052 0053 varargout{1} = txt; 0054 end 0055 0056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0057 % Local Functions % 0058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0059 0060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0061 % 0062 % FUNCTION: getInfo 0063 % 0064 % DESCRIPTION: Get Info Object 0065 % 0066 % HISTORY: 11-07-07 M Hewitson 0067 % Creation. 0068 % 0069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0070 0071 function ii = getInfo(varargin) 0072 if nargin == 1 && strcmpi(varargin{1}, 'None') 0073 sets = {}; 0074 pl = []; 0075 else 0076 sets = {'Default'}; 0077 pl = getDefaultPlist; 0078 end 0079 % Build info object 0080 ii = minfo(mfilename, 'cdata', '', utils.const.categories.output, '$Id: display.m,v 1.14 2008/09/05 14:17:51 hewitson Exp $', sets, pl); 0081 end 0082 0083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0084 % 0085 % FUNCTION: getDefaultPlist 0086 % 0087 % DESCRIPTION: Get Default Plist 0088 % 0089 % HISTORY: 11-07-07 M Hewitson 0090 % Creation. 0091 % 0092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0093 0094 function plo = getDefaultPlist() 0095 plo = plist(); 0096 end 0097