diff m-toolbox/classes/@ao/double.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@ao/double.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,73 @@
+% DOUBLE overloads double() function for analysis objects.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: DOUBLE overloads double() function for analysis objects.
+%
+% CALL:        y = double(ao_in);
+%
+% <a href="matlab:utils.helper.displayMethodInfo('ao', 'double')">Parameters Description</a>
+%
+% VERSION:     $Id: char.m,v 1.28 2010/12/17 15:33:58 hewitson Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function varargout = double(varargin)
+
+  % Check if this is a call for parameters
+  if utils.helper.isinfocall(varargin{:})
+    varargout{1} = getInfo(varargin{3});
+    return
+  end
+
+  import utils.const.*
+  utils.helper.msg(msg.PROC3, 'running %s/%s', mfilename('class'), mfilename);
+  
+  % Collect input variable names
+  in_names = cell(size(varargin));
+  for ii = 1:nargin,in_names{ii} = inputname(ii);end
+
+  % Collect all AOs and plists
+  as = utils.helper.collect_objects(varargin(:), 'ao', in_names);
+ 
+  out = [];
+  for kk=1:numel(as)
+    out = [out as.y];
+  end
+  
+  varargout{1} = out;
+  
+end
+
+%--------------------------------------------------------------------------
+% Get Info Object
+%--------------------------------------------------------------------------
+function ii = getInfo(varargin)
+  if nargin == 1 && strcmpi(varargin{1}, 'None')
+    sets = {};
+    pl   = [];
+  else
+    sets = {'Default'};
+    pl   = getDefaultPlist;
+  end
+  % Build info object
+  ii = minfo(mfilename, 'ao', 'ltpda', utils.const.categories.converter, '$Id: char.m,v 1.28 2010/12/17 15:33:58 hewitson Exp $', sets, pl);
+  ii.setModifier(false);
+  ii.setOutmin(0);
+end
+
+%--------------------------------------------------------------------------
+% Get Default Plist
+%--------------------------------------------------------------------------
+
+function plout = getDefaultPlist()
+  persistent pl;  
+  if exist('pl', 'var')==0 || isempty(pl)
+    pl = buildplist();
+  end
+  plout = pl;  
+end
+
+function pl_default = buildplist()
+  pl_default = plist.EMPTY_PLIST;
+end
+