Mercurial > hg > ltpda
diff m-toolbox/classes/@ltpda_uoh/setPropertyValue.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/@ltpda_uoh/setPropertyValue.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,49 @@ +% +% CALL: +% varargout = setPropertyValue(inputs, ... +% input_names, ... +% objectClass, ... +% callerIsMethod, ... +% propName, ... +% setterFcn, ... +% copy, ... +% getInfo) +% +% +function varargout = setPropertyValue(varargin) + + + % get inputs + callerIsMethod = varargin{end-4}; + propName = varargin{end-3}; + getInfo = varargin{end}; + + % Check if this is a call for parameters + if utils.helper.isinfocall(varargin{1:end-6}) + varargout{1} = getInfo(varargin{3}); + return + end + + % call super class method + [objects, values, pls, obj_invars] = setPropertyValue@ltpda_uo(varargin{:}); + + % Combine input plists and default PLIST + ii = getInfo('Default'); + pls = applyDefaults(ii.plists, pls); + + for jj = 1:numel(objects) + % Add history if needed + if ~callerIsMethod + if isempty(values) + plh = pls; + else + plh = pls.pset(propName, values{jj}); + end + objects(jj).addHistory(getInfo('None'), plh, obj_invars(jj), objects(jj).hist); + end + end + + % Set output + varargout{1} = objects; +end +% END \ No newline at end of file