Skip to content

Commit

Permalink
Updates for loadFile with notifications for uses
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Mar 15, 2018
1 parent 8521723 commit f1296f3
Show file tree
Hide file tree
Showing 85 changed files with 237 additions and 281 deletions.
21 changes: 2 additions & 19 deletions flattening/libraries/3rdParty/Exercises/checkExercises.mos
@@ -1,25 +1,21 @@
// name: Exercises.* [checkModel]
// status: correct
// provided by Martin Otter
// provided by Martin Otter
//

loadModel(Modelica, {"3.2.1"}); getErrorString();

loadFile("1/Aufgabe1_1.mo"); getErrorString();
loadFiles({"1/Aufgabe1_1.mo","1/Aufgabe1_2.mo","2/Aufgabe2.mo","3/ServoSystem1/package.mo","4/ServoSystem3/package.mo","5/FourBar.mo"}); getErrorString();
checkModel(Aufgabe1_1); getErrorString();

loadFile("1/Aufgabe1_2.mo"); getErrorString();
checkModel(Aufgabe1_2); getErrorString();

loadFile("2/Aufgabe2.mo"); getErrorString();
checkModel(Aufgabe2.Test1); getErrorString();
checkModel(Aufgabe2.Test2); getErrorString();

loadFile("3/ServoSystem1/package.mo"); getErrorString();
checkModel(ServoSystem1.Aufgabe3_2); getErrorString();
checkModel(ServoSystem1.Aufgabe3_3); getErrorString();

loadFile("4/ServoSystem3/package.mo"); getErrorString();
checkModel(ServoSystem3.Aufgabe3_2); getErrorString();
checkModel(ServoSystem3.Aufgabe3_3); getErrorString();
checkModel(ServoSystem3.Aufgabe4_1); getErrorString();
Expand All @@ -29,7 +25,6 @@ checkModel(ServoSystem3.Aufgabe4_3b); getErrorString();
checkModel(ServoSystem3.Aufgabe4_4a); getErrorString();
checkModel(ServoSystem3.Aufgabe4_4b); getErrorString();

loadFile("5/FourBar.mo"); getErrorString();
checkModel(FourBar.TestPlanarLoops); getErrorString();


Expand All @@ -43,15 +38,11 @@ checkModel(FourBar.TestPlanarLoops); getErrorString();
// 39 of these are trivial equation(s)."
// "Warning: Requested package Modelica of version 3.2, but this package was already loaded with version 3.2.1. You might experience problems if these versions are incompatible.
// "
// true
// ""
// "Check of Aufgabe1_2 completed successfully.
// Class Aufgabe1_2 has 89 equation(s) and 89 variable(s).
// 61 of these are trivial equation(s)."
// "Warning: Requested package Modelica of version 3.2, but this package was already loaded with version 3.2.1. You might experience problems if these versions are incompatible.
// "
// true
// ""
// "Check of Aufgabe2.Test1 completed successfully.
// Class Aufgabe2.Test1 has 22 equation(s) and 22 variable(s).
// 14 of these are trivial equation(s)."
Expand All @@ -60,9 +51,6 @@ checkModel(FourBar.TestPlanarLoops); getErrorString();
// Class Aufgabe2.Test2 has 46 equation(s) and 46 variable(s).
// 36 of these are trivial equation(s)."
// ""
// true
// "Warning: Requested package Modelica of version 3.2, but this package was already loaded with version 3.2.1. You might experience problems if these versions are incompatible.
// "
// "Check of ServoSystem1.Aufgabe3_2 completed successfully.
// Class ServoSystem1.Aufgabe3_2 has 547 equation(s) and 547 variable(s).
// 395 of these are trivial equation(s)."
Expand All @@ -71,9 +59,6 @@ checkModel(FourBar.TestPlanarLoops); getErrorString();
// Class ServoSystem1.Aufgabe3_3 has 547 equation(s) and 547 variable(s).
// 395 of these are trivial equation(s)."
// ""
// true
// "Warning: Requested package Modelica of version 3.2, but this package was already loaded with version 3.2.1. You might experience problems if these versions are incompatible.
// "
// "Check of ServoSystem3.Aufgabe3_2 completed successfully.
// Class ServoSystem3.Aufgabe3_2 has 547 equation(s) and 547 variable(s).
// 395 of these are trivial equation(s)."
Expand Down Expand Up @@ -106,8 +91,6 @@ checkModel(FourBar.TestPlanarLoops); getErrorString();
// Class ServoSystem3.Aufgabe4_4b has 1888 equation(s) and 1888 variable(s).
// 1329 of these are trivial equation(s)."
// ""
// true
// ""
// "Check of FourBar.TestPlanarLoops completed successfully.
// Class FourBar.TestPlanarLoops has 1912 equation(s) and 1912 variable(s).
// 1299 of these are trivial equation(s)."
Expand Down
Expand Up @@ -3741,8 +3741,8 @@ package PlanarMechanicsForTesting
lineColor={0,0,0})}));
end AbsoluteRotation;
end Sensors;
annotation (uses( Visualization(version="1.1"),
Modelica(version="3.2")), Documentation(revisions="<html>
annotation (uses(
Modelica(version="3.1" /* Was 3.2 */)), Documentation(revisions="<html>
<p>(c) Copyright by Dirk Zimmer</p>
<p>The library was creates and is owned by Dr. Dirk Zimmer. </p>
<p>dirk.zimmer@dlr.de</p>
Expand Down
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/ParameterBug.mo
Expand Up @@ -6,7 +6,7 @@ package ParameterBug
equation

end A;
annotation (uses(Modelica(version="3.2")));

model B
parameter Real offset = 0;
replaceable C c(final offset = offset);
Expand Down
2 changes: 0 additions & 2 deletions openmodelica/cppruntime/fmu/modelExchange/1.0/cranes.mo
Expand Up @@ -170,6 +170,4 @@ package cranes
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{
-100,-100},{100,100}}), graphics));
end crane_input;
annotation (uses(Modelica(version="3.2.2"), Modelica_DeviceDrivers(version=
"1.2")));
end cranes;
12 changes: 6 additions & 6 deletions openmodelica/fmi/ModelExchange/1.0/JuliansBib.mo
Expand Up @@ -51,7 +51,7 @@ package JuliansBib
reinit(Winkelgeschwindigkeit,0);
end when;

