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

    function d = show(nd,cgh,d)
%SHOW CAGE browser interface method
%
%  View = SHOW(nd,cgh,View) is called before the display is changed to view
%  a new node.

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


show(d,nd)

return
pOpt = getdata(nd);
pPROJ = cgh.RootNode;
d.Handles.ObjectiveList.ProjectPointer = pPROJ;
d.Handles.ConstraintList.ProjectPointer = pPROJ;
d.Handles.DatasetList.ProjectPointer = pPROJ;
d.Handles.SetupMessageService.setOptim(pOpt.info, 'all');

% Create a listener that updates node data whenever the view components
% change it.
d.NodeUpdateListener = event.listener(d.Handles.SetupMessageService, ...
    'ObjectChanged', mbcutils.callback(@i_updatenode, pOpt));

% Inhibit the same actions in the next call to view
d.SkipViewUpdate = true;


function i_updatenode(ms, ~, pOpt)
optim = ms.getOptim;
if ~isempty(optim)
    pOpt.info = optim;
end