Skip to content
Snippets Groups Projects
Select Git revision
  • 09925cb8733487801d837dda3d40910fb09d15f1
  • main default protected
  • dev protected
  • Issue/3142-kpiGenerator
  • Hotfix/3115-userReportingEmpty2
  • Hotfix/3115-userReportingEmpty
  • Issue/3073-kpi
  • Issue/2492-respOrg
  • Issue/3005-kpiReportingBroken
  • Issue/2982-kpiDataPub
  • gitkeep
  • Issue/2847-reporting
  • Issue/2850-removeGrantId
  • Issue/2432-publicationKpi
  • Hotfix/xxxx-rors
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2666-adminCronjobs
  • Issue/2568-betterLogging
  • Issue/2518-docs
  • Hotfix/2388-sensitive
  • Issue/2330-fixNaNQuotainAdmin
  • v1.2.10
  • v1.2.9
  • v1.2.8
  • v1.2.7
  • v1.2.6
  • v1.2.5
  • v1.2.4
  • v1.2.3
  • v1.2.2
  • v1.2.1
  • v1.2.0
  • v1.1.1
  • v1.1.0
  • v1.0.9
  • v1.0.8
  • v1.0.7
  • v1.0.6
  • v1.0.5
  • v1.0.4
  • v1.0.3
41 results

Program.cs

Blame
  • 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
        
    %%
    if nargin == 1
        signif = 2;
    else
        signif = varargin{2};
    end
    
    if signif == -1
        niceColor = [.5 .2 .8];
        cdisp(niceColor,'*******************************************************************')
        cdisp(niceColor,mes)
        cdisp(niceColor,'*******************************************************************')
        
    elseif signif <= verboseMode
        % check if we are in desktop mode or in console
        if usejava('jvm') && exist('cdisp','file')
            colormap=cell(3,1);
            % red ; blue ; green
            colormap{1} =[1 .1 .1]; colormap{2}='Blue'; colormap{3}=[.1 .6 .1];
            cdisp(colormap{signif+1}, mes);
        else
            disp(mes);
        end
    end
    
    end