Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit d487be4

Browse files
ptaeuberOpenModelica-Hudson
authored andcommitted
Also simplify DAE.NOT() wout type
see ticket:4089
1 parent a50dbe1 commit d487be4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Compiler/FrontEnd/ExpressionSimplify.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5003,7 +5003,7 @@ algorithm
50035003
list<list<DAE.Exp>> mat;
50045004

50055005
// not true => false, not false => true
5006-
case (_,DAE.NOT(DAE.T_BOOL()),e1)
5006+
case (_,DAE.NOT(),e1)
50075007
equation
50085008
b1 = Expression.toBool(e1);
50095009
b1 = not b1;

Compiler/SimCode/SimCodeUtil.mo

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8470,7 +8470,7 @@ algorithm
84708470
commentStr = unparseCommentOptionNoAnnotationNoQuote(comment);
84718471
(unit, displayUnit) = extractVarUnit(dae_var_attr);
84728472
isProtected = getProtected(dae_var_attr);
8473-
hideResult = getHideResult(hideResultExp);
8473+
hideResult = getHideResult(hideResultExp, isProtected);
84748474
(minValue, maxValue) = getMinMaxValues(dlowVar);
84758475
initVal = getStartValue(dlowVar);
84768476
nomVal = getNominalValue(dlowVar);
@@ -8505,7 +8505,7 @@ algorithm
85058505
commentStr = unparseCommentOptionNoAnnotationNoQuote(comment);
85068506
(unit, displayUnit) = extractVarUnit(dae_var_attr);
85078507
isProtected = getProtected(dae_var_attr);
8508-
hideResult = getHideResult(hideResultExp);
8508+
hideResult = getHideResult(hideResultExp, isProtected);
85098509
(minValue, maxValue) = getMinMaxValues(dlowVar);
85108510
initVal = getStartValue(dlowVar);
85118511
nomVal = getNominalValue(dlowVar);
@@ -8535,7 +8535,7 @@ algorithm
85358535
commentStr = unparseCommentOptionNoAnnotationNoQuote(comment);
85368536
(unit, displayUnit) = extractVarUnit(dae_var_attr);
85378537
isProtected = getProtected(dae_var_attr);
8538-
hideResult = getHideResult(hideResultExp);
8538+
hideResult = getHideResult(hideResultExp, isProtected);
85398539
(minValue, maxValue) = getMinMaxValues(dlowVar);
85408540
initVal = getStartValue(dlowVar);
85418541
nomVal = getNominalValue(dlowVar);
@@ -10636,15 +10636,16 @@ end getProtected;
1063610636
protected function getHideResult
1063710637
"Returns the value of the hideResult attribute."
1063810638
input DAE.Exp hideResultExp;
10639+
input Boolean isProtected;
1063910640
output Boolean hideResult;
1064010641
algorithm
1064110642
hideResult := match(hideResultExp)
1064210643
case(DAE.BCONST(false)) then false;
1064310644
case(DAE.BCONST(true)) then true;
1064410645
else
1064510646
equation
10646-
Error.addCompilerWarning("The hideResult annotation could not be evaluated, probably due to missing annotation(Evaluate=true). It is set to false by default.");
10647-
then false;
10647+
Error.addCompilerWarning("The hideResult annotation could not be evaluated, probably due to missing annotation(Evaluate=true). It is set to 'isProtected' (=" + boolString(isProtected) + ") by default.");
10648+
then isProtected;
1064810649
end match;
1064910650
end getHideResult;
1065010651

0 commit comments

Comments
 (0)