www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtools/@featurecomp/pInitInputs.m

    function pInitInputs(obj, pF, pT)
%PINITINPUTS Private method that sets up the inputs lists correctly.
%
%  PINITINPUTS(OBJ, PF, PT)

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


obj.Feature = pF;
obj.Table = pT;

if isempty(pF) || isnull(pF) || isempty(pT) || isnull(pT)
    % Empty the display
    obj.CurrentVars = null(xregpointer, 0);
    obj.CurrentGridVars = null(xregpointer, 0);
    obj.ValueTable.setVariables({}, [], {});
else
    % Gridding variables are only the *independent* table inputs
    TblInputs = pT.getinports;
    obj.CurrentGridVars = cgindependentvars(TblInputs);
    
    pM = pF.get('model');
    if isempty(pM) || isnull(pM) || pF.isFilledByData
        % No model means we can't do a comparison
        obj.CurrentVars = null(xregpointer, 0);
        obj.ValueTable.setVariables({}, [], {});
    else  
        AllInputs = unique([pF.getinports, pM.getinports]);
        if length(obj.CurrentGridVars)>0 && length(obj.CurrentGridVars)<3
            obj.CurrentVars = cginitinputs(obj.ValueTable, obj.CurrentGridVars, AllInputs);
        else
            obj.ValueTable.setVariables({}, [], {});
            obj.CurrentVars = null(xregpointer, 0);
        end
    end
end