www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgmodexpr/propPageModelGeneral.m

    function hInfo = propPageModelGeneral(obj, hPropGroup)
%PROPPAGEGENERAL Create the General property tab for models
%
%  INFO = PROPPAGEGENERAL(OBJ, HGROUP) creates the info object that
%  represents the General tab in a property dialog for models.  This is an
%  extended version of the general property tab for expressions.

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


% Create normal General pane and use its settings
hInfoGen = propPageGeneral(obj, hPropGroup);

hInfo = mbcgui.dialog.PageInfo( ...
    'PageGroup', hPropGroup, ...
    'Name', 'General', ...
    'HelpHandler', 'cghelptool', ...
    'HelpCode', 'CGMODELPROPPAGEGENERAL', ...
    'CreateCallback', {@i_createlyt, hInfoGen});


function i_createlyt(hInfo, ~, hInfoGen)
hParent = hInfo.Parent;
obj = hInfo.getObject;
topLayout = hInfoGen.createUI(hParent);

div1 = xregGui.dividerline('parent', hParent);
div2 = xregGui.dividerline('parent', hParent);

lims = get(obj, 'clips');
ud.upperClip = mbcgui.widget.Spinner('Parent', hParent, ...
    'Value', lims(2));
ud.lowerClip = mbcgui.widget.Spinner('Parent', hParent, ...
    'Value', lims(1));
clipLabel = xregGui.labelcontrol('parent', hParent, ...
    'LabelSizeMode', 'absolute', ...
    'LabelSize', 130, ...
    'ControlSizeMode', 'absolute', ...
    'ControlSize', 70, ...
    'String', 'Output saturation limits:', ...
    'Control', ud.lowerClip);
evalLabel = uicontrol('Parent', hParent, ...
    'Style', 'text', ...
    'HorizontalAlignment', 'left', ...
    'Enable', 'inactive', ...
    'String', 'Output quantity:');
optval = [0;0;0];
optval(getEvalMode(obj)) = 1;
opten = [true;...
    pevcheck(obj.model);...
    concheck(obj.model)];
opten = opten | optval;
    

ud.evalOpts = xregGui.rbgroup('parent', hParent, ...
    'nx', 1, 'ny', 3, ...
    'string', {'Model value'; 'Prediction error variance of model'; ...
        'Boundary constraint of model'}, ...
    'Value', optval, ...
    'EnableArray', opten);
  
btmLayout = xreggridbaglayout(hParent, ...
    'dimension', [4 4], ...
    'rowsizes', [2 20 2 55], ...
    'colsizes', [130 70 70 -1], ...
    'border', [0 0 0 10], ...
    'gapy', 10, ...
    'gapx', 5, ...
    'mergeblock', {[1 1], [1 4]}, ...
    'mergeblock', {[2 2], [1 2]}, ...
    'mergeblock', {[3 3], [1 4]}, ...
    'mergeblock', {[4 4], [2 4]}, ...
    'elements', {div1, clipLabel, div2, evalLabel, [], [], [], ud.evalOpts, [], ud.upperClip});

myLayout = xreggridbaglayout(hParent, ...
    'dimension', [2 1], ...
    'rowsizes', [155 -1], ...
    'elements', {topLayout, btmLayout});

ud.FinalList = event.listener(hInfo.PageGroup, 'Finalize', @(h,evt) i_getvals(hInfo));
hInfo.setUI(myLayout);
hInfo.UserData = ud;



function i_getvals( hInfo)
ud = hInfo.UserData;
obj = hInfo.getObject;

% Limits
lims = [ud.lowerClip.Value, ud.upperClip.Value];
if lims(2)<lims(1);
    lims(2)= lims(1);
end
obj = set(obj, 'clips', lims);

% Output evaluation
obj = setEvalMode(obj, ud.evalOpts.Selected);

hInfo.updateObject(obj);