Skip to content
Snippets Groups Projects
Select Git revision
  • master
1 result

main.java

Blame
  • Forked from Jonas Barci Barcikowski / progra-blatt02
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ita_verbose_info.m 2.81 KiB
    function  ita_verbose_info(varargin)
    %ITA_VERBOSE_INFO - Warning/ Informing Function of ITA-Toolbox
    %  This function displays warning or informing messages dependent of the
    %  verboseLevel configured in ita_preferences (ita_preferences('verboseMode',
    %  verboseLevel)). Level 0 should only be important warnings, level 1 should be
    %  all other warnings, while level 2 should be informations not very
    %  important.
    %
    %
    %  Syntax:
    %   ita_verbose_info('Message', verboseLevel)
    %
    %   Options (default):
    %           'Message'               : Message as a string
    %           verboseLevel (default=2): number between 0-2
    %
    %  Example:
    %   ita_verbose_info('This is an information');
    %   ita_verbose_info('This is a warning', 1);
    %   ita_verbose_info('This is an important warning', 0);
    %
    %   Please call inside other function with:
    %   ita_verbose_info([thisFuncStr ' Warning'], 1);
    %
    %   Please do not forget: Errors should be placed with error('Error message');
    %
    %   Reference page in Help browser
    %        <a href="matlab:doc ita_verbose_info">doc ita_verbose_info</a>
    
    % <ITA-Toolbox>
    % This file is part of the ITA-Toolbox. Some rights reserved. 
    % You can find the license for this m-file in the license.txt file in the ITA-Toolbox folder. 
    % </ITA-Toolbox>
    
    
    % Author: Gregor Powarzynski -- Email: gregor.powarzynski@rwth-aachen.de
    % Created:  16-Nov-2009
    
    %% Get ITA Toolbox preferences and Function String
    verboseMode  = ita_preferences('verboseMode');  % Use to show additional information for the user
    thisFuncStr  = [upper(mfilename) ':'];     %Use to show warnings or infos in this functions
    
    % Initialization and Input Parsing
    narginchk(1,2);
    
    % recognize input parameters
    if ~(ischar(varargin{1}))
        error([thisFuncStr ' See your Syntax!']);
    elseif nargin == 2
        if (varargin{2} ~= 0 && varargin{2} ~= 1 && varargin{2} ~=2 && varargin{2} ~=-1)
            error([thisFuncStr ' See your Syntax!']);
        end
    end
    
    %% read input
    mes = varargin{1};
    
    stackStruct = dbstack;
    if numel(stackStruct) > 1
        caller = stackStruct(2).file(1:end-2);
    else
        caller = '';
    end
    
    
    if isempty(strfind(lower(mes), lower(caller)))  % mes contains no functionname
        mes = [ upper(caller) ': ' mes];
    end
        
    %%