Skip to content

Commit

Permalink
- SimCode.mo
Browse files Browse the repository at this point in the history
  - fix bug in derVarFromStateVar to avoid redefinition of macros in generated code

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5825 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Jul 7, 2010
1 parent a50e099 commit ac71acc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Compiler/SimCode.mo
Expand Up @@ -4315,13 +4315,20 @@ algorithm
Boolean isFixed;
Exp.Type type_;
Boolean isDiscrete;
Option<DAE.ComponentRef> arrayCref;
case (SIMVAR(name, kind, comment, index, isFixed, type_, isDiscrete, arrayCref))
DAE.ComponentRef arrayCref;
case (SIMVAR(name, kind, comment, index, isFixed, type_, isDiscrete, NONE()))
equation
name = DAELow.crefPrefixDer(name);
then
SIMVAR(name, DAELow.STATE_DER(), comment, index, isFixed, type_,
isDiscrete, NONE());
case (SIMVAR(name, kind, comment, index, isFixed, type_, isDiscrete, SOME(arrayCref)))
equation
name = DAELow.crefPrefixDer(name);
arrayCref = DAELow.crefPrefixDer(arrayCref);
then
SIMVAR(name, DAELow.STATE_DER(), comment, index, isFixed, type_,
isDiscrete, arrayCref);
isDiscrete, SOME(arrayCref));
end matchcontinue;
end derVarFromStateVar;

Expand Down

0 comments on commit ac71acc

Please sign in to comment.