From a633fbbc23cff6f4684dee82a8dc51c85216b410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Franke?= Date: Sat, 23 Sep 2017 21:24:59 +0200 Subject: [PATCH] Apply resolution to shiftCounter in FMI model description --- Compiler/Template/CodegenFMUCommon.tpl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Compiler/Template/CodegenFMUCommon.tpl b/Compiler/Template/CodegenFMUCommon.tpl index 0feb47b32a2..740087b366e 100644 --- a/Compiler/Template/CodegenFMUCommon.tpl +++ b/Compiler/Template/CodegenFMUCommon.tpl @@ -318,26 +318,28 @@ case SIMCODE(modelInfo = MODELINFO(__)) then case REAL_CLOCK(interval=baseInterval as RCONST(real=bi)) then (subPartitions |> subPartition => match subPartition - case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fnom, denom=fres), shift=RATIONAL(nom=snom, denom=sres))) then + case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fsub, denom=fsuper), shift=RATIONAL(nom=snom, denom=sres))) then << - <%if intGt(fres, 1) then 'superSampleFactor="'+fres+'"'%> + <%if intGt(fsub, 1) then 'subSampleFactor="'+fsub+'"'%> + <%if intGt(fsuper, 1) then 'superSampleFactor="'+fsuper+'"'%> <%if intGt(snom, 0) then 'shiftCounter="'+snom+'"'%> + <%if intGt(sres, 1) then 'resolution="'+sres+'"'%> /> >> ; separator="\n") case INTEGER_CLOCK(intervalCounter=ic as ICONST(integer=bic), resolution=res as ICONST(integer=resi)) then (subPartitions |> subPartition => match subPartition - case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fnom, denom=fres), shift=RATIONAL(nom=snom, denom=sres))) then + case SUBPARTITION(subClock=SUBCLOCK(factor=RATIONAL(nom=fsub, denom=fsuper), shift=RATIONAL(nom=snom, denom=sres))) then << + intervalCounter="<%intMul(bic, sres)%>" + <%if intGt(fsub, 1) then 'subSampleFactor="'+fsub+'"'%> + <%if intGt(fsuper, 1) then 'superSampleFactor="'+fsuper+'"'%> <%if intGt(snom, 0) then 'shiftCounter="'+snom+'"'%> + resolution="<%intMul(resi, sres)%>" /> >> ; separator="\n")