Mercurial > hg > ltpda
comparison m-toolbox/classes/@mfir/setGd.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 % SETGD Set the property 'gd' | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: SETGD Set the property 'gd' | |
5 % | |
6 % CALL: obj = obj.setGd(12); | |
7 % obj = setGd(obj, 12); | |
8 % | |
9 % INPUTS: obj - is a mfir object | |
10 % | |
11 % <a href="matlab:utils.helper.displayMethodInfo('mfir', 'setGd')">Parameters Description</a> | |
12 % | |
13 % VERSION: $Id: setGd.m,v 1.6 2011/04/08 08:56:20 hewitson Exp $ | |
14 % | |
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
16 | |
17 function varargout = setGd(varargin) | |
18 | |
19 %%% Check if this is a call for parameters | |
20 if utils.helper.isinfocall(varargin{:}) | |
21 varargout{1} = getInfo(varargin{3}); | |
22 return | |
23 end | |
24 | |
25 % Check if this is a call from a class method | |
26 callerIsMethod = utils.helper.callerIsMethod; | |
27 | |
28 obj = varargin{1}; | |
29 val = varargin{2}; | |
30 | |
31 %%% If val is a plist-object then get the value out of the plist | |
32 if isa(val, 'plist') | |
33 val = find(val, 'gd'); | |
34 end | |
35 | |
36 %%% decide whether we modify the mfir-object, or create a new one. | |
37 obj = copy(obj, nargout); | |
38 | |
39 %%% set 'gd' | |
40 obj.gd = val; | |
41 | |
42 if ~callerIsMethod | |
43 obj.addHistory(getInfo('None'), plist('gd', val), '', obj.hist); | |
44 end | |
45 | |
46 varargout{1} = obj; | |
47 end | |
48 | |
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
50 % Local Functions % | |
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
52 | |
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
54 % | |
55 % FUNCTION: getInfo | |
56 % | |
57 % DESCRIPTION: Get Info Object | |
58 % | |
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
60 | |
61 function ii = getInfo(varargin) | |
62 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
63 sets = {}; | |
64 pl = []; | |
65 else | |
66 sets = {'Default'}; | |
67 pl = getDefaultPlist; | |
68 end | |
69 % Build info object | |
70 ii = minfo(mfilename, 'mfir', 'ltpda', utils.const.categories.helper, '$Id: setGd.m,v 1.6 2011/04/08 08:56:20 hewitson Exp $', sets, pl); | |
71 end | |
72 | |
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
74 % | |
75 % FUNCTION: getDefaultPlist | |
76 % | |
77 % DESCRIPTION: Get Default Plist | |
78 % | |
79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
80 | |
81 function plout = getDefaultPlist() | |
82 persistent pl; | |
83 if exist('pl', 'var')==0 || isempty(pl) | |
84 pl = buildplist(); | |
85 end | |
86 plout = pl; | |
87 end | |
88 | |
89 function pl = buildplist() | |
90 pl = plist({'gd', ''}, paramValue.EMPTY_DOUBLE); | |
91 end | |
92 |