Mercurial > hg > ltpda
diff m-toolbox/classes/@LTPDAworkbench/cb_blockdoc.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@LTPDAworkbench/cb_blockdoc.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,43 @@ +% CB_BLOCKDOC gets documentation for the selected block +% +% CALL: LTPDAworkbench.cb_blockdoc +% +% M Hewitson 25-01-09 +% +% $Id: cb_blockdoc.m,v 1.4 2010/08/06 19:10:48 ingo Exp $ +% + +function cb_blockdoc(varargin) + + wb = varargin{1}; + + % Get all selected blocks + sbs = awtinvoke(wb.mp, 'getSelectedBlocks'); + if sbs.size() > 0 + block = sbs.get(0); + + cl = char(block.getMinfo.getMclass); + algo = char(block.getAlgo); + + % workaround for abstract classes because the help for these classes + % are hidden. + if strcmpi(cl, 'ltpda_uo') + cl = 'plist'; + elseif strcmpi(cl, 'ltpda_uoh') + cl = 'ao'; + elseif strcmpi(cl, 'ltpda_tf') + cl = 'pzmodel'; + elseif strcmpi(cl, 'ltpda_filter') + cl = 'miir'; + end + + if ~strcmp(cl, algo) + cmd = ['doc ' cl '/' algo]; + else + cmd = ['doc ' algo]; + end + eval(cmd) + + end + +end