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

Commit

Permalink
Remove wrong code for translateModelFMU
Browse files Browse the repository at this point in the history
The code only runs if the call to translateModelFMU fails to type, but
will ignore the bad arguments, change the defaults, and return a wrong
result-type.

Belonging to [master]:
  - #2390
  - OpenModelica/OpenModelica-testsuite#930
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Apr 24, 2018
1 parent d6ea7eb commit 0b569cc
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions Compiler/Script/StaticScript.mo
Expand Up @@ -351,25 +351,6 @@ algorithm
(cache,Expression.makePureBuiltinCall("translateModelCPP",
{DAE.CODE(Absyn.C_TYPENAME(className),DAE.T_UNKNOWN_DEFAULT),filenameprefix},DAE.T_STRING_DEFAULT),DAE.PROP(recordtype,DAE.C_VAR()));

case (cache,env,Absyn.CREF_IDENT(name = "translateModelFMU"),{Absyn.CREF(componentRef = cr)},args,impl,pre,_)
equation
className = Absyn.crefToPath(cr);
cname_str = Absyn.pathString(className);
(cache,fmuversion) = Static.getOptionalNamedArg(cache,env, impl, "version",
DAE.T_STRING_DEFAULT, args, DAE.SCONST("1.0"),pre,info);
(cache,fmuType) = Static.getOptionalNamedArg(cache,env, impl, "fmuType",
DAE.T_STRING_DEFAULT, args, DAE.SCONST("me"),pre,info);
(cache, filenameprefix) = Static.getOptionalNamedArg(cache,env, impl, "fileNamePrefix",
DAE.T_STRING_DEFAULT, args, DAE.SCONST(cname_str),pre,info);
recordtype =
DAE.T_COMPLEX(ClassInf.RECORD(Absyn.IDENT("SimulationObject")),
{DAE.TYPES_VAR("flatClass",DAE.dummyAttrVar,DAE.T_STRING_DEFAULT,DAE.UNBOUND(),NONE()),
DAE.TYPES_VAR("exeFile",DAE.dummyAttrVar,DAE.T_STRING_DEFAULT,DAE.UNBOUND(),NONE())},
NONE());
then
(cache,Expression.makePureBuiltinCall("translateModelFMU",
{DAE.CODE(Absyn.C_TYPENAME(className),DAE.T_UNKNOWN_DEFAULT),fmuversion,fmuType,filenameprefix},DAE.T_STRING_DEFAULT),DAE.PROP(recordtype,DAE.C_VAR()));

case (cache,env,Absyn.CREF_IDENT(name = "translateModelXML"),{Absyn.CREF(componentRef = cr)},args,impl,pre,_)
equation
className = Absyn.crefToPath(cr);
Expand Down

0 comments on commit 0b569cc

Please sign in to comment.