Mercurial > hg > ltpda
view m-toolbox/classes/@ssm/modelHelper_introScript.m @ 42:f90d4f666cc7 database-connection-manager
Cleanup
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 18:04:34 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
% header script for all ssm models %% minfo call if utils.helper.isinfocall(varargin{:}) varargout{1} = getInfo(varargin{3}); doNothing = true; else doNothing = false; if nargin==2 if isa(varargin{1}, 'plist') && isa(varargin{2}, 'minfo') %% constructor call minfo_in = varargin{2}; pl = varargin{1}; if pl.isparam('set') plDefault = getDefaultPlist(pl.find('set')); else plDefault = getDefaultPlist; end if ~pl.isparam('param names') setNames = {}; setValues = []; removePlParam = {}; for k=1:pl.nparams loc_key = pl.params(k).key; if ~plDefault.isparam( loc_key ) if ~strcmpi(loc_key, 'set') loc_value = pl.params(k).getVal; if ~isa(loc_value, 'double') || numel(loc_value)~=1 warning(['### the ssm constructor tried to set the parameter ' loc_key ' as a numerical (double) physical parameter '... ' because it is not in the default plist of this model. ' ... 'However it could not be done for the class "' class(loc_value) '" and the size [' num2str(size(loc_value)) ']. '... 'Please remove this parameter from your user plist, if you do not use it.']) else setNames = [setNames loc_key]; %#ok<AGROW> setValues = [setValues loc_value]; %#ok<AGROW> removePlParam = [removePlParam loc_key ]; %#ok<AGROW> end end end end pl.removeKeys(removePlParam); pl.combine(plist('param names', setNames, 'symbolic params', setNames, 'param values', setValues)); end pl = combine(varargin{1}, minfo_in.plists, plDefault); varargout{2} = pl; elseif isa(varargin{1}, 'char') && isa(varargin{2}, 'plist') %% description only request error('description call is deprecated') else error([mfilename ' needs one input argument of class plist and one minfo, but instead input argument was : ' class(varargin{1}) ' and ' class(varargin{2})]) end else error([mfilename ' needs two input arguments instead of ' num2str(numel(varargin))]) end end