DISPLAY implement terminal display for history object. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: DISPLAY implement terminal display for history object. CALL: txt = display(history) INPUT: history - history object OUTPUT: txt - cell array with strings to display the history object M-FILE INFO: Get information about this methods by calling >> history.getInfo('display') Get information about a specified set-plist by calling: >> history.getInfo('display', 'set') VERSION: $Id: display.m,v 1.16 2008/09/04 15:29:30 ingo Exp $ HISTORY: 30-01-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % DISPLAY implement terminal display for history object. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: DISPLAY implement terminal display for history object. 0005 % 0006 % CALL: txt = display(history) 0007 % 0008 % INPUT: history - history object 0009 % 0010 % OUTPUT: txt - cell array with strings to display the history object 0011 % 0012 % M-FILE INFO: Get information about this methods by calling 0013 % >> history.getInfo('display') 0014 % 0015 % Get information about a specified set-plist by calling: 0016 % >> history.getInfo('display', 'set') 0017 % 0018 % VERSION: $Id: display.m,v 1.16 2008/09/04 15:29:30 ingo Exp $ 0019 % 0020 % HISTORY: 30-01-2007 M Hewitson 0021 % Creation 0022 % 0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0024 0025 function varargout = display(varargin) 0026 0027 %%% Check if this is a call for parameters 0028 if utils.helper.isinfocall(varargin{:}) 0029 varargout{1} = getInfo(varargin{3}); 0030 return 0031 end 0032 0033 hists = utils.helper.collect_objects(varargin(:), 'history'); 0034 0035 txt = utils.helper.objdisp(hists); 0036 0037 if nargout == 0 0038 for ii=1:length(txt) 0039 disp(txt{ii}); 0040 end 0041 end 0042 0043 varargout{1} = txt; 0044 end 0045 0046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0047 % Local Functions % 0048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0049 0050 function new_txt = single_cell(txt_field) 0051 0052 new_txt = {}; 0053 for ii=1:length(txt_field) 0054 if iscell(txt_field{ii}) 0055 hh = single_cell(txt_field{ii}); 0056 new_txt(end+1:end+length(hh)) = hh(1:end); 0057 else 0058 new_txt{end+1} = txt_field{ii}; 0059 end 0060 end 0061 end 0062 0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0064 % 0065 % FUNCTION: getInfo 0066 % 0067 % DESCRIPTION: Get Info Object 0068 % 0069 % HISTORY: 11-07-07 M Hewitson 0070 % Creation. 0071 % 0072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0073 0074 function ii = getInfo(varargin) 0075 if nargin == 1 && strcmpi(varargin{1}, 'None') 0076 sets = {}; 0077 pl = []; 0078 else 0079 sets = {'Default'}; 0080 pl = getDefaultPlist; 0081 end 0082 % Build info object 0083 ii = minfo(mfilename, 'history', '', utils.const.categories.output, '$Id: display.m,v 1.16 2008/09/04 15:29:30 ingo Exp $', sets, pl); 0084 end 0085 0086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0087 % 0088 % FUNCTION: getDefaultPlist 0089 % 0090 % DESCRIPTION: Get Default Plist 0091 % 0092 % HISTORY: 11-07-07 M Hewitson 0093 % Creation. 0094 % 0095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0096 0097 function plo = getDefaultPlist() 0098 plo = plist(); 0099 end 0100