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

Commit fe5c35d

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Fix generation of FMI 1.0 import
Bad code was generated previously, causing OM to try to get string parameter values by creating an algebraic loop. This causes string parameters to be fixed so the start-value is used instead. Belonging to [master]: - #2101 - OpenModelica/OpenModelica-testsuite#816
1 parent bcf422b commit fe5c35d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Compiler/Template/CodegenFMU.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2740,7 +2740,8 @@ case "1.0" then
27402740
match variabilityCausality
27412741
case "parameter" then
27422742
if boolAnd(hasStartValue,isFixed) then " = \""+startValue+"\""
2743-
else if boolAnd(hasStartValue,boolNot(isFixed)) then "(start=\""+startValue+"\",fixed=false)"
2743+
/* If we set fixed=false, we generate bad code; let make OM handle the bad values */
2744+
else if boolAnd(hasStartValue,boolNot(isFixed)) then "(start=\""+startValue+"\")"
27442745
else if boolAnd(boolNot(hasStartValue),isFixed) then "(fixed=true)"
27452746
else if boolAnd(boolNot(hasStartValue),boolNot(isFixed)) then "(fixed=false)"
27462747
case "" then

0 commit comments

Comments
 (0)