Mercurial > hg > ltpda
diff m-toolbox/classes/@ltpda_uoh/fromModel.m @ 43:bc767aaa99a8
CVS Update
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Tue, 06 Dec 2011 11:09:25 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line diff
--- a/m-toolbox/classes/@ltpda_uoh/fromModel.m Wed Nov 23 19:22:13 2011 +0100 +++ b/m-toolbox/classes/@ltpda_uoh/fromModel.m Tue Dec 06 11:09:25 2011 +0100 @@ -10,13 +10,13 @@ % % PARAMETER: pl: Parameter list object % -% VERSION: $Id: fromModel.m,v 1.13 2011/08/15 12:59:04 hewitson Exp $ +% VERSION: $Id: fromModel.m,v 1.14 2011/12/02 09:05:15 hewitson Exp $ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function obj = fromModel(obj, pl) - [obj, ii, fcnname] = fromModel@ltpda_uo(obj, pl); + [obj, ii, fcnname, pl] = fromModel@ltpda_uo(obj, pl); % Add history try feval(fcnname, 'info'); @@ -26,6 +26,20 @@ obj.addHistory(ii, pl, [], []); end + % Here we make a check on the default plist keys because these properties + % may have been set in the model. We make the assumption that if they are + % empty, the user had no intention of setting them so we can remove them + % and keep the value set in the model. + if isempty(pl.find('name')) + pl.remove('name'); + end + if isempty(pl.find('description')) + pl.remove('description'); + end + if isempty(pl.find('plotinfo')) + pl.remove('plotinfo'); + end + % Set object properties obj.setObjectProperties(pl);