www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgnormnode/initialize.m

    function [node, ok, msg] = initialize( node, tableptr )
%INITIALIZE Setup and run the breakpoint initialization algorithm
%
%  [NORMNODE, OK, MSG] = INITIALIZE( NORMNODE, PTABLE )
%    PTABLE, pointer to the table this normalizer feeds into, or pointer to
%    this normalizer
%
%    OK = false -> msg is an error condition
%    OK = true  -> msg is some information

%  Copyright 2000-2008 The MathWorks, Inc. and Ford Global Technologies, Inc.


ok = true;
msg = '';

M = get( node, 'managers');
if isempty( M.AutoSpaceManager )
    [M.AutoSpaceManager, ok, msg] = bpinit(tableptr.info);
    if ~ok
        return
    end
end

[M.AutoSpaceManager,OK] = gui_setup(M.AutoSpaceManager,'figure',{'expanded',1,'title', 'Breakpoint Initialization Options'});

if OK
    try
        [tableptr.info,cost, OK, msg] = run(M.AutoSpaceManager,tableptr.info,[]);
        if ~OK
            msg = sprintf('Cannot initialize the breakpoints. %s', msg);
            ok = false;
        else
            msg = sprintf('Initialized breakpoints. %s', msg);
            ok = true;
        end
    catch ME
        msg = sprintf('Unknown error occurred during breakpoint initialization. %s', ME.message);
        ok = false;
    end
end