view m-toolbox/classes/@ltpda_data/fromStruct.m @ 17:7afc99ec5f04
database-connection-manager
Update ao_model_retrieve_in_timespan
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − % FROMSTRUCT sets all properties which are defined in the ltpda_data class from the structure to the input object.
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − %
+ − % FUNCTION: fromStruct
+ − %
+ − % DESCRIPTION: Sets all properties which are defined in the ltpda_data class
+ − % from the structure to the input object.
+ − %
+ − % REMARK: Abstract classes handle only one input object and a
+ − % structure with the size 1.
+ − %
+ − % CALL: obj = fromStruct(obj, struct)
+ − %
+ − % VERSION: $Id: fromStruct.m,v 1.2 2011/02/14 19:25:14 ingo Exp $
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ − function obj = fromStruct(obj, obj_struct)
+ −
+ − % Call super-class
+ − obj = fromStruct@ltpda_nuo(obj, obj_struct);
+ −
+ − % Set 'yunits' object
+ − if isfield(obj_struct, 'yunits')
+ − obj.yunits = utils.helper.getObjectFromStruct(obj_struct.yunits);
+ − end
+ −
+ − % Set 'y' object
+ − if isfield(obj_struct, 'y')
+ − obj.y = obj_struct.y;
+ − end
+ −
+ − % Set 'dy' object
+ − if isfield(obj_struct, 'dy')
+ − obj.dy = obj_struct.dy;
+ − end
+ −
+ − end