Skip to content

Commit

Permalink
added flag for diasbale Msg from omc
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25524 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Vitalij Ruge committed Apr 13, 2015
1 parent 56d9313 commit ddad86f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
31 changes: 14 additions & 17 deletions Compiler/Util/Error.mo
Expand Up @@ -68,6 +68,7 @@ encapsulated package Error
"

public import Util;
public import Flags;

public
uniontype Severity "severity of message"
Expand Down Expand Up @@ -920,24 +921,20 @@ public function addMessage "Implementation of Relations
is looked up in the message table."
input Message inErrorMsg;
input MessageTokens inMessageTokens;
protected
MessageType msg_type;
Severity severity;
String msg_str;
ErrorID error_id;
Util.TranslatableContent msg;
algorithm
_ := match (inErrorMsg,inMessageTokens)
local
MessageType msg_type;
Severity severity;
String msg_str;
ErrorID error_id;
MessageTokens tokens;
Util.TranslatableContent msg;
case (MESSAGE(error_id, msg_type, severity, msg), tokens)
equation
//print(" adding message: " + intString(error_id) + "\n");
msg_str = Util.translateContent(msg);
ErrorExt.addMessage(error_id, msg_type, severity, msg_str, tokens);
//print(" succ add " + msg_type_str + " " + severity_string + ", " + msg + "\n");
then
();
end match;
if not Flags.isSet(Flags.DISABLE_WARNING_MSG) then
//print(" adding message: " + intString(error_id) + "\n");
MESSAGE(error_id, msg_type, severity, msg) := inErrorMsg;
msg_str := Util.translateContent(msg);
ErrorExt.addMessage(error_id, msg_type, severity, msg_str, inMessageTokens);
//print(" succ add " + msg_type_str + " " + severity_string + ", " + msg + "\n");
end if;
end addMessage;

public function addSourceMessage "
Expand Down
5 changes: 4 additions & 1 deletion Compiler/Util/Flags.mo
Expand Up @@ -434,6 +434,8 @@ constant DebugFlag EXTENDS_DYN_OPT = DEBUG_FLAG(132, "extendsDynOpt", false,
Util.gettext("generat extends NLP, move loops in the optimization problem as constraints. hint: using intial guess from file!"));
constant DebugFlag REDUCE_DYN_OPT = DEBUG_FLAG(133, "reduceDynOpt", false,
Util.gettext("remove eqs which not need for the calculations of cost and constraints"));
constant DebugFlag DISABLE_WARNING_MSG = DEBUG_FLAG(134, "disableWarnings", false,
Util.gettext("Disables Warning/Error Massage."));


// This is a list of all debug flags, to keep track of which flags are used. A
Expand Down Expand Up @@ -574,7 +576,8 @@ constant list<DebugFlag> allDebugFlags = {
ADVANCE_TEARING,
CONSTJAC,
EXTENDS_DYN_OPT,
REDUCE_DYN_OPT
REDUCE_DYN_OPT,
DISABLE_WARNING_MSG
};

public
Expand Down

0 comments on commit ddad86f

Please sign in to comment.