Mercurial > hg > ltpda
comparison m-toolbox/classes/@ltpda_uo/setMdlfile.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 % SETMDLFILE sets the 'mdlfile' property of a ltpda_uoh object. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: SETMDLFILE sets the 'mdlfile' property of a ltpda_uoh object. | |
5 % | |
6 % CALL: objs.setMdlfile(val); | |
7 % objs.setMdlfile(val1, val2); | |
8 % objs.setMdlfile(plist('mdlfile', val)); | |
9 % objs = objs.setMdlfile(val); | |
10 % | |
11 % INPUTS: objs: Can be a vector, matrix, list, or a mix of them. | |
12 % val: | |
13 % 1. Single string e.g. 'Some text' | |
14 % Each AO in objs get this value. | |
15 % 2. Single string in a cell-array e.g. {'Some text'} | |
16 % Each AO in objs get this value. | |
17 % 3. cell-array with the same number of strings as in objs | |
18 % e.g. {'a text', 'a different text', 'another text'} | |
19 % and 3 AOs in objs. Each AO in objs get its | |
20 % corresponding value from the cell-array | |
21 % | |
22 % <a href="matlab:utils.helper.displayMethodInfo('ao', 'setMdlfile')">Parameters Description</a> | |
23 % | |
24 % VERSION: $Id: setMdlfile.m,v 1.8 2011/09/16 05:00:38 hewitson Exp $ | |
25 % | |
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
27 | |
28 function varargout = setMdlfile(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 'mdlfile', ... | |
46 [], ... | |
47 nargout, ... | |
48 @getInfo); | |
49 | |
50 % set outputs | |
51 varargout = utils.helper.setoutputs(nargout, objects); | |
52 | |
53 end | |
54 | |
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
56 % Local Functions % | |
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
58 %-------------------------------------------------------------------------- | |
59 % Get Info Object | |
60 %-------------------------------------------------------------------------- | |
61 function ii = getInfo(varargin) | |
62 | |
63 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
64 sets = {}; | |
65 pl = []; | |
66 else | |
67 sets = {'Default'}; | |
68 pl = getDefaultPlist; | |
69 end | |
70 % Build info object | |
71 ii = minfo(mfilename, mfilename('class'), 'ltpda', utils.const.categories.helper, '$Id: setMdlfile.m,v 1.8 2011/09/16 05:00:38 hewitson Exp $', sets, pl); | |
72 end | |
73 | |
74 %-------------------------------------------------------------------------- | |
75 % Get Default Plist | |
76 %-------------------------------------------------------------------------- | |
77 function plout = getDefaultPlist() | |
78 persistent pl; | |
79 if exist('pl', 'var')==0 || isempty(pl) | |
80 pl = buildplist(); | |
81 end | |
82 plout = pl; | |
83 end | |
84 | |
85 function pl = buildplist() | |
86 pl = plist({'mdlfile', 'The contents of a pipeline to attach.'}, paramValue.EMPTY_STRING); | |
87 end |