Skip to content

Commit

Permalink
- Implemented scripting command getModelicaPath() (setModelicaPath() …
Browse files Browse the repository at this point in the history
…already existed)

  - OMEdit now uses this command to query the path instead of getting it from the system environment


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7552 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 22, 2010
1 parent cdd65f5 commit d0cae34
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Compiler/FrontEnd/Static.mo
Expand Up @@ -7434,6 +7434,9 @@ protected function elabCallInteractive "function: elabCallInteractive
case (cache,env,Absyn.CREF_IDENT(name = "getInstallationDirectoryPath"),{},{},impl,SOME(st),_,_) then (cache, DAE.CALL(Absyn.IDENT("getInstallationDirectoryPath"),
{},false,true,DAE.ET_STRING(),DAE.NO_INLINE()),DAE.PROP(DAE.T_STRING_DEFAULT,DAE.C_VAR()),SOME(st));

case (cache,env,Absyn.CREF_IDENT(name = "getModelicaPath"),{},{},impl,SOME(st),_,_) then (cache, DAE.CALL(Absyn.IDENT("getModelicaPath"),
{},false,true,DAE.ET_BOOL(),DAE.NO_INLINE()),DAE.PROP(DAE.T_BOOL_DEFAULT,DAE.C_VAR()),SOME(st));

case (cache,env,Absyn.CREF_IDENT(name = "setModelicaPath"),{Absyn.STRING(value = str)},{},impl,SOME(st),_,_) then (cache, DAE.CALL(Absyn.IDENT("setModelicaPath"),
{DAE.SCONST(str)},false,true,DAE.ET_BOOL(),DAE.NO_INLINE()),DAE.PROP(DAE.T_BOOL_DEFAULT,DAE.C_VAR()),SOME(st));

Expand Down
13 changes: 13 additions & 0 deletions Compiler/Script/CevalScript.mo
Expand Up @@ -952,6 +952,19 @@ algorithm
then
(cache,Values.STRING(res),st);

case (cache,env,
DAE.CALL(path = Absyn.IDENT(name = "getModelicaPath"),expLst = {}),
(st as Interactive.SYMBOLTABLE(
ast = p,
explodedAst = sp,
instClsLst = ic,
lstVarVal = iv,
compiledFunctions = cf)),msg)
equation
res = Settings.getModelicaPath();
then
(cache,Values.STRING(res),st);

case (cache,env,
DAE.CALL(path = Absyn.IDENT(name = "setModelicaPath"),expLst = {DAE.SCONST(string = cmd)}),
(st as Interactive.SYMBOLTABLE(
Expand Down

0 comments on commit d0cae34

Please sign in to comment.