-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gen-mcl: Only generate network when string/binary variables present i…
…n FMU. Signed-off-by: Timothy Rule (VM/EMT3) <[email protected]>
- Loading branch information
1 parent
cfbd900
commit e795f10
Showing
5 changed files
with
134 additions
and
25 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
extra/tools/fmi/cmd/fmi/testdata/script/gen-mcl_network.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
env FMUXML=$REPO_DIR/extra/tools/fmi/test/testdata/fmimcl/fmimcl_network.xml | ||
|
||
# Create the simulation folder (Simer layout) | ||
env | ||
mkdir sim/lib | ||
exec touch sim/lib/libfmimcl.so | ||
mkdir sim/fmu/fmi2fmu | ||
mkdir sim/fmu/fmi2fmu/binaries/linux64 | ||
mkdir sim/fmu/fmi2fmu/resources | ||
cp $FMUXML sim/fmu/fmi2fmu/modelDescription.xml | ||
exec touch sim/fmu/fmi2fmu/binaries/linux64/libfmi2fmu.so | ||
exec ls -R $WORK/sim | ||
|
||
# Generate the FMI MCL configuration | ||
env | ||
cd sim | ||
exec fmi gen-mcl -fmu fmu/fmi2fmu -outdir model/fmi2fmu -mcl lib/libfmimcl.so | ||
cd .. | ||
exec ls -R $WORK/sim | ||
exists sim/model/fmi2fmu/model.yaml | ||
|
||
# Check the generated files | ||
exec cat sim/model/fmi2fmu/model.yaml | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.kind Model | ||
|
||
yamlcontains sim/model/fmi2fmu/model.yaml $.metadata.name Test | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.metadata.annotations.fmi_guid {0bc3244a-e274-4c4a-8205-b2a5a18af23a} | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.metadata.annotations.fmi_model_cosim true | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.metadata.annotations.fmi_model_version 1.1 | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.metadata.annotations.fmi_resource_dir fmu/fmi2fmu/resources | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.metadata.annotations.fmi_stepsize 0.0005 | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.metadata.annotations.mcl_adapter fmi | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.metadata.annotations.mcl_version 2.0 | ||
|
||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.channels[0].alias signal_channel | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.channels[0].selectors.model Test | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.channels[0].selectors.channel signal_vector | ||
|
||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.channels[1].alias network_channel | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.channels[1].selectors.model Test | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.channels[1].selectors.channel network_vector | ||
|
||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.runtime.dynlib[0].arch amd64 | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.runtime.dynlib[0].os linux | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.runtime.dynlib[0].path lib/libfmimcl.so | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.runtime.mcl[0].arch amd64 | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.runtime.mcl[0].os linux | ||
yamlcontains sim/model/fmi2fmu/model.yaml $.spec.runtime.mcl[0].path fmu/fmi2fmu/binaries/linux64/target.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<fmiModelDescription fmiVersion="2.0" modelName="Test" guid="{0bc3244a-e274-4c4a-8205-b2a5a18af23a}" | ||
description="" author="" version="1.1" generationTool="" generationDateAndTime="" | ||
variableNamingConvention="" numberOfEventIndicators=""> | ||
<CoSimulation modelIdentifier="target" canHandleVariableCommunicationStepSize="" | ||
canInterpolateInputs=""></CoSimulation> | ||
<DefaultExperiment startTime="0" stopTime="42" stepSize="0.0005"></DefaultExperiment> | ||
<ModelVariables> | ||
<ScalarVariable name="scalar_1" valueReference="1" causality="input" initial="" | ||
variability=""> | ||
<Real start="42" reinit="" derivative=""></Real> | ||
</ScalarVariable> | ||
<ScalarVariable name="scalar_2" valueReference="2" causality="output" initial="" | ||
variability=""> | ||
<Real></Real> | ||
</ScalarVariable> | ||
<ScalarVariable name="scalar_3" valueReference="3" initial="" variability=""> | ||
<Real></Real> | ||
</ScalarVariable> | ||
<ScalarVariable name="boolean_1" valueReference="4" causality="input" variability="discrete"> | ||
<Boolean start="false"></Boolean> | ||
</ScalarVariable> | ||
<ScalarVariable name="boolean_2" valueReference="5" causality="output" variability=""> | ||
<Boolean></Boolean> | ||
</ScalarVariable> | ||
<ScalarVariable name="scalar_4" valueReference="6" causality="local" initial="" | ||
variability=""> | ||
<Real></Real> | ||
</ScalarVariable> | ||
<ScalarVariable name="string_7" valueReference="7" causality="input" initial="" | ||
variability=""> | ||
<String></String> | ||
</ScalarVariable> | ||
<ScalarVariable name="string_8" valueReference="8" causality="output" initial="" | ||
variability=""> | ||
<String></String> | ||
</ScalarVariable> | ||
</ModelVariables> | ||
<ModelStructure> | ||
<Outputs></Outputs> | ||
<Derivatives></Derivatives> | ||
<InitialUnknowns></InitialUnknowns> | ||
</ModelStructure> | ||
</fmiModelDescription> |