view m-toolbox/classes/@plotter/plot.m @ 17:7afc99ec5f04 database-connection-manager

Update ao_model_retrieve_in_timespan
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

% PLOT call plot on each data object.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: PLOT call plot on each data object.
%
% CALL:                   hfig = plotter.plot(pl);
%
% OUTPUTS:
%             hfig - an array of figure handles
%
% <a href="matlab:utils.helper.displayMethodInfo('plotter', 'plot')">Parameters</a>
%
% VERSION:     $Id: plot.m,v 1.2 2011/03/28 12:45:39 hewitson Exp $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function plot(varargin)
  
  % Check if this is a call for parameters
  if utils.helper.isinfocall(varargin{:})
    varargout{1} = getInfo(varargin{3});
    return
  end
  
  % Collect input variable names
  in_names = cell(size(varargin));
  for ii = 1:nargin,in_names{ii} = inputname(ii);end
  
  % Get the plotter calling object
  plotter = utils.helper.collect_objects(varargin(:), 'plotter');
  
  % Collect input plists
  pl = utils.helper.collect_objects(varargin(:), 'plist');
  pl = combine(pl, getDefaultPlist);
  
  hfig = [];
  for kk=1:numel(plotter.data)
    
    d = plotter.data(kk);
    
    % Try to call the data class's plot method
    try
      d.plot;
      
      % Collect the handles
      drawnow;
      hfig = [hfig gcf];
      
    catch Me
      warning('Class %s has no plot function', class(d));
    end
    
  end
  
  
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, 'plotter', 'ltpda', utils.const.categories.output, '$Id: plot.m,v 1.2 2011/03/28 12:45:39 hewitson Exp $', sets, pl);
end

%--------------------------------------------------------------------------
% Get Default Plist
%--------------------------------------------------------------------------
function pl_default = getDefaultPlist()
  pl_default = plist();
  
end

% END