Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Eliminate subSampleFactor from FMI model description
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Sep 28, 2017
1 parent 28f339a commit 4e260f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Compiler/Template/CodegenFMUCommon.tpl
Expand Up @@ -321,8 +321,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fsub, denom=fsuper), shift=RATIONAL(nom=snom, denom=sres))) then
<<
<Clock><Periodic
baseInterval="<%realDiv(bi, intReal(fsuper))%>"
<%if intGt(fsub, 1) then 'subSampleFactor="'+fsub+'"'%>
interval="<%realMul(bi, realDiv(intReal(fsub), intReal(fsuper)))%>"
<%if intGt(snom, 0) then 'shiftCounter="'+snom+'"'%>
<%if intGt(sres, 1) then 'resolution="'+sres+'"'%>
/></Clock>
Expand All @@ -334,9 +333,8 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fsub, denom=fsuper), shift=RATIONAL(nom=snom, denom=sres))) then
<<
<Clock><Periodic
intervalCounter="<%intMul(bic, sres)%>"
<%if intGt(fsub, 1) then 'subSampleFactor="'+fsub+'"'%>
<%if intGt(intMul(snom, fsuper), 0) then 'shiftCounter="'+intMul(snom, fsuper)+'"'%>
intervalCounter="<%intMul(intMul(bic, fsub), sres)%>"
<%if intGt(snom, 0) then 'shiftCounter="'+intMul(intMul(snom, resi), fsuper)+'"'%>
resolution="<%intMul(intMul(resi, sres), fsuper)%>"
/></Clock>
>>
Expand Down
6 changes: 6 additions & 0 deletions Compiler/Template/SimCodeTV.mo
Expand Up @@ -151,6 +151,12 @@ package builtin
output list<TypeVar> result;
end listAppend;

function realMul
input Real x;
input Real y;
output Real z;
end realMul;

function realDiv
input Real x;
input Real y;
Expand Down

0 comments on commit 4e260f5

Please sign in to comment.