Skip to content

Commit

Permalink
- fix bug #2422
Browse files Browse the repository at this point in the history
  send "" as prio in ClassLoader.loadFile as we really want that directory not another!
- add *all* BackendDAE.VarKind in 
  Compiler/Template/SimCodeTV.mo and handle them in 
  Compiler/Template/CodegenXML.tpl


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17713 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Oct 15, 2013
1 parent d7e8e34 commit 0a72399
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Compiler/FrontEnd/ClassLoader.mo
Expand Up @@ -322,7 +322,9 @@ algorithm
(dir,"package.mo") = Util.getAbsoluteDirectoryAndFile(name);
cname::rest = System.strtok(List.last(System.strtok(dir,"/"))," ");
prio = stringDelimitList(rest, " ");
prio = Util.if_(stringEq(prio,""), "default", prio);
// send "" priority if that is it, don't send "default"
// see https://trac.openmodelica.org/OpenModelica/ticket/2422
// prio = Util.if_(stringEq(prio,""), "default", prio);
mp = System.realpath(dir +& "/../");
p1 = loadClass(Absyn.IDENT(cname),{prio},mp,SOME(encoding));
then p1;
Expand Down
19 changes: 11 additions & 8 deletions Compiler/Template/CodegenXML.tpl
Expand Up @@ -232,14 +232,17 @@ template variableCategoryXml(VarKind varKind)
"Returns the variable category of ScalarVariable."
::=
match varKind
case VARIABLE(__) then "algebraic"
case STATE(__) then "state"
case STATE_DER(__) then "derivative"
case DUMMY_DER(__) then "algebraic"
case DUMMY_STATE(__) then "algebraic"
case DISCRETE(__) then "algebraic"
case PARAM(__) then "independentParameter"
case CONST(__) then "independentConstant"
case VARIABLE(__) then "algebraic"
case STATE(__) then "state"
case STATE_DER(__) then "derivative"
case DUMMY_DER(__) then "algebraic"
case DUMMY_STATE(__) then "algebraic"
case DISCRETE(__) then "algebraic"
case PARAM(__) then "independentParameter"
case CONST(__) then "independentConstant"
case EXTOBJ(__) then 'externalObject_<%dotPathXml(fullClassName)%>'
case JAC_VAR(__) then "jacobianVar"
case JAC_DIFF_VAR(__) then "jacobianDiffVar"
else error(sourceInfo(), "Unexpected simVarTypeName varKind")
end variableCategoryXml;

Expand Down
2 changes: 2 additions & 0 deletions Compiler/Template/SimCodeTV.mo
Expand Up @@ -731,6 +731,8 @@ package BackendDAE
record PARAM end PARAM;
record CONST end CONST;
record EXTOBJ Absyn.Path fullClassName; end EXTOBJ;
record JAC_VAR end JAC_VAR;
record JAC_DIFF_VAR end JAC_DIFF_VAR;
end VarKind;

uniontype ZeroCrossing
Expand Down

0 comments on commit 0a72399

Please sign in to comment.