gusucode.com > vnt工具箱matlab源码程序 > vnt/vntblks/vntmasks/vntslcallback.m

    function vntslcallback(dialog, value, tag)
%VNTSLCALLBACK Calls the private callback function associated with a widget
%
%    VNTSLCALLBACK(DIALOG, VALUE, TAG) calls the private function
%    (callback) associated with the widget specified in TAG. 

%    SS 04-01-08
%    Copyright 2008-2010 The MathWorks, Inc.

% Get all the tags associated with the block. 
tags = vntslgate('privatevntslstring', 'alltags');
% Call the appropriate callback.
switch tag
    case tags.ConfigName
        privatevntslj1939configname(dialog, value)
    case tags.DeviceMenu
        privatevntsldevice(dialog, tag);
    case tags.BusSpeedStr
        % Callback bus speed - CAN TL block.
        privatevntslxcptlbusspeed(dialog, value, tag);
    case {tags.BusSpeed tags.VerifyBitValidity}
        % Call callback for Bus speed.
        privatecanslbusspeed (dialog, value, tag);
    case {tags.SJW tags.TSEG1 tags.TSEG2 tags.NSamples}
        privatecanslbitparameters (dialog, value, tag);
    case tags.EnableBitParameters
        privatecanslbitparamscheckbox (dialog, value, tag);
    case {tags.StandardIDs tags.ExtendedIDs}
        % Call CAN IDs callback.
        canslgate('privatecanslmsgid', dialog, value, tag);        
    case tags.SampleTime       
        % Call sample time callback
        switch class(dialog.getDialogSource)
            case {'vntdialog.xcpcantl','vntdialog.j1939cantl'}
                if (str2double(value) == -1)
                    tamslgate('privateslcbsampletime', dialog, value, true);
                else
                    tamslgate('privateslcbsampletime', dialog, value, false);
                end
            otherwise
                tamslgate('privateslcbsampletime', dialog, value, true);
        end
    case tags.MessagePeriod
        % Call Message Period callback
        privatecanslmessageperiod(dialog, value);
    case tags.FullPathFileName
        privatecanslfilename(dialog);
    case tags.VariableName
        privatecanslvarname(dialog);        
    case tags.Browse
        privatecanslbrowse(dialog);
    case {tags.ReplayMessagesTo tags.LogMessagesFrom}
        dialog.refresh();
    case tags.NoTimesReplay
        privatecansltimesreplay(dialog, value);
    case tags.MaxNumMessages
        privatecanslmaxmessages(dialog, value);        
    case {tags.AckMode tags.EnableStandardIDsFilter tags.EnableExtendedIDsFilter ...
          tags.MsgsPerTimestep tags.TransmitPeriodicMessage tags.ExtendedIDsCombo, ...
          tags.StandardIDsCombo}
        % Do nothing
    otherwise
        % Assert - Invalid widget tag.
        assert(false, 'vnt:vntblks:InvalidWidget', 'Invalid widget.');
end