Skip to content

Commit

Permalink
Fix generation of FMI 1.0 import
Browse files Browse the repository at this point in the history
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]:
  - OpenModelica/OMCompiler#2101
  - OpenModelica/OpenModelica-testsuite#816
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Jan 10, 2018
1 parent bcf422b commit fe5c35d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Compiler/Template/CodegenFMU.tpl
Expand Up @@ -2740,7 +2740,8 @@ case "1.0" then
match variabilityCausality
case "parameter" then
if boolAnd(hasStartValue,isFixed) then " = \""+startValue+"\""
else if boolAnd(hasStartValue,boolNot(isFixed)) then "(start=\""+startValue+"\",fixed=false)"
/* If we set fixed=false, we generate bad code; let make OM handle the bad values */
else if boolAnd(hasStartValue,boolNot(isFixed)) then "(start=\""+startValue+"\")"
else if boolAnd(boolNot(hasStartValue),isFixed) then "(fixed=true)"
else if boolAnd(boolNot(hasStartValue),boolNot(isFixed)) then "(fixed=false)"
case "" then
Expand Down

0 comments on commit fe5c35d

Please sign in to comment.