Skip to content

Commit 463e40e

Browse files
committed
change order of clocked variable attributes
1 parent b71ca8a commit 463e40e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Compiler/Template/CodegenFMUCommon.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,18 +441,18 @@ match simVar
441441
let valueReference = '<%System.tmpTick()%>'
442442
let description = if comment then 'description="<%Util.escapeModelicaStringToXmlString(comment)%>"'
443443
let variability = if getClockIndex(simVar, simCode) then "discrete" else getVariability2(varKind, type_)
444-
let caus = getCausality2(causality, varKind, isValueChangeable)
445-
let initial = getInitialType2(variability, caus, initialValue)
446444
let clockIndex = getClockIndex(simVar, simCode)
447445
let previous = match varKind case CLOCKED_STATE(__) then '<%getVariableIndex(cref2simvar(previousName, simCode))%>'
446+
let caus = getCausality2(causality, varKind, isValueChangeable)
447+
let initial = getInitialType2(variability, caus, initialValue)
448448
<<
449449
name="<%System.stringReplace(crefStrNoUnderscore(name),"$", "_D_")%>"
450450
valueReference="<%valueReference%>"
451-
<%if boolNot(stringEq(clockIndex, "")) then 'clockIndex="'+clockIndex+'"' %>
452-
<%if boolNot(stringEq(previous, "")) then 'previous="'+previous+'"' %>
453451
<%description%>
454452
variability="<%variability%>"
455453
causality="<%caus%>"
454+
<%if boolNot(stringEq(clockIndex, "")) then 'clockIndex="'+clockIndex+'"' %>
455+
<%if boolNot(stringEq(previous, "")) then 'previous="'+previous+'"' %>
456456
<%if boolNot(stringEq(initial, "")) then 'initial="'+initial+'"' %>
457457
>>
458458
end ScalarVariableAttribute2;

0 commit comments

Comments
 (0)