


SETFS sets the 'fs' property of the ao.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: SETFS sets the 'fs' property of the ao.
CALL: obj = obj.setFs(val)
obj = obj.setFs(plist('fs', 123);
M-FILE INFO: Get information about this methods by calling
>> ao.getInfo('setFs')
Get information about a specified set-plist by calling:
>> ao.getInfo('setFs', 'None')
VERSION: $Id: setFs.m,v 1.6 2008/09/05 11:05:29 ingo Exp $
HISTORY: 31-01-2007 M Hewitson
Creation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


0001 % SETFS sets the 'fs' property of the ao. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: SETFS sets the 'fs' property of the ao. 0005 % 0006 % CALL: obj = obj.setFs(val) 0007 % obj = obj.setFs(plist('fs', 123); 0008 % 0009 % M-FILE INFO: Get information about this methods by calling 0010 % >> ao.getInfo('setFs') 0011 % 0012 % Get information about a specified set-plist by calling: 0013 % >> ao.getInfo('setFs', 'None') 0014 % 0015 % VERSION: $Id: setFs.m,v 1.6 2008/09/05 11:05:29 ingo Exp $ 0016 % 0017 % HISTORY: 31-01-2007 M Hewitson 0018 % Creation 0019 % 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 0022 function varargout = setFs(varargin) 0023 0024 %%% Check if this is a call for parameters 0025 if utils.helper.isinfocall(varargin{:}) 0026 varargout{1} = getInfo(varargin{3}); 0027 return 0028 end 0029 0030 %%% Internal call: Only one object + don't look for a plist 0031 if strcmp(varargin{end}, 'internal') 0032 0033 %%% decide whether we modify the first object, or create a new one. 0034 varargin{1} = copy(varargin{1}, nargout); 0035 0036 varargin{1}.data.setFs(varargin{2}); 0037 varargout{1} = varargin{1}; 0038 return 0039 end 0040 0041 import utils.const.* 0042 utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename); 0043 0044 % Collect input variable names 0045 in_names = cell(size(varargin)); 0046 for ii = 1:nargin,in_names{ii} = inputname(ii);end 0047 0048 % Collect all AOs 0049 [as, ao_invars,rest] = utils.helper.collect_objects(varargin(:), 'ao', in_names); 0050 [pls, invars, rest] = utils.helper.collect_objects(rest(:), 'plist'); 0051 0052 %%% If pls contains only one plist with the only key 'fs' then set the 0053 %%% property with a plist. 0054 if length(pls) == 1 && isa(pls, 'plist') && nparams(pls) == 1 && isparam(pls, 'fs') 0055 rest{1} = find(pls, 'fs'); 0056 end 0057 0058 if numel(rest) ~= 1 0059 error('### Please specify a value for Fs, either in a plist or directly.'); 0060 end 0061 0062 %%% Combine plists 0063 if isempty(pls) 0064 pls = plist('fs', rest{1}); 0065 else 0066 pls = pls.combine(plist('fs', rest{1})); 0067 end 0068 0069 % Decide on a deep copy or a modify 0070 bs = copy(as, nargout); 0071 0072 % Loop over AOs 0073 for j=1:numel(bs) 0074 bs(j).data.setFs(rest{1}); 0075 bs(j).addHistory(getInfo, pls, ao_invars(j), bs(j).hist); 0076 end 0077 0078 if nargout > 0 0079 varargout{1} = bs; 0080 end 0081 end 0082 0083 %-------------------------------------------------------------------------- 0084 % Get Info Object 0085 %-------------------------------------------------------------------------- 0086 function ii = getInfo(varargin) 0087 0088 if nargin == 1 && strcmpi(varargin{1}, 'None') 0089 sets = {}; 0090 pl = []; 0091 else 0092 sets = {'Default'}; 0093 pl = getDefaultPlist; 0094 end 0095 % Build info object 0096 ii = minfo(mfilename, 'ao', '', utils.const.categories.helper, '$Id: setFs.m,v 1.6 2008/09/05 11:05:29 ingo Exp $', sets, pl); 0097 end 0098 0099 %-------------------------------------------------------------------------- 0100 % Get Default Plist 0101 %-------------------------------------------------------------------------- 0102 function pl = getDefaultPlist() 0103 pl = plist('fs', NaN); 0104 % END 0105 end 0106