Skip to content

Commit

Permalink
Disable default clock for FMI export
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke committed Apr 13, 2016
1 parent 8cf1a8f commit 12f928e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -9753,19 +9753,22 @@ end eventHandlingInit;
template clockIntervalsInit(SimCode simCode, Text& varDecls, Text& extraFuncs, Text& extraFuncsDecl, Text extraFuncsNamespace, Text stateDerVectorName /*=__zDot*/, Boolean useFlatArrayNotation)
::=
match simCode
case SIMCODE(modelInfo = MODELINFO(__)) then
case SIMCODE(modelInfo = MODELINFO(__), modelStructure = fmims) then
let i = tempDecl('int', &varDecls)
<<
<%i%> = 0;
<%(clockedPartitions |> partition =>
match partition
case CLOCKED_PARTITION(__) then
let &preExp = buffer "" /*BUFD*/
let intvl = match baseClock
let spec = daeExp(getClockInterval(baseClock), contextOther, &preExp, &varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
// use default clock, except for FMI clocks that may be inferred
let intvl = match fmims case SOME(FmiModelStructure) then spec else
match baseClock
case REAL_CLOCK()
case INTEGER_CLOCK()
case BOOLEAN_CLOCK() then
daeExp(getClockInterval(baseClock), contextOther, &preExp, &varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
spec
else "unspecified"
let interval = match intvl case "unspecified" then '1.0' else intvl
let warning = match intvl case "unspecified" then
Expand Down

0 comments on commit 12f928e

Please sign in to comment.