Mercurial > hg > ltpda
diff m-toolbox/classes/@modelViewer/cb_selectModel.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/@modelViewer/cb_selectModel.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,45 @@ +% CB_SELECTMODEL callback fires when the user selects a model. +% +% M Hewitson +% +% $Id: cb_selectModel.m,v 1.4 2008/12/09 07:22:36 hewitson Exp $ +% +function cb_selectModel(varargin) + + myh = varargin{1}; + mainfig = varargin{end}; + + % check model type + h = findobj(mainfig.handle, 'Tag', 'ModelTypeSelect'); + mtypes = get(h, 'String'); + mtype = mtypes{get(h, 'Value')}; + + % Get selected model + val = get(myh, 'Value'); + models = get(myh, 'String'); + model = models{val}; + + % draw parameters panel for this model + switch mtype + case 'ao' + pl = feval(['ao_model_' model], 'PLIST'); +% pl = ii.plists(1); + desc = feval('help', ['ao_model_' model]) + case 'ssm' + ii = ssm.getInfo('ssm', 'From Built-in Model'); + pl = ii.plists(1); + pl.remove('built-in'); + desc = feval('help', ['ssm_model_' model]) + end + + ppan = findobj(mainfig.handle, 'Tag', 'MODELVIEWERparamspanel'); + modelViewer.buildParamsPanel(ppan, pl); + + + dtxt = findobj(mainfig.handle, 'Tag', 'MODELVIEWERmodeldescription'); + set(dtxt, 'String', desc); + set(dtxt, 'TooltipString', desc); + + +end +