Skip to content

Commit

Permalink
- handle the time alias var in FMUs.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15178 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Feb 14, 2013
1 parent b82a4f3 commit 73857c3
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Compiler/Template/CodegenFMU.tpl
Expand Up @@ -900,10 +900,20 @@ match simVar
let crefName = '<%cref(name)%>_'
match aliasvar
case ALIAS(__) then
if stringEq(crefStr(varName),"time") then
<<
case <%crefName%> : return comp->fmuData->localData[0]->timeValue; break;
>>
else
<<
case <%crefName%> : return get<%arrayName%>(comp, <%cref(varName)%>_); break;
>>
case NEGATEDALIAS(__) then
if stringEq(crefStr(varName),"time") then
<<
case <%crefName%> : return comp->fmuData->localData[0]->timeValue; break;
>>
else
<<
case <%crefName%> : return (<%negate%> get<%arrayName%>(comp, <%cref(varName)%>_)); break;
>>
Expand Down Expand Up @@ -947,11 +957,19 @@ match simVar
let description = if comment then '// "<%comment%>"'
let crefName = '<%cref(name)%>_'
match aliasvar
case ALIAS(__) then
case ALIAS(__) then
if stringEq(crefStr(varName),"time") then
<<
>>
else
<<
case <%crefName%> : return set<%arrayName%>(comp, <%cref(varName)%>_, value); break;
>>
case NEGATEDALIAS(__) then
if stringEq(crefStr(varName),"time") then
<<
>>
else
<<
case <%crefName%> : return set<%arrayName%>(comp, <%cref(varName)%>_, (<%negate%> value)); break;
>>
Expand Down

0 comments on commit 73857c3

Please sign in to comment.