Skip to content

Commit

Permalink
- Add empty model structure tag to make the FMI 2.0 xml valid.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20855 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed May 27, 2014
1 parent 2222b7d commit 4b2e78f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Compiler/Template/CodegenFMU.tpl
Expand Up @@ -89,7 +89,7 @@ case SIMCODE(__) then
>>
end fmuModelDescriptionFile;

// Code for generating modelDescription.xml file for FMI 2.0.
// Code for generating modelDescription.xml file for FMI 2.0 ModelExchange.
template fmi2ModelDescription(SimCode simCode, String guid)
"Generates code for ModelDescription file for FMU target."
::=
Expand All @@ -104,6 +104,7 @@ case SIMCODE(__) then
<%TypeDefinitions(modelInfo, "2.0")%>
<%DefaultExperiment(simulationSettingsOpt)%>
<%ModelVariables(modelInfo, "2.0")%>
<%ModelStructure()%>
</fmiModelDescription>
>>
end fmi2ModelDescription;
Expand Down Expand Up @@ -150,12 +151,14 @@ template ScalarVariableAttribute2(SimVar simVar)
::=
match simVar
case SIMVAR(__) then
let ind = index
let valueReference = '<%System.tmpTick()%>'
let description = if comment then 'description="<%Util.escapeModelicaStringToXmlString(comment)%>"'
let variability = getVariability2(varKind)
let caus = getCausality2(causality, varKind, isValueChangeable)
let initial = hasStartValue(varKind, initialValue)
<<
index="<%ind%>"
name="<%System.stringReplace(crefStrNoUnderscore(name),"$", "_D_")%>"
valueReference="<%valueReference%>"
<%description%>
Expand Down Expand Up @@ -606,6 +609,14 @@ template externalFunction(Function fn)
>>
end externalFunction;

template ModelStructure()
"Generates Model Structure definitions."
::=
<<
<ModelStructure>
</ModelStructure>
>>
end ModelStructure;

template fmumodel_identifierFile(SimCode simCode, String guid, String FMUVersion)
"Generates code for ModelDescription file for FMU target."
Expand Down

0 comments on commit 4b2e78f

Please sign in to comment.