annotation (uses(Modelica(version="3.2")), Icon(coordinateSystem(
annotation (uses(Modelica(version="3.2.1")), Icon(coordinateSystem(
preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={
Ellipse(
extent={{-60,60},{60,-60}},
Expand Down Expand Up @@ -336,7 +336,7 @@ package JuliansBib
points={{30,0},{10,0},{10,-20},{30,-20}},
color={0,0,0},
smooth=Smooth.None));
annotation (uses(Modelica(version="3.2")), Diagram(coordinateSystem(
annotation (uses(Modelica(version="3.2.1")), Diagram(coordinateSystem(
preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics));
end Test_Reibung;

Expand Down Expand Up @@ -690,7 +690,7 @@ package JuliansBib
thickness=0.5,
smooth=Smooth.None));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics), uses(Modelica(version="3.2")),
-100},{100,100}}), graphics), uses(Modelica(version="3.2.1")),
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics={
Ellipse(
Expand Down Expand Up @@ -1234,7 +1234,7 @@ package JuliansBib
points={{-20,0},{20,0}},
color={0,127,0},
smooth=Smooth.None));
annotation (uses(Modelica(version="3.2")), Diagram(coordinateSystem(
annotation (uses(Modelica(version="3.2.1")), Diagram(coordinateSystem(
preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics));
end DceMechInConnector;
Expand Down Expand Up @@ -1388,7 +1388,7 @@ package JuliansBib
points={{90,72},{90,72}},
color={0,0,127},
smooth=Smooth.None),
uses(Modelica(version = "3.2")), Diagram(coordinateSystem(
uses(Modelica(version = "3.2.1")), Diagram(coordinateSystem(
preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics),
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
100}}), graphics));
Expand Down Expand Up @@ -2409,5 +2409,5 @@ package JuliansBib
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics));
end DceMechOutConnectorII;
annotation (uses(Modelica(version="3.2")));
annotation (uses(Modelica(version="3.2.1")));
end JuliansBib;
8 changes: 4 additions & 4 deletions openmodelica/fmi/ModelExchange/1.0/JuliansBib.mos
Expand Up @@ -3,7 +3,6 @@
// status: correct
// teardown_command: rm -rf binaries sources modelDescription.xml JuliansBib_Connector_Hebelarm_einfach.fmu JuliansBib_Connector_Hebelarm_einfach_* JuliansBib_Connector_Hebelarm_einfach_* JuliansBib_Connector_Hebelarm_einfach.libs JuliansBib_Connector_Hebelarm_einfach.lib JuliansBib_Connector_Hebelarm_einfach JuliansBib_Connector_Hebelarm_einfach.exe JuliansBib_Connector_Hebelarm_einfach.so JuliansBib_Connector_Hebelarm_einfach.dll JuliansBib_Connector_Hebelarm_einfach.c JuliansBib_Connector_Hebelarm_einfach.makefile JuliansBib.Connector_Hebelarm_einfach_*

loadModel(Modelica); getErrorString();
loadFile("PlanarMechanicsStandard.mo"); getErrorString();
loadFile("JuliansBib.mo"); getErrorString();

Expand Down Expand Up @@ -34,9 +33,10 @@ val(s, 1);

// Result:
// true
// ""
// true
// ""
// "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation.
// Notification: Automatically loaded package Complex 3.2.1 due to uses annotation.
// Notification: Automatically loaded package ModelicaServices 3.2.1 due to uses annotation.
// "
// true
// ""
// record SimulationResult
Expand Down
4 changes: 2 additions & 2 deletions openmodelica/fmi/ModelExchange/1.0/PlanarMechanicsStandard.mo
Expand Up @@ -3691,8 +3691,8 @@ package PlanarMechanicsStandard
<p>dirk.zimmer@dlr.de</p>
</html>"));
end Examples;
annotation (uses( Visualization(version="1.1"),
Modelica(version="3.2")), Documentation(revisions="<html>
annotation (uses(
Modelica(version="3.2.1")), Documentation(revisions="<html>
</html>", info="<html>
<p>
<b>Licensed by tDirk Zimmer under the Modelica License 2</b><br>
Expand Down
3 changes: 1 addition & 2 deletions openmodelica/interactive-API/Bug3783.mo
@@ -1,5 +1,4 @@
model Bug3783
replaceable package liquid = Modelica.Media.Water.StandardWater;
Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p=100) annotation(Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
annotation(uses(Modelica(version = "3.2.1")));
end Bug3783;
end Bug3783;
6 changes: 0 additions & 6 deletions openmodelica/interactive-API/Bug3783.mos
Expand Up @@ -20,8 +20,6 @@ list(Bug3783); getErrorString();
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p = 100) annotation(
// Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(
// uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// "remove modifiers except redeclares"
Expand All @@ -31,8 +29,6 @@ list(Bug3783); getErrorString();
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid) annotation(
// Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(
// uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// Ok
Expand All @@ -45,8 +41,6 @@ list(Bug3783); getErrorString();
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p = 10e5) annotation(
// Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(
// uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// endResult
2 changes: 1 addition & 1 deletion simulation/libraries/3rdParty/Exercises/1/Aufgabe1_1.mo
Expand Up @@ -43,7 +43,7 @@ equation
{-40,-20},{-40,0}}, color={0,0,255}));
connect(currentSensor.p, ground.p)
annotation (Line(points={{8,-20},{40,-20}}, color={0,0,255}));
annotation (uses(Modelica(version="3.2")), Diagram(coordinateSystem(
annotation (uses(Modelica(version="3.2.1")), Diagram(coordinateSystem(
preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics),
experiment(StopTime=0.2),
Expand Down
2 changes: 1 addition & 1 deletion simulation/libraries/3rdParty/Exercises/1/Aufgabe1_2.mo
Expand Up @@ -87,7 +87,7 @@ equation
color={0,0,127}));
connect(fixed.flange,idealGear.support)
annotation (Line(points={{84,-16},{84,0}}, color={0,0,0}));
annotation (uses(Modelica(version="3.2")), Diagram(coordinateSystem(
annotation (uses(Modelica(version="3.2.1")), Diagram(coordinateSystem(
preserveAspectRatio=false, extent={{-180,-100},{180,100}}), graphics),
experiment(StopTime=0.2),
__Dymola_Commands(file="Plot feedback.u1 und u2.mos"
Expand Down
2 changes: 1 addition & 1 deletion simulation/libraries/3rdParty/Exercises/2/Aufgabe2.mo
Expand Up @@ -170,5 +170,5 @@ gearbox characteristic is approximated by a polynomial of degree 3.
experiment(StopTime=0.1),
__Dymola_Commands(file="Plot speeds.mos" "Plot speeds"));
end Test2;
annotation (uses(Modelica(version="3.2")));
annotation (uses(Modelica(version="3.2.1")));
end Aufgabe2;
2 changes: 1 addition & 1 deletion simulation/libraries/3rdParty/Exercises/5/FourBar.mo
Expand Up @@ -260,5 +260,5 @@ package FourBar
experiment(StopTime=5),
experimentSetupOutput);
end TestPlanarLoops;
annotation (uses(Modelica(version="3.2")));
annotation (uses(Modelica(version="3.2.2")));
end FourBar;
11 changes: 5 additions & 6 deletions simulation/libraries/3rdParty/Exercises/Aufgabe1_1.mos
Expand Up @@ -3,22 +3,21 @@
// provided by Martin Otter
//

loadModel(Modelica, {"3.2"}); getErrorString();
loadFile("1/Aufgabe1_1.mo"); getErrorString();
simulate(Aufgabe1_1); getErrorString();

// Result:
// true
// ""
// true
// ""
// "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation.
// Notification: Automatically loaded package Complex 3.2.1 due to uses annotation.
// Notification: Automatically loaded package ModelicaServices 3.2.1 due to uses annotation.
// "
// record SimulationResult
// resultFile = "Aufgabe1_1_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 0.2, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Aufgabe1_1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// "Warning: Requested package Modelica of version 3.2, but this package was already loaded with version 3.2.2. You might experience problems if these versions are incompatible.
// "
// ""
// endResult
11 changes: 5 additions & 6 deletions simulation/libraries/3rdParty/Exercises/Aufgabe1_2.mos
Expand Up @@ -3,23 +3,22 @@
// provided by Martin Otter
//

loadModel(Modelica, {"3.2"}); getErrorString();
loadFile("1/Aufgabe1_2.mo"); getErrorString();

simulate(Aufgabe1_2); getErrorString();

// Result:
// true
// ""
// true
// ""
// "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation.
// Notification: Automatically loaded package Complex 3.2.1 due to uses annotation.
// Notification: Automatically loaded package ModelicaServices 3.2.1 due to uses annotation.
// "
// record SimulationResult
// resultFile = "Aufgabe1_2_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 0.2, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Aufgabe1_2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// "Warning: Requested package Modelica of version 3.2, but this package was already loaded with version 3.2.2. You might experience problems if these versions are incompatible.
// "
// ""
// endResult
8 changes: 4 additions & 4 deletions simulation/libraries/3rdParty/Exercises/Aufgabe2.Test1.mos
Expand Up @@ -3,16 +3,16 @@
// provided by Martin Otter
//

loadModel(Modelica, {"3.2"}); getErrorString();
loadFile("2/Aufgabe2.mo"); getErrorString();

simulate(Aufgabe2.Test1); getErrorString();

// Result:
// true
// ""
// true
// ""
// "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation.
// Notification: Automatically loaded package Complex 3.2.1 due to uses annotation.
// Notification: Automatically loaded package ModelicaServices 3.2.1 due to uses annotation.
// "
// record SimulationResult
// resultFile = "Aufgabe2.Test1_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 2.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Aufgabe2.Test1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
Expand Down
8 changes: 4 additions & 4 deletions simulation/libraries/3rdParty/Exercises/Aufgabe2.Test2.mos
Expand Up @@ -3,16 +3,16 @@
// provided by Martin Otter
//

loadModel(Modelica, {"3.2"}); getErrorString();
loadFile("2/Aufgabe2.mo"); getErrorString();

simulate(Aufgabe2.Test2); getErrorString();

// Result:
// true
// ""
// true
// ""
// "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation.
// Notification: Automatically loaded package Complex 3.2.1 due to uses annotation.
// Notification: Automatically loaded package ModelicaServices 3.2.1 due to uses annotation.
// "
// record SimulationResult
// resultFile = "Aufgabe2.Test2_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 0.1, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Aufgabe2.Test2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
Expand Down
Expand Up @@ -3,17 +3,17 @@
// provided by Martin Otter
//

loadModel(Modelica, {"3.2"}); getErrorString();
loadFile("5/FourBar.mo"); getErrorString();

simulate(FourBar.TestPlanarLoops); getErrorString();


// Result:
// true
// ""
// true
// ""
// "Notification: Automatically loaded package Modelica 3.2.2 due to uses annotation.
// Notification: Automatically loaded package Complex 3.2.2 due to uses annotation.
// Notification: Automatically loaded package ModelicaServices 3.2.2 due to uses annotation.
// "
// record SimulationResult
// resultFile = "FourBar.TestPlanarLoops_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 5.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'FourBar.TestPlanarLoops', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
Expand Down
1 change: 0 additions & 1 deletion simulation/libraries/3rdParty/PNlib/PNlib.mo
Expand Up @@ -844,5 +844,4 @@ package PNlib
end Test12;
annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end Examples;
annotation(uses(Modelica(version="3.2.1")));
end PNlib;
Expand Up @@ -3741,8 +3741,8 @@ package PlanarMechanicsForTesting
lineColor={0,0,0})}));
end AbsoluteRotation;
end Sensors;
annotation (uses( Visualization(version="1.1"),
Modelica(version="3.2")), Documentation(revisions="<html>
annotation (uses(
Modelica(version="3.1" /* Originally 3.2 */)), Documentation(revisions="<html>
<p>(c) Copyright by Dirk Zimmer</p>
<p>The library was creates and is owned by Dr. Dirk Zimmer. </p>
<p>dirk.zimmer@dlr.de</p>
Expand Down

0 comments on commit f1296f3

Please sign in to comment.