www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgcalinput/get.m

    function out = get(s , property)
%cgcalinput/GET
%
%Gets the properties of the cgcalinput object.
%
%Usage: get(add_obj , 'property_name')

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


if nargin==1
    out.Filename = 'Name of the file to be imported';
    out.Type = 'Type of the file to be imported';
    out.SourceString = 'String representing the source of the data';
elseif nargin == 2
    if ~isa(property , 'char')
        error(message('mbc:cgcalinput:InvalidProperty'));
    end
    switch lower(property)
        case 'filename'
            out = s.filename;
        case 'type'
            out = s.inputFcn;
        case 'sourcestring'
            if ~isempty(s.filename)
                if ischar(s.filename)
                    out = s.filename;
                elseif isa(s.filename, 'calibrationdata.fileinterface')
                    out = s.filename.Filename;
                elseif isa(s.filename, 'calibrationdata.calibrationinterface')
                    out = ['<' s.filename.Description '>'];
                else
                    out = '<No source information>';
                end
            elseif ~isempty(s.inputFcn)
                % Call the loading function to get details on the type
                [unused, desc] = feval(s.inputFcn, s, 'getname');
                out = ['<' desc '>'];
            else
                out = '<No source information>';
            end
        otherwise
            error(message('mbc:cgcalinput:InvalidProperty1', property));
    end
else
    error(message('mbc:cgcalinput:TooFewInputs'));
end