comparison m-toolbox/classes/@matrix/fromInput.m @ 43:bc767aaa99a8

CVS Update
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 11:09:25 +0100
parents f0afece42f48
children
comparison
equal deleted inserted replaced
0:f0afece42f48 43:bc767aaa99a8
5 % 5 %
6 % DESCRIPTION: Construct a matrix object from ltpda_uoh objects. 6 % DESCRIPTION: Construct a matrix object from ltpda_uoh objects.
7 % 7 %
8 % CALL: matrix = matrix.fromInput(inobjs) 8 % CALL: matrix = matrix.fromInput(inobjs)
9 % 9 %
10 % VERSION: $Id: fromInput.m,v 1.9 2011/02/14 13:20:24 ingo Exp $ 10 % VERSION: $Id: fromInput.m,v 1.10 2011/12/05 07:40:23 hewitson Exp $
11 % 11 %
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 function obj = fromInput(obj, pli, callerIsMethod) 13 function obj = fromInput(obj, pli, callerIsMethod)
14
15 VERSION = '$Id: fromInput.m,v 1.10 2011/12/05 07:40:23 hewitson Exp $';
14 16
15 import utils.const.* 17 import utils.const.*
16 18
17 if callerIsMethod 19 if callerIsMethod
18 % do nothing 20 % do nothing
19 pl = pli;
20 else 21 else
21 utils.helper.msg(msg.OPROC1, 'Construct from inputs'); 22 % get AO info
22 pl = combine(pli, matrix.getDefaultPlist('From Input')); 23 ii = matrix.getInfo('matrix', 'From Input');
24
25 % Set the method version string in the minfo object
26 ii.setMversion([VERSION '-->' ii.mversion]);
23 end 27 end
28
29 % Combine input plist with default values
30 if callerIsMethod
31 pl = pli;
32 else
33 % Combine input plist with default values
34 % TODO: the parse step should be removed and included somehow into plist/applyDefaults
35 pl = applyDefaults(ii.plists, pli);
36 end
37
24 shape = pl.find('shape'); 38 shape = pl.find('shape');
25 objs = pl.find('objs'); 39 objs = pl.find('objs');
26 40
27 if iscell(objs) 41 if iscell(objs)
28 [inobjs, ao_invars, rest] = utils.helper.collect_objects(objs(:), ''); 42 [inobjs, ao_invars, rest] = utils.helper.collect_objects(objs(:), '');
51 inhists = []; 65 inhists = [];
52 if ~isempty(inobjs) 66 if ~isempty(inobjs)
53 inhists = [inobjs(:).hist]; 67 inhists = [inobjs(:).hist];
54 end 68 end
55 obj.addHistory(matrix.getInfo('matrix', 'None'), pl, [], inhists); 69 obj.addHistory(matrix.getInfo('matrix', 'None'), pl, [], inhists);
56 warning('off', utils.const.warnings.METHOD_NOT_FOUND); 70
57 % remove parameters we already used 71 % Set any remaining object properties which exist in the default plist
58 pl_set = copy(pl,1); 72 obj.setObjectProperties(pl);
59 if pl_set.isparam('objs')
60 pl_set.remove('objs');
61 end
62 if pl_set.isparam('shape')
63 pl_set.remove('shape');
64 end
65 obj.setProperties(pl_set);
66 warning('on', utils.const.warnings.METHOD_NOT_FOUND);
67 end 73 end
68 74
69 end 75 end