gusucode.com > vnt工具箱matlab源码程序 > vnt/vnt/+can/+peaksystem/+pcanbasic/VendorInfo.m

    classdef (Hidden) VendorInfo < can.VendorInfo
% VendorInfo Retrieve PEAK-System specific CAN device information.
%
%   This class contains information on PEAK-System CAN devices. It also
%   contains child classes for each identified CAN device channel.
%
%   See also VNT.

% Authors: JDP
% Copyright 2013 The MathWorks, Inc.

methods
    
    function obj = VendorInfo()
    % VendorInfo Construct an object containing information on Kvaser devices.
        
        % Set the name of the vendor.
        vendorName = 'PEAK-System';
        % Set the driver interface description.
        vendorDriverDescription = 'PCAN-Basic';
        
        % Get the driver version information.
        vendorDriverVersion = can.peaksystem.pcanbasic.Utility.getDriverVersion();
        
        % Get the number of available device channels.
        channelCount = can.peaksystem.pcanbasic.Utility.getNumberOfChannels();
        
        % Initialize a ChannelInfo object as empty.
        channelInfo = can.peaksystem.pcanbasic.ChannelInfo.empty();
        
        % Loop through the channel count and create channel information
        % objects for each.
        for index = 1:channelCount
            % Create a child class for this channel.
            channelInfo(index) = can.peaksystem.pcanbasic.ChannelInfo(index);
        end
        
        % Call the superclass constructor.
        obj@can.VendorInfo(...
            vendorName,...
            vendorDriverDescription,...
            vendorDriverVersion,...
            channelInfo);
    end
    
end

end