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

    function [obj, out] = gui_import( obj )
%GUI_IMPORT  Import calibration data.
%
%  GUI_IMPORT(OBJ) executes an import process on OBJ.  An error dialog is
%  shown if an the import function used returns an error code.

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


% Default return argument
out = [];

% Get the available options for import
[fcns, names, fileFlags] = getinputfunctions(obj);
if any(~fileFlags)
    % Pop up a dialog to ask which source to import from
    NonFileIdx = find(~fileFlags);
    [SelIdx, ok] = mv_listdlg('Name', 'Import Calibration Data', ...
        'PromptString', 'Select import source:', ...
        'SelectionMode', 'single', ...
        'ListString', [{'File'}, names(NonFileIdx)]);
    if ~ok
        return
    end

    if SelIdx==1
        drawnow  %Need to ensure list dialog is destroyed
        [obj, out] = guiImportFileType(obj);
    else
        obj.inputFcn = fcns{NonFileIdx(SelIdx-1)};
        out = import( obj );
    end
    
else
    % Go straight to file loading
    [obj, out] = guiImportFileType(obj);
end