view m-toolbox/classes/@ltpda_uoh/fromModel.m @ 27:29276498ebdb database-connection-manager

Remove LTPDARepositoryManager implementation * * * Remove GUI helper
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children bc767aaa99a8
line wrap: on
line source

% FROMMODEL Construct an a built in model
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% FUNCTION:    fromModel
%
% DESCRIPTION: Construct an ltpda uder objects with history from a
%              built-in model
%
% CALL:        a = fromModel(a, pl)
%
% PARAMETER:   pl: Parameter list object
%
% VERSION:     $Id: fromModel.m,v 1.13 2011/08/15 12:59:04 hewitson Exp $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function obj = fromModel(obj, pl)

  [obj, ii, fcnname] = fromModel@ltpda_uo(obj, pl);
  % Add history
  try 
    feval(fcnname, 'info');
  catch
    % if the model doesn't respond to an 'info' call, then it is an old
    % style model and we need to add history.
    obj.addHistory(ii, pl, [], []);
  end
  
  % Set object properties
  obj.setObjectProperties(pl);
  
end