Mercurial > hg > ltpda
comparison m-toolbox/classes/@ltpda_uoh/setProcinfo.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % SETPROCINFO sets the 'procinfo' property of a ltpda_uoh object. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: SETPROCINFO sets the 'procinfo' property of a ltpda_uoh object. | |
5 % | |
6 % CALL: objs.setProcinfo(val); | |
7 % objs.setProcinfo(val1, val2); | |
8 % objs.setProcinfo(plist('procinfo', val)); | |
9 % objs = objs.setProcinfo(val); | |
10 % | |
11 % INPUTS: objs: Any shape of ltpda_uoh objects | |
12 % val: | |
13 % 1. Single PLIST e.g. | |
14 % Each object in objs get this value. | |
15 % 2. Single PLIST in a cell-array | |
16 % Each objects in objs get this value. | |
17 % 3. cell-array with the same number of PLISTSs as in objs | |
18 % e.g. {pl1, pl2, pl3} and 3 objects in objs | |
19 % Each object in objs get its corresponding value from the | |
20 % cell-array | |
21 % | |
22 % <a href="matlab:utils.helper.displayMethodInfo('ltpda_uoh', 'setProcinfo')">Parameters Description</a> | |
23 % | |
24 % VERSION: $Id: setProcinfo.m,v 1.13 2011/09/17 03:25:37 hewitson Exp $ | |
25 % | |
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
27 | |
28 function varargout = setProcinfo(varargin) | |
29 | |
30 % Check if this is a call from a class method | |
31 callerIsMethod = utils.helper.callerIsMethod; | |
32 | |
33 if callerIsMethod | |
34 in_names = {}; | |
35 else | |
36 % Collect input variable names | |
37 in_names = cell(size(varargin)); | |
38 for ii = 1:nargin,in_names{ii} = inputname(ii);end | |
39 end | |
40 | |
41 objects = setPropertyValue(... | |
42 varargin{:}, ... | |
43 in_names, ... | |
44 callerIsMethod, ... | |
45 'procinfo', ... | |
46 @setterFcn, ... | |
47 nargout, ... | |
48 @getInfo); | |
49 | |
50 % set outputs | |
51 varargout = utils.helper.setoutputs(nargout, objects); | |
52 | |
53 end | |
54 | |
55 % Setter function to set the plotinfo | |
56 function value = setterFcn(varargin) | |
57 | |
58 obj = varargin{1}; | |
59 pls = varargin{2}; | |
60 if nargin == 2 | |
61 value = copy(pls,1); | |
62 pls.remove(1:pls.nparams); | |
63 end | |
64 if nargin == 3 | |
65 value = varargin{3}; | |
66 end | |
67 | |
68 obj.procinfo = value; | |
69 | |
70 end | |
71 | |
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
73 % Local Functions % | |
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
75 %-------------------------------------------------------------------------- | |
76 % Get Info Object | |
77 %-------------------------------------------------------------------------- | |
78 function ii = getInfo(varargin) | |
79 | |
80 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
81 sets = {}; | |
82 pl = []; | |
83 else | |
84 sets = {'Default'}; | |
85 pl = getDefaultPlist; | |
86 end | |
87 % Build info object | |
88 ii = minfo(mfilename, mfilename('class'), 'ltpda', utils.const.categories.helper, '$Id: setProcinfo.m,v 1.13 2011/09/17 03:25:37 hewitson Exp $', sets, pl); | |
89 end | |
90 | |
91 %-------------------------------------------------------------------------- | |
92 % Get Default Plist | |
93 %-------------------------------------------------------------------------- | |
94 function plout = getDefaultPlist() | |
95 persistent pl; | |
96 if ~exist('pl', 'var') || isempty(pl) | |
97 pl = buildplist(); | |
98 end | |
99 plout = pl; | |
100 end | |
101 | |
102 function pl = buildplist() | |
103 pl = plist({'procinfo', 'A plist with additional information of an object.'}, {1, {plist}, paramValue.OPTIONAL}); | |
104 end |