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

Commit a633fbb

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
Apply resolution to shiftCounter in FMI model description
1 parent e844e3a commit a633fbb

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Compiler/Template/CodegenFMUCommon.tpl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,26 +318,28 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
318318
case REAL_CLOCK(interval=baseInterval as RCONST(real=bi)) then
319319
(subPartitions |> subPartition =>
320320
match subPartition
321-
case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fnom, denom=fres), shift=RATIONAL(nom=snom, denom=sres))) then
321+
case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fsub, denom=fsuper), shift=RATIONAL(nom=snom, denom=sres))) then
322322
<<
323323
<Clock><Periodic
324324
baseInterval="<%bi%>"
325-
<%if intGt(fnom, 1) then 'subSampleFactor="'+fnom+'"'%>
326-
<%if intGt(fres, 1) then 'superSampleFactor="'+fres+'"'%>
325+
<%if intGt(fsub, 1) then 'subSampleFactor="'+fsub+'"'%>
326+
<%if intGt(fsuper, 1) then 'superSampleFactor="'+fsuper+'"'%>
327327
<%if intGt(snom, 0) then 'shiftCounter="'+snom+'"'%>
328+
<%if intGt(sres, 1) then 'resolution="'+sres+'"'%>
328329
/></Clock>
329330
>>
330331
; separator="\n")
331332
case INTEGER_CLOCK(intervalCounter=ic as ICONST(integer=bic), resolution=res as ICONST(integer=resi)) then
332333
(subPartitions |> subPartition =>
333334
match subPartition
334-
case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fnom, denom=fres), shift=RATIONAL(nom=snom, denom=sres))) then
335+
case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fsub, denom=fsuper), shift=RATIONAL(nom=snom, denom=sres))) then
335336
<<
336337
<Clock><Periodic
337-
intervalCounter="<%bic%>"
338-
resolution="<%resi%>"
339-
<%if intGt(fnom, 1) then 'subSampleFactor="'+fnom+'"'%>
338+
intervalCounter="<%intMul(bic, sres)%>"
339+
<%if intGt(fsub, 1) then 'subSampleFactor="'+fsub+'"'%>
340+
<%if intGt(fsuper, 1) then 'superSampleFactor="'+fsuper+'"'%>
340341
<%if intGt(snom, 0) then 'shiftCounter="'+snom+'"'%>
342+
resolution="<%intMul(resi, sres)%>"
341343
/></Clock>
342344
>>
343345
; separator="\n")

0 commit comments

Comments
 (0)