Mercurial > hg > ltpda
comparison m-toolbox/classes/@filterbank/display.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % DISPLAY overloads display functionality for filterbank objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: DISPLAY overloads display functionality for filterbank objects. | |
5 % | |
6 % CALL: txt = display(filterbank) | |
7 % | |
8 % INPUT: filterbank - filterbank object | |
9 % | |
10 % OUTPUT: txt - cell array with strings to display the model object | |
11 % | |
12 % <a href="matlab:utils.helper.displayMethodInfo('filterbank', 'display')">Parameters Description</a> | |
13 % | |
14 % VERSION: $Id: display.m,v 1.11 2011/04/08 08:56:20 hewitson Exp $ | |
15 % | |
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
17 | |
18 function varargout = display(varargin) | |
19 | |
20 %%% Check if this is a call for parameters | |
21 if utils.helper.isinfocall(varargin{:}) | |
22 varargout{1} = getInfo(varargin{3}); | |
23 return | |
24 end | |
25 | |
26 objs = utils.helper.collect_objects(varargin(:), 'filterbank'); | |
27 | |
28 txt = {}; | |
29 | |
30 % Print emtpy object | |
31 if isempty(objs) | |
32 hdr = sprintf('------ %s -------', class(objs)); | |
33 ftr(1:length(hdr)) = '-'; | |
34 txt = [txt; {hdr}]; | |
35 txt = [txt; sprintf('empty-object [%d,%d]',size(objs))]; | |
36 txt = [txt; {ftr}]; | |
37 end | |
38 | |
39 for i=1:numel(objs) | |
40 banner = sprintf('---- filterbank %d ----', i); | |
41 txt{end+1} = banner; | |
42 | |
43 % get key and value | |
44 name = objs(i).name; | |
45 | |
46 % display | |
47 txt{end+1} = [' name: ' name]; | |
48 txt{end+1} = [' type: ' objs(i).type]; | |
49 for kk=1:numel(objs(i).filters) | |
50 txt{end+1} = [sprintf(' %02d: ', kk) char(objs(i).filters(kk))]; | |
51 end | |
52 | |
53 txt{end+1} = ['description: ' objs(i).description]; | |
54 txt{end+1} = [' UUID: ' objs(i).UUID]; | |
55 banner_end(1:length(banner)) = '-'; | |
56 txt{end+1} = banner_end; | |
57 end | |
58 | |
59 | |
60 if nargout == 0 | |
61 for ii=1:length(txt) | |
62 disp(txt{ii}); | |
63 end | |
64 else | |
65 varargout{1} = txt; | |
66 end | |
67 | |
68 end | |
69 | |
70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
71 % Local Functions % | |
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
73 | |
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
75 % | |
76 % FUNCTION: getInfo | |
77 % | |
78 % DESCRIPTION: Get Info Object | |
79 % | |
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
81 | |
82 function ii = getInfo(varargin) | |
83 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
84 sets = {}; | |
85 pl = []; | |
86 else | |
87 sets = {'Default'}; | |
88 pl = getDefaultPlist; | |
89 end | |
90 % Build info object | |
91 ii = minfo(mfilename, 'filterbank', 'ltpda', utils.const.categories.output, '$Id: display.m,v 1.11 2011/04/08 08:56:20 hewitson Exp $', sets, pl); | |
92 ii.setModifier(false); | |
93 ii.setOutmin(0); | |
94 end | |
95 | |
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
97 % | |
98 % FUNCTION: getDefaultPlist | |
99 % | |
100 % DESCRIPTION: Get Default Plist | |
101 % | |
102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
103 | |
104 function plout = getDefaultPlist() | |
105 persistent pl; | |
106 if exist('pl', 'var')==0 || isempty(pl) | |
107 pl = buildplist(); | |
108 end | |
109 plout = pl; | |
110 end | |
111 | |
112 function pl = buildplist() | |
113 pl = plist.EMPTY_PLIST; | |
114 end | |
115 |