Skip to content

Commit

Permalink
Specify version="1.0" when testing FMI 1.0
Browse files Browse the repository at this point in the history
The front-end is changing to make 2.0 the default for FMI, so we need
to update the tests.
  • Loading branch information
sjoelund committed Nov 9, 2015
1 parent 1a8f583 commit 19fe9a1
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 33 deletions.
Expand Up @@ -7,7 +7,7 @@
loadModel(Modelica); getErrorString();
setCommandLineOptions("+simCodeTarget=Cpp"); getErrorString();
loadFile("CoupledClutches.mo"); getErrorString();
translateModelFMU(CoupledClutches); getErrorString();
translateModelFMU(CoupledClutches, version="1.0"); getErrorString();

setCommandLineOptions("+simCodeTarget=C"); getErrorString();
importFMU("CoupledClutches.fmu"); getErrorString();
Expand Down
Expand Up @@ -6,7 +6,7 @@
loadModel(Modelica); getErrorString();
setCommandLineOptions("+simCodeTarget=Cpp"); getErrorString();
loadFile("cranes.mo"); getErrorString();
translateModelFMU(cranes.crane); getErrorString();
translateModelFMU(cranes.crane, version="1.0"); getErrorString();

setCommandLineOptions("+simCodeTarget=C"); getErrorString();
//importFMU("cranes_crane.fmu", "<default>", 6, false, true); getErrorString();
Expand Down
Expand Up @@ -20,7 +20,7 @@ equation
der(y2) = y1;
end DIC;
");
translateModelFMU(DIC); getErrorString();
translateModelFMU(DIC, version="1.0"); getErrorString();

loadModel(Modelica); getErrorString();
setCommandLineOptions("+simCodeTarget=C"); getErrorString();
Expand Down
Expand Up @@ -8,7 +8,7 @@

