view m-toolbox/classes/@LTPDAworkbench/reset.m @ 31:a26669b59d7e database-connection-manager

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

% RESET the current pipeline.
%
% CALL: wb.reset
%
% M Hewitson 11-10-08
%
% $Id: reset.m,v 1.13 2011/03/31 08:00:18 hewitson Exp $
%
function reset(varargin)
  
  if nargin==2
    clearWS = varargin{2};
  else
    clearWS = false;
  end
  wb = varargin{1};
  
  setappdata(0, 'LTPDAworkbench', wb);
  
  utils.helper.msg(utils.const.msg.PROC1, ['*** resetting pipeline ' char(awtinvoke(wb.mp, 'getDisplayTitle'))]);
  awtinvoke(wb.mp, 'resetCurrentPipeline');
  
  % clear structure for this diagram
  cdiagName = strrep(awtinvoke(wb.mp, 'getInstanceIdentifier'), ' ', '_');
  
  if evalin('base', sprintf('exist(''%s'', ''var'')', cdiagName)) == 0
    utils.helper.warn(sprintf('The variable "%s" does not exist in the MATLAB workspace. Not clearing.', cdiagName));
  end
  
  if clearWS
    evalin('base', sprintf('%s=[];', cdiagName));
  end
  
  wb.executing = false;
  setappdata(0, 'LTPDAworkbench', []);
  
end