@@ -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 >>
458458end ScalarVariableAttribute2;
0 commit comments