-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from audrey-jardin/main
updates of unit examples to test simplified ETL library
- Loading branch information
Showing
216 changed files
with
3,065 additions
and
185 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
model requirements_tank is { | ||
|
||
class TankModel is { | ||
external Real level ; | ||
external Real temperature; | ||
}; | ||
class TankModel is { | ||
Real level is external; | ||
Real temperature is external; | ||
}; | ||
|
||
TankModel tankm is new TankModel; | ||
TankModel tankm is new TankModel; | ||
|
||
Boolean R1 is tankm.level >= 7.5; | ||
Boolean R2 is tankm.level >= 10; | ||
Boolean R3 is R1 and (not R2); | ||
Boolean R4 is tankm.temperature <= 100; | ||
Boolean R1 is tankm.level >= 7.5; | ||
Boolean R2 is tankm.level >= 10; | ||
Boolean R3 is R1 and (not R2); | ||
Boolean R4 is tankm.temperature <= 100; | ||
|
||
}; |
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
57 changes: 57 additions & 0 deletions
57
resources/crml_tutorial/pumping_system/modelica/SysCon2018/SysConMain1.mo
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,57 @@ | ||
within SysCon2018; | ||
model SysConMain1 | ||
SysCon sysCon annotation (Placement(transformation(extent={{-10,0},{10,20}}))); | ||
CRML.Blocks.Logical.BooleanPulse system_inOperation( | ||
width=3600, | ||
startTime=60, | ||
period=4000) | ||
annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); | ||
Modelica.Blocks.Sources.Sine | ||
pump_temperature( | ||
freqHz=1/600, | ||
offset=39, | ||
amplitude=1.1) | ||
annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); | ||
CRML.Blocks.Logical.BooleanPulse pump_isStarted1( | ||
width=1140, | ||
period=1200, | ||
startTime=600) | ||
annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); | ||
CRML.Blocks.Logical4.ShowBoolean4 showValue | ||
annotation (Placement(transformation(extent={{40,0},{60,20}}))); | ||
Modelica.Blocks.Logical.And pump_isStarted | ||
annotation (Placement(transformation(extent={{-42,6},{-34,14}}))); | ||
CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 | ||
annotation (Placement(transformation(extent={{-28,16},{-20,24}}))); | ||
CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 | ||
annotation (Placement(transformation(extent={{-28,6},{-20,14}}))); | ||
equation | ||
connect(pump_temperature.y, sysCon.pump_temperature) annotation (Line(points={{-59,-30}, | ||
{-26,-30},{-26,2},{-11,2}}, color={0,0,0})); | ||
connect(sysCon.requirement_value, showValue.u) | ||
annotation (Line(points={{11,10},{39.5,10}}, | ||
color={162,29,33})); | ||
connect(pump_isStarted1.y, pump_isStarted.u2) annotation (Line(points={{-59, | ||
10},{-50,10},{-50,6.8},{-42.8,6.8}}, color={255,0,128})); | ||
connect(system_inOperation.y, pump_isStarted.u1) annotation (Line(points={{ | ||
-59,50},{-46,50},{-46,10},{-42.8,10}}, color={255,0,128})); | ||
connect(system_inOperation.y, booleanToBoolean4_1.u) annotation (Line(points= | ||
{{-59,50},{-40,50},{-40,20},{-28.4,20}}, color={217,67,180})); | ||
connect(sysCon.system_inOperation, booleanToBoolean4_1.y) annotation (Line( | ||
points={{-11,19},{-11,18.5},{-19.6,18.5},{-19.6,20}}, color={162,29,33})); | ||
connect(pump_isStarted.y, booleanToBoolean4_2.u) | ||
annotation (Line(points={{-33.6,10},{-28.4,10}}, color={255,0,255})); | ||
connect(sysCon.pump_isStarted, booleanToBoolean4_2.y) | ||
annotation (Line(points={{-11,10},{-19.6,10}}, color={162,29,33})); | ||
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ | ||
Ellipse(lineColor = {75,138,73}, | ||
fillColor={255,255,255}, | ||
fillPattern = FillPattern.Solid, | ||
extent={{-100,-100},{100,100}}), | ||
Polygon(lineColor = {0,0,255}, | ||
fillColor = {75,138,73}, | ||
pattern = LinePattern.None, | ||
fillPattern = FillPattern.Solid, | ||
points={{-36,60},{64,0},{-36,-60},{-36,60}})}), Diagram( | ||
coordinateSystem(preserveAspectRatio=false))); | ||
end SysConMain1; |
1 change: 1 addition & 0 deletions
1
resources/crml_tutorial/pumping_system/modelica/SysCon2018/package.order
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
SysConMain | ||
SysConMain1 | ||
SysCon |
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
23 changes: 23 additions & 0 deletions
23
resources/modelica_libraries/CRML_test/ETL/BecomesTrue/BecomesTrue.mo
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,23 @@ | ||
within CRML_test.ETL.BecomesTrue; | ||
partial model BecomesTrue | ||
Utilities.Boolean4Connector b1 | ||
annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); | ||
Utilities.ClockConnector c_b1_becomes_true | ||
annotation (Placement(transformation(extent={{100,10},{120,-10}}))); | ||
CRML.Blocks.Events.ClockEvent clockEvent | ||
annotation (Placement(transformation(extent={{-6,-6},{6,6}}))); | ||
CRML.Blocks.Events.Event4ToEvent event4ToEvent | ||
annotation (Placement(transformation(extent={{-54,-4},{-46,4}}))); | ||
equation | ||
connect(clockEvent.y, c_b1_becomes_true) annotation (Line( | ||
points={{6.6,0},{110,0}}, | ||
color={175,175,175}, | ||
pattern=LinePattern.Dot, | ||
thickness=0.5)); | ||
connect(b1, event4ToEvent.u) | ||
annotation (Line(points={{-110,0},{-54.4,0}}, color={0,0,0})); | ||
connect(clockEvent.u, event4ToEvent.y) | ||
annotation (Line(points={{-6.6,0},{-45.6,0}}, color={217,67,180})); | ||
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( | ||
coordinateSystem(preserveAspectRatio=false))); | ||
end BecomesTrue; |
16 changes: 16 additions & 0 deletions
16
resources/modelica_libraries/CRML_test/ETL/BecomesTrue/BecomesTrue_externals.mo
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,16 @@ | ||
within CRML_test.ETL.BecomesTrue; | ||
model BecomesTrue_externals | ||
CRML.Blocks.Events.EventPeriodic boolean4Constant1(period=3, startTime=2) | ||
annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); | ||
CRML.ETL.Connectors.Boolean4Output b1 | ||
annotation (Placement(transformation(extent={{100,-10},{120,10}}))); | ||
CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 | ||
annotation (Placement(transformation(extent={{-4,-4},{4,4}}))); | ||
equation | ||
connect(boolean4Constant1.y, booleanToBoolean4_1.u) | ||
annotation (Line(points={{-39,0},{-4.4,0}}, color={217,67,180})); | ||
connect(booleanToBoolean4_1.y, b1) | ||
annotation (Line(points={{4.4,0},{110,0}}, color={162,29,33})); | ||
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( | ||
coordinateSystem(preserveAspectRatio=false))); | ||
end BecomesTrue_externals; |
30 changes: 30 additions & 0 deletions
30
resources/modelica_libraries/CRML_test/ETL/BecomesTrue/BecomesTrue_verif.mo
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,30 @@ | ||
within CRML_test.ETL.BecomesTrue; | ||
model BecomesTrue_verif | ||
extends BecomesTrue; | ||
BecomesTrue_externals externals | ||
annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); | ||
CRML.Blocks.Events.ShowEvent show_c_b1_becomes_true | ||
annotation (Placement(transformation(extent={{52,-44},{60,-36}}))); | ||
equation | ||
// Bindings | ||
b1 = externals.b1; | ||
connect(show_c_b1_becomes_true.u, event4ToEvent.y) annotation (Line(points={{ | ||
51.6,-40},{-20,-40},{-20,0},{-45.6,0}}, color={217,67,180})); | ||
annotation (Placement(transformation(extent={{0,-20},{60,40}})), | ||
Icon(coordinateSystem(preserveAspectRatio=false, | ||
extent={{-200,-100},{100,100}}, | ||
initialScale=0.1), graphics={ | ||
Ellipse(lineColor = {75,138,73}, | ||
fillColor={255,255,255}, | ||
fillPattern = FillPattern.Solid, | ||
extent = {{-100,-100},{100,100}}), | ||
Polygon(lineColor = {0,0,255}, | ||
fillColor = {75,138,73}, | ||
pattern = LinePattern.None, | ||
fillPattern = FillPattern.Solid, | ||
points = {{-36,60},{64,0},{-36,-60},{-36,60}})}), Diagram( | ||
coordinateSystem(preserveAspectRatio=false, | ||
extent={{-200,-100},{100,100}}, | ||
initialScale=0.1)), | ||
experiment(StopTime=14)); | ||
end BecomesTrue_verif; |
3 changes: 3 additions & 0 deletions
3
resources/modelica_libraries/CRML_test/ETL/BecomesTrue/package.mo
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,3 @@ | ||
within CRML_test.ETL; | ||
package BecomesTrue | ||
end BecomesTrue; |
3 changes: 3 additions & 0 deletions
3
resources/modelica_libraries/CRML_test/ETL/BecomesTrue/package.order
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,3 @@ | ||
BecomesTrue | ||
BecomesTrue_externals | ||
BecomesTrue_verif |
13 changes: 13 additions & 0 deletions
13
resources/modelica_libraries/CRML_test/ETL/TemplateOr/TemplateOr.mo
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,13 @@ | ||
within CRML_test.ETL.TemplateOr; | ||
partial model TemplateOr | ||
Utilities.Boolean4Connector b1 | ||
annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); | ||
Utilities.Boolean4Connector b2 | ||
annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); | ||
Utilities.Boolean4Connector b1_or_b2 | ||
annotation (Placement(transformation(extent={{100,10},{120,-10}}))); | ||
equation | ||
b1_or_b2 = CRML.Blocks.Logical4.or4(b1, b2); | ||
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( | ||
coordinateSystem(preserveAspectRatio=false))); | ||
end TemplateOr; |
18 changes: 18 additions & 0 deletions
18
resources/modelica_libraries/CRML_test/ETL/TemplateOr/TemplateOr_externals.mo
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,18 @@ | ||
within CRML_test.ETL.TemplateOr; | ||
model TemplateOr_externals | ||
CRML.Blocks.Logical4.Boolean4Constant boolean4Constant1(K=CRML.ETL.Types.Boolean4.true4) | ||
annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); | ||
CRML.Blocks.Logical4.Boolean4Constant boolean4Constant2(K=CRML.ETL.Types.Boolean4.undecided) | ||
annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); | ||
CRML.ETL.Connectors.Boolean4Output b1 | ||
annotation (Placement(transformation(extent={{100,40},{120,60}}))); | ||
CRML.ETL.Connectors.Boolean4Output b2 | ||
annotation (Placement(transformation(extent={{100,-60},{120,-40}}))); | ||
equation | ||
connect(boolean4Constant1.y, b1) | ||
annotation (Line(points={{-39,50},{110,50}}, color={162,29,33})); | ||
connect(boolean4Constant2.y, b2) | ||
annotation (Line(points={{-39,-50},{110,-50}}, color={162,29,33})); | ||
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( | ||
coordinateSystem(preserveAspectRatio=false))); | ||
end TemplateOr_externals; |
Oops, something went wrong.