Skip to content

Commit

Permalink
fix for get start value in cpp template
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22999 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Oct 28, 2014
1 parent 0ac8b0b commit 9bc199f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -9438,6 +9438,10 @@ template daeExpCall(Exp call, Context context, Text &preExp /*BUFP*/,
let &preExp = buffer "" /*BUFD*/
let eStart = daeExp(start, contextOther, &preExp, &varDecls /*BUFD*/,simCode,useFlatArrayNotation)
let eInterval = daeExp(interval, contextOther, &preExp, &varDecls /*BUFD*/,simCode,useFlatArrayNotation)
match context
case ALGLOOP_CONTEXT(genInitialisation=false) then
'_system->_time_conditions[<%intSub(index, 1)%>]'
else
'_time_conditions[<%intSub(index, 1)%>]'
case CALL(path=IDENT(name="initial") ) then
match context
Expand Down Expand Up @@ -9953,6 +9957,10 @@ template daeExpCallStart(Exp exp, Context context, Text &preExp /*BUFP*/,
let &varDeclsCref = buffer "" /*BUFD*/
match exp
case cr as CREF(__) then
match context
case ALGLOOP_CONTEXT(genInitialisation=false) then
'_system->get<%crefStartValueType(cr.componentRef)%>StartValue("<%cref(cr.componentRef, useFlatArrayNotation)%>")'
else
'get<%crefStartValueType(cr.componentRef)%>StartValue("<%cref(cr.componentRef, useFlatArrayNotation)%>")'
case ASUB(exp = cr as CREF(__), sub = {sub_exp}) then
let offset = daeExp(sub_exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/,simCode,useFlatArrayNotation)
Expand Down

0 comments on commit 9bc199f

Please sign in to comment.