loadModel(Modelica, {"3.2.1"}); getErrorString();
setCommandLineOptions("+simCodeTarget=Cpp"); getErrorString();
translateModelFMU(Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString();
translateModelFMU(Modelica.Fluid.Examples.BranchingDynamicPipes, version="1.0"); getErrorString();

setCommandLineOptions("+simCodeTarget=C"); getErrorString();
importFMU("Modelica_Fluid_Examples_BranchingDynamicPipes.fmu"); getErrorString();
Expand Down
2 changes: 1 addition & 1 deletion openmodelica/fmi/ModelExchange/1.0/BooleanNetwork1.mos
Expand Up @@ -15,7 +15,7 @@ val(y4, 10);
val(Q, 10);
val(QI, 10);

translateModelFMU(BooleanNetwork1); getErrorString();
translateModelFMU(BooleanNetwork1, version="1.0"); getErrorString();

importFMU("BooleanNetwork1.fmu"); getErrorString();
loadFile("BooleanNetwork1_me_FMU.mo"); getErrorString();
Expand Down
3 changes: 2 additions & 1 deletion openmodelica/fmi/ModelExchange/1.0/BouncingBall.mos
Expand Up @@ -6,7 +6,8 @@
//
setCFlags(getCFlags() + " -g"); getErrorString();
loadFile("BouncingBall.mo"); getErrorString();
if ""==translateModelFMU(BouncingBall) then

if ""==translateModelFMU(BouncingBall, version="1.0") then
print(getErrorString());
exit(1);
end if;
Expand Down
2 changes: 1 addition & 1 deletion openmodelica/fmi/ModelExchange/1.0/CoupledClutches.mos
Expand Up @@ -6,7 +6,7 @@

loadModel(Modelica); getErrorString();
loadFile("CoupledClutches.mo"); getErrorString();
translateModelFMU(CoupledClutches); getErrorString();
translateModelFMU(CoupledClutches, version="1.0"); getErrorString();

importFMU("CoupledClutches.fmu"); getErrorString();
loadFile("CoupledClutches_me_FMU.mo"); getErrorString();
Expand Down
4 changes: 2 additions & 2 deletions openmodelica/fmi/ModelExchange/1.0/EnumerationTest.mos
Expand Up @@ -5,11 +5,11 @@
//
// String(Enum.e1)
//
//
//

loadFile("EnumerationTest.mo");
//instantiateModel(EnumerationTest);
translateModelFMU(EnumerationTest);
translateModelFMU(EnumerationTest, version="1.0");
getErrorString();

importFMU("EnumerationTest.fmu"); getErrorString();
Expand Down
2 changes: 1 addition & 1 deletion openmodelica/fmi/ModelExchange/1.0/HelloFMIWorld.mos
Expand Up @@ -6,7 +6,7 @@
//

loadFile("HelloFMIWorld.mo");
translateModelFMU(HelloFMIWorld);
translateModelFMU(HelloFMIWorld, version="1.0");
getErrorString();
importFMU("HelloFMIWorld.fmu");
loadFile("HelloFMIWorld_me_FMU.mo");
Expand Down
4 changes: 2 additions & 2 deletions openmodelica/fmi/ModelExchange/1.0/InOutTest.mos
Expand Up @@ -2,12 +2,12 @@
// keywords: FMU Export Import
// status: correct
// teardown_command: rm -rf binaries sources modelDescription.xml InOutTest.fmu InOutTest_* testInOut_* InOutTest_me_FMU.mo InOutTest.libs testInOut.libs InOutTest.lib testInOut.lib InOutTest.so testInOut.so InOutTest.dll testInOut.dll InOutTest.c testInOut.c testInOut.makefile
// Simulation Results
// Simulation Results
//

loadModel(Modelica);getErrorString();
loadFile("InOutTest.mo");getErrorString();
translateModelFMU(InOutTest);getErrorString();
translateModelFMU(InOutTest, version="1.0");getErrorString();
importFMU("InOutTest.fmu");getErrorString();
loadFile("InOutTest_me_FMU.mo");getErrorString();
loadFile("testInOut.mo");getErrorString();
Expand Down
2 changes: 1 addition & 1 deletion openmodelica/fmi/ModelExchange/1.0/IntegerNetwork1.mos
Expand Up @@ -6,7 +6,7 @@

loadModel(Modelica); getErrorString();
loadFile("IntegerNetwork1.mo"); getErrorString();
translateModelFMU(IntegerNetwork1); getErrorString();
translateModelFMU(IntegerNetwork1, version="1.0"); getErrorString();

importFMU("IntegerNetwork1.fmu"); getErrorString();
loadFile("IntegerNetwork1_me_FMU.mo"); getErrorString();
Expand Down
2 changes: 1 addition & 1 deletion openmodelica/fmi/ModelExchange/1.0/JuliansBib.mos
Expand Up @@ -20,7 +20,7 @@ val(s, 0);
val(s, 1);


translateModelFMU(JuliansBib.Connector_Hebelarm_einfach);
translateModelFMU(JuliansBib.Connector_Hebelarm_einfach, version="1.0");
getErrorString();
importFMU("JuliansBib_Connector_Hebelarm_einfach.fmu");
getErrorString();
Expand Down
Expand Up @@ -2,12 +2,12 @@
// keywords: simulation MSL Examples
// status: correct
// teardown_command: rm -rf binaries sources modelDescription.xml Modelica_Blocks_Sources_BooleanPulse.fmu Modelica_Blocks_Sources_BooleanPulse_* Modelica.Blocks.Sources.BooleanPulse_* Modelica_Blocks_Sources_BooleanPulse_me_FMU.mo Modelica_Blocks_Sources_BooleanPulse.libs Modelica_Blocks_Sources_BooleanPulse.lib Modelica_Blocks_Sources_BooleanPulse.so Modelica_Blocks_Sources_BooleanPulse.dll Modelica_Blocks_Sources_BooleanPulse.c Modelica_Blocks_Sources_BooleanPulse.makefile
// Simulation Results
// Simulation Results
// Modelica Standard Library
//

loadModel(Modelica);
translateModelFMU(Modelica.Blocks.Sources.BooleanPulse);
translateModelFMU(Modelica.Blocks.Sources.BooleanPulse, version="1.0");
getErrorString();

importFMU("Modelica_Blocks_Sources_BooleanPulse.fmu"); getErrorString();
Expand Down
Expand Up @@ -2,12 +2,12 @@
// keywords: simulation MSL Examples
// status: correct
// teardown_command: rm -rf binaries sources modelDescription.xml Modelica_Electrical_Analog_Examples_ChuaCircuit.fmu Modelica_Electrical_Analog_Examples_ChuaCircuit_* Modelica_Electrical_Analog_Examples_ChuaCircuit_me_FMU.mo Modelica_Electrical_Analog_Examples_ChuaCircuit.libs Modelica_Electrical_Analog_Examples_ChuaCircuit.lib Modelica_Electrical_Analog_Examples_ChuaCircuit.so Modelica_Electrical_Analog_Examples_ChuaCircuit.dll Modelica_Electrical_Analog_Examples_ChuaCircuit.c Modelica_Electrical_Analog_Examples_ChuaCircuit.makefile
// Simulation Results
// Simulation Results
// Modelica Standard Library
//

loadModel(Modelica,{"3.1"});
translateModelFMU(Modelica.Electrical.Analog.Examples.ChuaCircuit);
translateModelFMU(Modelica.Electrical.Analog.Examples.ChuaCircuit, version="1.0");
getErrorString();

importFMU("Modelica_Electrical_Analog_Examples_ChuaCircuit.fmu"); getErrorString();
Expand Down
Expand Up @@ -2,12 +2,12 @@
// keywords: simulation MSL Examples
// status: correct
// teardown_command: rm -rf binaries sources modelDescription.xml Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum.fmu Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum_* Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum_me_FMU.mo Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum.libs Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum.lib BouncingBall.so Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum.dll Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum.c Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum.makefile Modelica_from_nxy_*
// Simulation Results
// Simulation Results
// Modelica Standard Library
//

loadModel(Modelica);
translateModelFMU(Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum);
translateModelFMU(Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum, version="1.0");
getErrorString();
importFMU("Modelica_Mechanics_MultiBody_Examples_Elementary_DoublePendulum.fmu", loglevel=0);
getErrorString();
Expand Down
Expand Up @@ -2,12 +2,12 @@
// keywords: simulation MSL Examples
// status: correct
// teardown_command: rm -rf binaries sources modelDescription.xml Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum.fmu Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum_* Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum_me_FMU.mo Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum.libs Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum.lib Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum.so Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum.dll Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum.c Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum.makefile Modelica_from_nxy_*
// Simulation Results
// Simulation Results
// Modelica Standard Library
//

loadModel(Modelica); getErrorString();
translateModelFMU(Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum); getErrorString();
translateModelFMU(Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum, version="1.0"); getErrorString();
importFMU("Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum.fmu", loglevel=0); getErrorString();
loadFile("Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum_me_FMU.mo"); getErrorString();
simulate(Modelica_Mechanics_MultiBody_Examples_Elementary_Pendulum_me_FMU,stopTime=3.0); getErrorString();
Expand Down
4 changes: 2 additions & 2 deletions openmodelica/fmi/ModelExchange/1.0/Pendulum.mos
Expand Up @@ -3,12 +3,12 @@
// status: correct
// teardown_command: rm -rf Pendulum.c Pendulum Pendulum.exe Pendulum.libs Pendulum.lib Pendulum.fmu Pendulum.log Pendulum.makefile Pendulum_*.*
//
//
//
// Tests handling of Dynamic State Selection in FMU
//

loadFile("Pendulum.mo");
translateModelFMU(Pendulum);
translateModelFMU(Pendulum, version="1.0");
getErrorString();
importFMU("Pendulum.fmu");
getErrorString();
Expand Down
4 changes: 2 additions & 2 deletions openmodelica/fmi/ModelExchange/1.0/SampleExample.mos
Expand Up @@ -11,12 +11,12 @@ model SampleEvent
Integer i;
equation
der(x) = 1*x;
when sample(0,0.1) then
when sample(0,0.1) then
i = pre(i)+1;
end when;
end SampleEvent;
");
translateModelFMU(SampleEvent);
translateModelFMU(SampleEvent, version="1.0");
getErrorString();
importFMU("SampleEvent.fmu");
loadFile("SampleEvent_me_FMU.mo");
Expand Down
2 changes: 1 addition & 1 deletion openmodelica/fmi/ModelExchange/1.0/StringParameters.mos
Expand Up @@ -6,7 +6,7 @@
//
setCFlags(getCFlags() + " -g"); getErrorString();
loadFile("StringParameters.mo"); getErrorString();
translateModelFMU(StringParameters); getErrorString();
translateModelFMU(StringParameters, version="1.0"); getErrorString();
importFMU("StringParameters.fmu"); getErrorString();
loadFile("StringParameters_me_FMU.mo"); getErrorString();
simulate(StringParameters_me_FMU, stopTime=3.0, simflags="-output=sball,eball"); getErrorString();
Expand Down
6 changes: 3 additions & 3 deletions openmodelica/fmi/ModelExchange/1.0/TanksConnectedPI.mos
Expand Up @@ -2,14 +2,14 @@
// keywords: fmu export import
// status: correct
// teardown_command: rm -rf binaries sources modelDescription.xml TanksConnectedPI.fmu _TanksConnectedPI* TanksConnectedPI_* TanksConnectedPI.libs TanksConnectedPI.lib TanksConnectedPI TanksConnectedPI.exe TanksConnectedPI.so TanksConnectedPI.dll TanksConnectedPI.c TanksConnectedPI.makefile output.log TanksConnectedPI/*
//
//

loadFile("TanksConnectedPI.mo");
translateModelFMU(TanksConnectedPI);
translateModelFMU(TanksConnectedPI, version="1.0");
importFMU("TanksConnectedPI.fmu");
loadFile("TanksConnectedPI_me_FMU.mo");
simulate(TanksConnectedPI_me_FMU,stopTime=210,numberOfIntervals=250, tolerance=1e-5);
echo(false); // turns of output
echo(false); // turns of output

x:=val(tank1_h,25.0);
y:=val(tank1_h,100.0);
Expand Down
2 changes: 1 addition & 1 deletion openmodelica/fmi/ModelExchange/1.0/testAssert.mos
Expand Up @@ -12,7 +12,7 @@ equation
assert(x < 1.5, \"x is too big at time = \" + String(time));
end testAssertFMI;
");
translateModelFMU(testAssertFMI);
translateModelFMU(testAssertFMI, version="1.0");
getErrorString();
importFMU("testAssertFMI.fmu");
loadFile("testAssertFMI_me_FMU.mo");
Expand Down
4 changes: 2 additions & 2 deletions openmodelica/fmi/ModelExchange/1.0/testChangeParam.mos
Expand Up @@ -17,7 +17,7 @@ model test_ChangeParam
equation
der(x) = x*a+u;
y = if b then der(x)-x-i else der(x)+x+i;
when time>1 then
when time>1 then
terminate(\"Simulation done by \" + s);
end when;
annotation(experiment(StopTime=2));
Expand All @@ -27,7 +27,7 @@ getErrorString();
loadModel(Modelica);


translateModelFMU(test_ChangeParam, version="2.0");
translateModelFMU(test_ChangeParam, version="1.0");
getErrorString();
importFMU("test_ChangeParam.fmu");

Expand Down

0 comments on commit 19fe9a1

Please sign in to comment.