Mercurial > hg > ltpda
diff m-toolbox/classes/@LTPDAworkbench/reset.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/@LTPDAworkbench/reset.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,37 @@ +% 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