www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtradeoffgui/@tradeoffInfoBarView/pUpdate.m

    function pUpdate(obj)
%PUPDATE Refresh displayed values in object
%
%  PUPDATE(OBJ) refreshes the information that is being displayed.

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


ms = obj.MessageService;
if ~isempty(ms) ...
        && ~isempty(ms.CurrentTradeoff) ...
        && ~isempty(ms.CurrentTable)

    % Fill in table name
    pTO = ms.CurrentTradeoff;
    hTO = pTO.info;
    pT = ms.CurrentTable;
    hT = pT.info;
    
    obj.hTableName.String = getname(hT);
    pFill = getFillExpression(hTO, pT);
    if ~isnull(pFill)
        obj.hFillName.String = pFill.getname;
    else
        obj.hFillName.String = '';
    end

    % Update input names and values
    if ms.hasValidTableIndex
        ms.TradeoffServices.setPointValues;
        pInp = ms.TradeoffServices.pTableInputs;
        hRow = pInp(1).info;
        hCol = pInp(2).info;
        
        obj.hInputString.String = sprintf('%s = %g, %s = %g', ...
            getname(hRow), ...
            getvalue(hRow), ...
            getname(hCol), ...
            getvalue(hCol));
    else
        obj.hInputString.String = '';
    end
else
    set([obj.hTableName; ...
        obj.hFillName; ...
        obj.hInputString], 'String', '');
end