Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openmodelica/interactive-API/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ GetComponents.mos \
getDialogAnnotation.mos \
IfStatementIllegal.mos \
IfStatement.mos\
importFMUModelDescription.mos \
interactive_api_annotations.mos \
interactive_api_attributes.mos \
interactive_api_calls.mos \
Expand Down
18 changes: 18 additions & 0 deletions openmodelica/interactive-API/importFMUModelDescription.mos
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// name: API-Interactive Calls
// keywords: Graphical API, import FMU model description
// status: correct
//
// Subset of the Graphical API for importing FMU model description
//


importFMUModeldescription(modelDescription.xml);
readFile("Modelica_Blocks_Math_Gain_Input_Output_FMU.mo");

// Result:
//
// "model Modelica_Blocks_Math_Gain_me_FMU \"Output the product of a gain value with the input signal\"
// Modelica.Blocks.Interfaces.RealInput u \"Input signal connector\" annotation(Placement(transformation(extent={{-120,60},{-100,80}})));
// Modelica.Blocks.Interfaces.RealOutput y \"Output signal connector\" annotation(Placement(transformation(extent={{100,60},{120,80}})));
// end Modelica_Blocks_Math_Gain_me_FMU;"
// endResult
64 changes: 64 additions & 0 deletions openmodelica/interactive-API/modelDescription.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<fmiModelDescription
fmiVersion="2.0"
modelName="Modelica.Blocks.Math.Gain"
guid="{7d869a2a-fbc4-4e1a-b7bc-ec1129abcb04}"
description="Output the product of a gain value with the input signal"
generationTool="OpenModelica Compiler OpenModelica v1.11.0-dev-77-g863a98b"
generationDateAndTime="2016-09-28T13:08:18Z"
variableNamingConvention="structured"
numberOfEventIndicators="0">
<ModelExchange
modelIdentifier="Modelica_Blocks_Math_Gain">
</ModelExchange>
<LogCategories>
<Category name="logEvents" />
<Category name="logSingularLinearSystems" />
<Category name="logNonlinearSystems" />
<Category name="logDynamicStateSelection" />
<Category name="logStatusWarning" />
<Category name="logStatusDiscard" />
<Category name="logStatusError" />
<Category name="logStatusFatal" />
<Category name="logStatusPending" />
<Category name="logAll" />
<Category name="logFmi2Call" />
</LogCategories>
<DefaultExperiment startTime="0.0" stopTime="1.0" tolerance="1e-006"/>
<ModelVariables>
<!-- Index of variable = "1" -->
<ScalarVariable
name="u"
valueReference="0"
description="Input signal connector"
variability="continuous"
causality="input"
>
<Real start="0.0"/>
</ScalarVariable>
<!-- Index of variable = "2" -->
<ScalarVariable
name="y"
valueReference="1"
description="Output signal connector"
variability="continuous"
causality="output"
initial="calculated">
<Real/>
</ScalarVariable>
<!-- Index of variable = "3" -->
<ScalarVariable
name="k"
valueReference="2"
description="Gain value multiplied with input signal"
variability="fixed"
causality="parameter"
initial="exact">
<Real start="1.0"/>
</ScalarVariable>
</ModelVariables>
<ModelStructure>
<Outputs>
</Outputs>
</ModelStructure>
</fmiModelDescription>