diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse.mo b/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse.mo new file mode 100644 index 0000000..fc8ec95 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse.mo @@ -0,0 +1,68 @@ +within CRML_test.ETL.BecomesFalse; +partial model BecomesFalse + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); + CRML.ETL.Connectors.ClockOutput + c_b1_becomes_false + 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(x(start=true)) + annotation (Placement(transformation(extent={{-54,-4},{-46,4}}))); + CRML.Blocks.Logical4.Not4 not4_1 + annotation (Placement(transformation(extent={{-88,-10},{-68,10}}))); + CRML.Blocks.Events.ShowEvent showEvent_c_b1_becomes_false + annotation (Placement(transformation(extent={{60,-56},{68,-48}}))); +equation + connect(clockEvent.y, c_b1_becomes_false) annotation (Line( + points={{6.6,0},{110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent.u, event4ToEvent.y) + annotation (Line(points={{-6.6,0},{-45.6,0}}, color={217,67,180})); + connect(event4ToEvent.u, not4_1.y) + annotation (Line(points={{-54.4,0},{-67,0}}, color={162,29,33})); + connect(b1, not4_1.u) + annotation (Line(points={{-110,0},{-89,0}}, color={0,0,0})); + connect(showEvent_c_b1_becomes_false.u, event4ToEvent.y) annotation (Line( + points={{59.6,-52},{-36,-52},{-36,0},{-45.6,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,102},{100,-98}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-250,170},{250,110}}, + textString="%name", + lineColor={0,0,255}), Line(points={{-80,34}, + {-50,34},{-4,34},{-50,34},{-50,34},{52,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Line(points={{-86,-52},{-50,-52},{-50,-8},{-8,-8},{-8,-54},{-8,-54}}, + color={0,0,0}), + Line( + points={{54,78},{54,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Line(points={{-8,-54},{28,-54},{28,-8},{52,-8},{52,-54},{76,-54}}, + color={0,0,0}), + Line( + points={{-8,78},{-8,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{44,88},{64,68}}, + lineColor={0,140,72}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-18,88},{2,68}}, + lineColor={0,140,72}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +")); +end BecomesFalse; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse_externals.mo b/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse_externals.mo new file mode 100644 index 0000000..2b279dc --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse_externals.mo @@ -0,0 +1,23 @@ +within CRML_test.ETL.BecomesFalse; +model BecomesFalse_externals + CRML.Blocks.Logical.BooleanTable booleanTable( + y0=false, + option_width=false, + instant={2.5,5,7.5,9}) + 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}}))); + CRML.Blocks.Events.ShowEvent showEvent_eventPeriodic_b1 + annotation (Placement(transformation(extent={{-20,-44},{-12,-36}}))); +equation + connect(booleanTable.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})); + connect(booleanTable.y, showEvent_eventPeriodic_b1.u) annotation (Line(points= + {{-39,0},{-28,0},{-28,-40},{-20.4,-40}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesFalse_externals; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse_verif.mo b/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse_verif.mo new file mode 100644 index 0000000..44aa3e5 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalse/BecomesFalse_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.ETL.BecomesFalse; +model BecomesFalse_verif + extends BecomesFalse; + BecomesFalse_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + 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 BecomesFalse_verif; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalse/package.mo b/libraries/modelica/CRML_test/ETL/BecomesFalse/package.mo new file mode 100644 index 0000000..f578927 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalse/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package BecomesFalse +end BecomesFalse; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalse/package.order b/libraries/modelica/CRML_test/ETL/BecomesFalse/package.order new file mode 100644 index 0000000..313b301 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalse/package.order @@ -0,0 +1,3 @@ +BecomesFalse +BecomesFalse_externals +BecomesFalse_verif diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside.mo b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside.mo new file mode 100644 index 0000000..dcecc94 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside.mo @@ -0,0 +1,67 @@ +within CRML_test.ETL.BecomesFalseInside; +partial model BecomesFalseInside + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,60},{-100,40}}))); + CRML.ETL.Connectors.ClockOutput c_b1_becomes_false_inside_p1 + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + Utilities.TimeLocatorConnector P1 + annotation (Placement(transformation(extent={{-120,-60},{-100,-40}}))); + CRML.ETL.Blocks.Events.BecomesFalse becomesFalse + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + CRML.ETL.Blocks.Clocks.Inside inside + annotation (Placement(transformation(extent={{0,-10},{20,10}}))); +equation + connect(b1, becomesFalse.b1) annotation (Line(points={{-110,50},{-80,50},{-80, + 0},{-61,0}}, color={0,0,0})); + connect(P1, inside.tl) annotation (Line(points={{-110,-50},{-80,-50},{-80,-40}, + {-20,-40},{-20,-3},{-1,-3}}, color={0,0,0})); + connect(inside.y, c_b1_becomes_false_inside_p1) annotation (Line( + points={{21,0},{110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(becomesFalse.y, inside.u) annotation (Line( + points={{-39,0},{-6,0},{-6,3},{-1,3}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{28,78},{28,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Text( + extent={{-250,170},{250,110}}, + textString="%name", + lineColor={0,0,255}), Line(points={{-80,34}, + {-50,34},{-50,78},{-50,78},{-50,34},{52,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Line(points={{-86,34},{-50,34},{-50,78},{-8,78},{-8,32},{-8,34}}, + color={162,29,33}), + Ellipse( + extent={{-18,88},{2,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line(points={{-8,34},{28,34},{28,78},{52,78},{52,34},{76,34}}, + color={162,29,33}), + Ellipse( + extent={{42,88},{62,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line(points={{-90,-50},{-64,-50},{-64,-6},{16,-6},{16,-52},{84,-52}}, + color={28,108,200}), + Ellipse( + extent={{-18,4},{2,-16}}, + lineColor={0,140,72}, + fillPattern=FillPattern.Solid, + fillColor={255,255,255})}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesFalseInside; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside_externals.mo b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside_externals.mo new file mode 100644 index 0000000..7f4c1ea --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside_externals.mo @@ -0,0 +1,48 @@ +within CRML_test.ETL.BecomesFalseInside; +model BecomesFalseInside_externals + CRML.ETL.Connectors.Boolean4Output b1 + annotation (Placement(transformation(extent={{100,30},{120,50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-4,36},{4,44}}))); +public + CRML.Blocks.Logical.BooleanTable booleanTable2( + y0=false, + option_width=false, + instant={3.5,4.5}) + annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + CRML.ETL.Connectors.TimeLocatorOutput tl1 + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); + CRML.Blocks.Logical.BooleanTable booleanTable(option_width=false, instant={ + 2.5,5,7.5,9}) + annotation (Placement(transformation(extent={{-60,-30},{-40,-10}}))); + CRML.Blocks.Events.ShowEvent showEvent_b1 + annotation (Placement(transformation(extent={{16,-14},{24,-6}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-40},{60,-20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_3 + annotation (Placement(transformation(extent={{-4,-34},{4,-26}}))); + CRML.CompilerCompliancy.CRMLPeriodTimePeriod cRMLPeriodTimePeriod + annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); + CRML.ETL.Connectors.CRMLPeriodOutput P1 + annotation (Placement(transformation(extent={{100,-90},{120,-70}}))); +equation + connect(booleanToBoolean4_1.y, b1) + annotation (Line(points={{4.4,40},{110,40}}, + color={162,29,33})); + connect(booleanTable2.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,40},{-4.4,40}}, color={217,67,180})); + connect(booleanTable.y, showEvent_b1.u) annotation (Line(points={{-39,-20},{ + -12,-20},{-12,-10},{15.6,-10}}, color={217,67,180})); + connect(booleanTable.y, booleanToBoolean4_3.u) annotation (Line(points={{-39, + -20},{-12,-20},{-12,-30},{-4.4,-30}}, color={217,67,180})); + connect(booleanToBoolean4_3.y,during. u) + annotation (Line(points={{4.4,-30},{39,-30}}, color={162,29,33})); + connect(tl1, during.y[1]) + annotation (Line(points={{110,-40},{50,-40}}, color={0,0,255})); + connect(during.y[1], cRMLPeriodTimePeriod.tl) + annotation (Line(points={{50,-40},{50,-60}}, color={0,0,255})); + connect(cRMLPeriodTimePeriod.y, P1) annotation (Line(points={{61,-70},{80,-70}, + {80,-80},{110,-80}}, color={255,170,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesFalseInside_externals; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside_verif.mo b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside_verif.mo new file mode 100644 index 0000000..61420cf --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/BecomesFalseInside_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.BecomesFalseInside; +model BecomesFalseInside_verif + extends BecomesFalseInside; + BecomesFalseInside_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + P1 =externals.tl1; + 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 BecomesFalseInside_verif; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalseInside/package.mo b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/package.mo new file mode 100644 index 0000000..53c1a57 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package BecomesFalseInside +end BecomesFalseInside; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalseInside/package.order b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/package.order new file mode 100644 index 0000000..ea67178 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalseInside/package.order @@ -0,0 +1,3 @@ +BecomesFalseInside +BecomesFalseInside_externals +BecomesFalseInside_verif diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/BecomesFalseInside_no_ext.mo b/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/BecomesFalseInside_no_ext.mo new file mode 100644 index 0000000..d3cfacb --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/BecomesFalseInside_no_ext.mo @@ -0,0 +1,82 @@ +within CRML_test.ETL.BecomesFalseInside_no_ext; +model BecomesFalseInside_no_ext + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + instant={3.5,4.5}, + option_width=false) + annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-24,6},{-16,14}}))); + CRML.Blocks.Logical.BooleanConstant b3 + annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-24,-34},{-16,-26}}))); + CRML.Blocks.Logical.BooleanConstant b4(K=false) + annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_3 + annotation (Placement(transformation(extent={{-24,-74},{-16,-66}}))); + CRML.ETL.Connectors.ClockOutput c_b2_becomes_true_inside_p1 + annotation (Placement(transformation(extent={{100,20},{120,40}}))); + CRML.ETL.Connectors.ClockOutput c_b3_becomes_true_inside_p1 + annotation (Placement(transformation(extent={{100,-20},{120,0}}))); + CRML.ETL.Connectors.ClockOutput c_b4_becomes_true_inside_p1 + annotation (Placement(transformation(extent={{100,-60},{120,-40}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5,7.5,9}) + annotation (Placement(transformation(extent={{-180,50},{-160,70}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_4 + annotation (Placement(transformation(extent={{-124,56},{-116,64}}))); + CRML.ETL.Blocks.Events.BecomesFalseInside becomesFalseInside + annotation (Placement(transformation(extent={{0,20},{20,40}}))); + CRML.ETL.Blocks.Events.BecomesFalseInside becomesFalseInside2 + annotation (Placement(transformation(extent={{0,-20},{20,0}}))); + CRML.ETL.Blocks.Events.BecomesFalseInside becomesFalseInside1 + annotation (Placement(transformation(extent={{0,-60},{20,-40}}))); +equation + connect(b2.y, booleanToBoolean4_1.u) + annotation (Line(points={{-59,10},{-24.4,10}}, color={217,67,180})); + connect(b3.y, booleanToBoolean4_2.u) annotation (Line(points={{-59,-30},{ + -24.4,-30}}, color={217,67,180})); + connect(b4.y, booleanToBoolean4_3.u) + annotation (Line(points={{-59,-70},{-24.4,-70}}, color={217,67,180})); + connect(b1.y, booleanToBoolean4_4.u) + annotation (Line(points={{-159,60},{-124.4,60}}, color={217,67,180})); + connect(booleanToBoolean4_4.y,during. u) + annotation (Line(points={{-115.6,60},{-81,60}}, + color={162,29,33})); + connect(becomesFalseInside.y, c_b2_becomes_true_inside_p1) annotation (Line( + points={{21,30},{110,30}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(becomesFalseInside2.y, c_b3_becomes_true_inside_p1) annotation (Line( + points={{21,-10},{110,-10}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(becomesFalseInside1.y, c_b4_becomes_true_inside_p1) annotation (Line( + points={{21,-50},{110,-50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(during.y[1], becomesFalseInside.P1) + annotation (Line(points={{-70,50},{-70,25},{-1,25}}, color={0,0,255})); + connect(becomesFalseInside2.P1, becomesFalseInside.P1) annotation (Line( + points={{-1,-15},{-40,-15},{-40,25},{-1,25}}, color={0,0,255})); + connect(becomesFalseInside1.P1, becomesFalseInside.P1) annotation (Line( + points={{-1,-55},{-40,-55},{-40,25},{-1,25}}, color={0,0,255})); + connect(becomesFalseInside.b1, booleanToBoolean4_1.y) annotation (Line(points= + {{-1,35},{-8,35},{-8,10},{-15.6,10}}, color={162,29,33})); + connect(booleanToBoolean4_2.y, becomesFalseInside2.b1) annotation (Line( + points={{-15.6,-30},{-8,-30},{-8,-5},{-1,-5}}, color={162,29,33})); + connect(booleanToBoolean4_3.y, becomesFalseInside1.b1) annotation (Line( + points={{-15.6,-70},{-8,-70},{-8,-45},{-1,-45}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-250, + -100},{250,100}})), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-250,-100},{250, + 100}}))); +end BecomesFalseInside_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/package.mo new file mode 100644 index 0000000..4b81810 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package BecomesFalseInside_no_ext +end BecomesFalseInside_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/package.order b/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/package.order new file mode 100644 index 0000000..7dde0ce --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalseInside_no_ext/package.order @@ -0,0 +1 @@ +BecomesFalseInside_no_ext diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/BecomesFalse_no_ext.mo b/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/BecomesFalse_no_ext.mo new file mode 100644 index 0000000..5a35200 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/BecomesFalse_no_ext.mo @@ -0,0 +1,59 @@ +within CRML_test.ETL.BecomesFalse_no_ext; +model BecomesFalse_no_ext + CRML.Blocks.Events.ClockEvent clockEvent1 + annotation (Placement(transformation(extent={{24,44},{36,56}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent(x(start=true)) + annotation (Placement(transformation(extent={{-4,46},{4,54}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + instant={2.5,5,7.5,9}, + option_width=false) + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-44,46},{-36,54}}))); + CRML.Blocks.Events.ClockEvent clockEvent2 + annotation (Placement(transformation(extent={{24,4},{36,16}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent1(x(start=true)) + annotation (Placement(transformation(extent={{-4,6},{4,14}}))); + CRML.Blocks.Logical.BooleanConstant b2 + annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-44,6},{-36,14}}))); + CRML.ETL.Connectors.ClockOutput c1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.ClockOutput c2 + annotation (Placement(transformation(extent={{100,0},{120,20}}))); + CRML.Blocks.Logical4.Not4 not4_1 + annotation (Placement(transformation(extent={{-30,40},{-10,60}}))); + CRML.Blocks.Logical4.Not4 not4_2 + annotation (Placement(transformation(extent={{-30,0},{-10,20}}))); +equation + connect(clockEvent1.u, event4ToEvent.y) + annotation (Line(points={{23.4,50},{4.4,50}}, color={217,67,180})); + connect(clockEvent2.u, event4ToEvent1.y) + annotation (Line(points={{23.4,10},{4.4,10}}, color={217,67,180})); + connect(clockEvent1.y, c1) annotation (Line( + points={{36.6,50},{110,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent2.y, c2) annotation (Line( + points={{36.6,10},{110,10}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(b2.y, booleanToBoolean4_2.u) + annotation (Line(points={{-59,10},{-44.4,10}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, not4_2.u) + annotation (Line(points={{-35.6,10},{-31,10}}, color={162,29,33})); + connect(not4_2.y, event4ToEvent1.u) + annotation (Line(points={{-9,10},{-4.4,10}}, color={162,29,33})); + connect(b1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-59,50},{-44.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, not4_1.u) + annotation (Line(points={{-35.6,50},{-31,50}}, color={162,29,33})); + connect(not4_1.y, event4ToEvent.u) + annotation (Line(points={{-9,50},{-4.4,50}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesFalse_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/package.mo new file mode 100644 index 0000000..fa2d775 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/package.mo @@ -0,0 +1,4 @@ +within CRML_test.ETL; +package BecomesFalse_no_ext + +end BecomesFalse_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/package.order b/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/package.order new file mode 100644 index 0000000..3328ab0 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesFalse_no_ext/package.order @@ -0,0 +1 @@ +BecomesFalse_no_ext diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue.mo b/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue.mo new file mode 100644 index 0000000..368cc06 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue.mo @@ -0,0 +1,54 @@ +within CRML_test.ETL.BecomesTrue; +partial model BecomesTrue + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); + CRML.ETL.Connectors.ClockOutput + 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), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-250,170},{250,110}}, + textString="%name", + lineColor={0,0,255}), Line(points={{-80,34}, + {-50,34},{-50,78},{-50,78},{-50,34},{52,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Line(points={{-86,-52},{-50,-52},{-50,-8},{-8,-8},{-8,-54},{-8,-54}}, + color={0,0,0}), + Line( + points={{30,78},{30,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{-60,88},{-40,68}}, + lineColor={0,140,72}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-8,-54},{28,-54},{28,-8},{52,-8},{52,-54},{76,-54}}, + color={0,0,0}), + Ellipse( + extent={{20,88},{40,68}}, + lineColor={0,140,72}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesTrue; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue_externals.mo b/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue_externals.mo new file mode 100644 index 0000000..72b5392 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue_externals.mo @@ -0,0 +1,20 @@ +within CRML_test.ETL.BecomesTrue; +model BecomesTrue_externals + CRML.Blocks.Events.EventPeriodic eventPeriodic1(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}}))); + CRML.Blocks.Events.ShowEvent showEvent_eventPeriodic_b1 + annotation (Placement(transformation(extent={{-20,-44},{-12,-36}}))); +equation + connect(eventPeriodic1.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})); + connect(showEvent_eventPeriodic_b1.u, eventPeriodic1.y) annotation (Line( + points={{-20.4,-40},{-30,-40},{-30,0},{-39,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesTrue_externals; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue_verif.mo b/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue_verif.mo new file mode 100644 index 0000000..2706894 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrue/BecomesTrue_verif.mo @@ -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; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrue/package.mo b/libraries/modelica/CRML_test/ETL/BecomesTrue/package.mo new file mode 100644 index 0000000..9b9f3c9 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrue/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package BecomesTrue +end BecomesTrue; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrue/package.order b/libraries/modelica/CRML_test/ETL/BecomesTrue/package.order new file mode 100644 index 0000000..d942d53 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrue/package.order @@ -0,0 +1,3 @@ +BecomesTrue +BecomesTrue_externals +BecomesTrue_verif diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside.mo b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside.mo new file mode 100644 index 0000000..9519d73 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside.mo @@ -0,0 +1,68 @@ +within CRML_test.ETL.BecomesTrueInside; +partial model BecomesTrueInside + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,60},{-100,40}}))); + CRML.ETL.Connectors.ClockOutput + c_b1_becomes_true_inside_p1 + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + Utilities.TimeLocatorConnector P1 + annotation (Placement(transformation(extent={{-120,-60},{-100,-40}}))); + CRML.ETL.Blocks.Events.BecomesTrue becomesTrue + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + CRML.ETL.Blocks.Clocks.Inside inside + annotation (Placement(transformation(extent={{0,-10},{20,10}}))); +equation + connect(b1, becomesTrue.b1) annotation (Line(points={{-110,50},{-80,50},{-80, + 0},{-61,0}}, color={0,0,0})); + connect(inside.u, becomesTrue.y) annotation (Line( + points={{-1,3},{-28,3},{-28,0},{-39,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(P1, inside.tl) annotation (Line(points={{-110,-50},{-80,-50},{-80,-40}, + {-20,-40},{-20,-3},{-1,-3}}, color={0,0,0})); + connect(inside.y, c_b1_becomes_true_inside_p1) annotation (Line( + points={{21,0},{110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{28,78},{28,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Text( + extent={{-250,170},{250,110}}, + textString="%name", + lineColor={0,0,255}), Line(points={{-80,34}, + {-50,34},{-50,78},{-50,78},{-50,34},{52,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Line(points={{-86,34},{-50,34},{-50,78},{-8,78},{-8,32},{-8,34}}, + color={162,29,33}), + Ellipse( + extent={{-60,88},{-40,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line(points={{-8,34},{28,34},{28,78},{52,78},{52,34},{76,34}}, + color={162,29,33}), + Ellipse( + extent={{18,88},{38,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line(points={{-90,-50},{-64,-50},{-64,-6},{16,-6},{16,-52},{84,-52}}, + color={28,108,200}), + Ellipse( + extent={{-58,4},{-38,-16}}, + lineColor={0,140,72}, + fillPattern=FillPattern.Solid, + fillColor={255,255,255})}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesTrueInside; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside_externals.mo b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside_externals.mo new file mode 100644 index 0000000..8ab3435 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside_externals.mo @@ -0,0 +1,50 @@ +within CRML_test.ETL.BecomesTrueInside; +model BecomesTrueInside_externals + CRML.ETL.Connectors.Boolean4Output b1 + annotation (Placement(transformation(extent={{100,30},{120,50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-4,36},{4,44}}))); +public + CRML.Blocks.Logical.BooleanTable booleanTable2( + y0=false, + option_width=false, + instant={3.5,4.5}) + annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + CRML.ETL.Connectors.TimeLocatorOutput tl1 + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); + CRML.Blocks.Logical.BooleanTable booleanTable1( + y0=false, + option_width=false, + instant={2.5,5,7.5,9}) + annotation (Placement(transformation(extent={{-60,-30},{-40,-10}}))); + CRML.Blocks.Events.ShowEvent showEvent_b1 + annotation (Placement(transformation(extent={{16,-14},{24,-6}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-40},{60,-20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_3 + annotation (Placement(transformation(extent={{-4,-34},{4,-26}}))); + CRML.CompilerCompliancy.CRMLPeriodTimePeriod cRMLPeriodTimePeriod + annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); + CRML.ETL.Connectors.CRMLPeriodOutput P1 + annotation (Placement(transformation(extent={{100,-80},{120,-60}}))); +equation + connect(booleanToBoolean4_1.y, b1) + annotation (Line(points={{4.4,40},{110,40}}, + color={162,29,33})); + connect(booleanTable2.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,40},{-4.4,40}}, color={217,67,180})); + connect(booleanTable1.y, showEvent_b1.u) annotation (Line(points={{-39,-20},{ + -12,-20},{-12,-10},{15.6,-10}}, color={217,67,180})); + connect(booleanTable1.y, booleanToBoolean4_3.u) annotation (Line(points={{-39, + -20},{-12,-20},{-12,-30},{-4.4,-30}}, color={217,67,180})); + connect(booleanToBoolean4_3.y,during. u) + annotation (Line(points={{4.4,-30},{39,-30}}, color={162,29,33})); + connect(tl1, during.y[1]) + annotation (Line(points={{110,-40},{50,-40}}, color={0,0,255})); + connect(during.y[1], cRMLPeriodTimePeriod.tl) + annotation (Line(points={{50,-40},{50,-60}}, color={0,0,255})); + connect(cRMLPeriodTimePeriod.y, P1) + annotation (Line(points={{61,-70},{110,-70}}, color={255,170,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesTrueInside_externals; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside_verif.mo b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside_verif.mo new file mode 100644 index 0000000..c55ec43 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/BecomesTrueInside_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.BecomesTrueInside; +model BecomesTrueInside_verif + extends BecomesTrueInside; + BecomesTrueInside_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + P1 =externals.tl1; + 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 BecomesTrueInside_verif; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrueInside/package.mo b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/package.mo new file mode 100644 index 0000000..6176b45 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package BecomesTrueInside +end BecomesTrueInside; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrueInside/package.order b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/package.order new file mode 100644 index 0000000..ac47cdf --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrueInside/package.order @@ -0,0 +1,3 @@ +BecomesTrueInside +BecomesTrueInside_externals +BecomesTrueInside_verif diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/BecomesTrueInside_no_ext.mo b/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/BecomesTrueInside_no_ext.mo new file mode 100644 index 0000000..0ef9c0f --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/BecomesTrueInside_no_ext.mo @@ -0,0 +1,82 @@ +within CRML_test.ETL.BecomesTrueInside_no_ext; +model BecomesTrueInside_no_ext + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + instant={3.5,4.5}, + option_width=false) + annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-24,6},{-16,14}}))); + CRML.Blocks.Logical.BooleanConstant b3 + annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-24,-34},{-16,-26}}))); + CRML.Blocks.Logical.BooleanConstant b4(K=false) + annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_3 + annotation (Placement(transformation(extent={{-24,-74},{-16,-66}}))); + CRML.ETL.Connectors.ClockOutput c_b2_becomes_true_inside_p1 + annotation (Placement(transformation(extent={{100,20},{120,40}}))); + CRML.ETL.Connectors.ClockOutput c_b3_becomes_true_inside_p1 + annotation (Placement(transformation(extent={{100,-20},{120,0}}))); + CRML.ETL.Connectors.ClockOutput c_b4_becomes_true_inside_p1 + annotation (Placement(transformation(extent={{100,-60},{120,-40}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5,7.5,9}) + annotation (Placement(transformation(extent={{-180,50},{-160,70}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_4 + annotation (Placement(transformation(extent={{-124,56},{-116,64}}))); + CRML.ETL.Blocks.Events.BecomesTrueInside becomesTrueInside1 + annotation (Placement(transformation(extent={{0,20},{20,40}}))); + CRML.ETL.Blocks.Events.BecomesTrueInside becomesTrueInside2 + annotation (Placement(transformation(extent={{0,-20},{20,0}}))); + CRML.ETL.Blocks.Events.BecomesTrueInside becomesTrueInside3 + annotation (Placement(transformation(extent={{0,-60},{20,-40}}))); +equation + connect(b2.y, booleanToBoolean4_1.u) + annotation (Line(points={{-59,10},{-24.4,10}}, color={217,67,180})); + connect(b3.y, booleanToBoolean4_2.u) annotation (Line(points={{-59,-30},{ + -24.4,-30}}, color={217,67,180})); + connect(b4.y, booleanToBoolean4_3.u) + annotation (Line(points={{-59,-70},{-24.4,-70}}, color={217,67,180})); + connect(b1.y, booleanToBoolean4_4.u) + annotation (Line(points={{-159,60},{-124.4,60}}, color={217,67,180})); + connect(booleanToBoolean4_4.y,during. u) + annotation (Line(points={{-115.6,60},{-81,60}}, + color={162,29,33})); + connect(during.y[1], becomesTrueInside1.tl) + annotation (Line(points={{-70,50},{-70,25},{-1,25}}, color={0,0,255})); + connect(becomesTrueInside1.y, c_b2_becomes_true_inside_p1) annotation (Line( + points={{21,30},{110,30}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(becomesTrueInside2.y, c_b3_becomes_true_inside_p1) annotation (Line( + points={{21,-10},{110,-10}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(becomesTrueInside3.y, c_b4_becomes_true_inside_p1) annotation (Line( + points={{21,-50},{110,-50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(booleanToBoolean4_3.y, becomesTrueInside3.u) annotation (Line(points= + {{-15.6,-70},{-10,-70},{-10,-46},{-1,-46},{-1,-45}}, color={162,29,33})); + connect(booleanToBoolean4_2.y, becomesTrueInside2.u) annotation (Line(points= + {{-15.6,-30},{-8,-30},{-8,-5},{-1,-5}}, color={162,29,33})); + connect(booleanToBoolean4_1.y, becomesTrueInside1.u) annotation (Line(points= + {{-15.6,10},{-6,10},{-6,35},{-1,35}}, color={162,29,33})); + connect(becomesTrueInside2.tl, becomesTrueInside1.tl) annotation (Line(points= + {{-1,-15},{-40,-15},{-40,25},{-1,25}}, color={0,0,255})); + connect(becomesTrueInside3.tl, becomesTrueInside1.tl) annotation (Line(points= + {{-1,-55},{-40,-55},{-40,25},{-1,25}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-250, + -100},{250,100}})), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-250,-100},{250, + 100}}))); +end BecomesTrueInside_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/package.mo new file mode 100644 index 0000000..884862a --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package BecomesTrueInside_no_ext +end BecomesTrueInside_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/package.order b/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/package.order new file mode 100644 index 0000000..f64e4ff --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrueInside_no_ext/package.order @@ -0,0 +1 @@ +BecomesTrueInside_no_ext diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/BecomesTrue_no_ext.mo b/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/BecomesTrue_no_ext.mo new file mode 100644 index 0000000..d631e99 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/BecomesTrue_no_ext.mo @@ -0,0 +1,86 @@ +within CRML_test.ETL.BecomesTrue_no_ext; +model BecomesTrue_no_ext + CRML.Blocks.Events.ClockEvent clockEvent1 + annotation (Placement(transformation(extent={{24,44},{36,56}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent(x(start=true)) + annotation (Placement(transformation(extent={{-4,46},{4,54}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + instant={2.5,5,7.5,9}, + option_width=false) + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-24,46},{-16,54}}))); + CRML.Blocks.Events.ShowEvent show_c1 + annotation (Placement(transformation(extent={{56,32},{64,40}}))); + CRML.Blocks.Events.ClockEvent clockEvent2 + annotation (Placement(transformation(extent={{24,4},{36,16}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent1(x(start=true)) + annotation (Placement(transformation(extent={{-4,6},{4,14}}))); + CRML.Blocks.Logical.BooleanConstant b2 + annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-24,6},{-16,14}}))); + CRML.Blocks.Events.ShowEvent show_c2 + annotation (Placement(transformation(extent={{56,-8},{64,0}}))); + CRML.Blocks.Events.ClockEvent clockEvent3 + annotation (Placement(transformation(extent={{24,-36},{36,-24}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent2 + annotation (Placement(transformation(extent={{-4,-34},{4,-26}}))); + CRML.Blocks.Logical.BooleanConstant b3(K=false) + annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_3 + annotation (Placement(transformation(extent={{-24,-34},{-16,-26}}))); + CRML.Blocks.Events.ShowEvent show_c3 + annotation (Placement(transformation(extent={{56,-48},{64,-40}}))); + CRML.ETL.Connectors.ClockOutput c1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.ClockOutput c2 + annotation (Placement(transformation(extent={{100,0},{120,20}}))); + CRML.ETL.Connectors.ClockOutput c3 + annotation (Placement(transformation(extent={{100,-40},{120,-20}}))); +equation + connect(clockEvent1.u, event4ToEvent.y) + annotation (Line(points={{23.4,50},{4.4,50}}, color={217,67,180})); + connect(b1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-59,50},{-24.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, event4ToEvent.u) + annotation (Line(points={{-15.6,50},{-4.4,50}}, color={162,29,33})); + connect(show_c1.u, event4ToEvent.y) annotation (Line(points={{55.6,36},{12,36}, + {12,50},{4.4,50}}, color={217,67,180})); + connect(clockEvent2.u, event4ToEvent1.y) + annotation (Line(points={{23.4,10},{4.4,10}}, color={217,67,180})); + connect(b2.y, booleanToBoolean4_2.u) annotation (Line(points={{-59,10},{-24.4, + 10}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, event4ToEvent1.u) annotation (Line(points={{-15.6, + 10},{-4.4,10}}, color={162,29, + 33})); + connect(show_c2.u, event4ToEvent1.y) annotation (Line(points={{55.6,-4},{12, + -4},{12,10},{4.4,10}}, + color={217,67,180})); + connect(clockEvent3.u, event4ToEvent2.y) + annotation (Line(points={{23.4,-30},{4.4,-30}}, color={217,67,180})); + connect(b3.y, booleanToBoolean4_3.u) + annotation (Line(points={{-59,-30},{-24.4,-30}}, color={217,67,180})); + connect(booleanToBoolean4_3.y, event4ToEvent2.u) + annotation (Line(points={{-15.6,-30},{-4.4,-30}}, color={162,29,33})); + connect(show_c3.u, event4ToEvent2.y) annotation (Line(points={{55.6,-44},{12, + -44},{12,-30},{4.4,-30}}, color={217,67,180})); + connect(clockEvent1.y, c1) annotation (Line( + points={{36.6,50},{110,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent2.y, c2) annotation (Line( + points={{36.6,10},{110,10}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent3.y, c3) annotation (Line( + points={{36.6,-30},{110,-30}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BecomesTrue_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/package.mo new file mode 100644 index 0000000..52ecbc2 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package BecomesTrue_no_ext +end BecomesTrue_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/package.order b/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/package.order new file mode 100644 index 0000000..5aeb596 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/BecomesTrue_no_ext/package.order @@ -0,0 +1 @@ +BecomesTrue_no_ext diff --git a/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver.mo b/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver.mo new file mode 100644 index 0000000..d0c0c29 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver.mo @@ -0,0 +1,62 @@ +within CRML_test.ETL.CheckOver; +partial block CheckOver + Utilities.Boolean4Connector phi1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,-10},{-100,10}}), iconTransformation( + extent={{-120,-10},{-100,10}}))); + Utilities.TimeLocatorConnector[N] P1 annotation (Placement(transformation( + extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10, + 110}}))); + CRML.ETL.Connectors.Boolean4Output b_check_over + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.ETL.Requirements.CheckOver checkOver annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}))); +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; +equation +// Text( +// extent={{-74,32},{74,-36}}, +// lineColor={0,0,0}, +// fillColor={28,108,200}, +// fillPattern=FillPattern.Solid, +// textString=boxName), + connect(checkOver.y, b_check_over) annotation( + Line(points = {{12, 0}, {110, 0}}, color = {162, 29, 33})); + connect(checkOver.tl, P1) annotation( + Line(points = {{0, 10}, {0, 100}}, color = {0, 0, 255}, thickness = 0.5)); + connect(checkOver.u, phi1) annotation( + Line(points = {{-10, 0}, {-110, 0}}, color = {162, 29, 33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + fillColor={162,29,33}, + lineThickness=5, + fillPattern=FillPattern.Solid, + borderPattern=BorderPattern.Raised, + lineColor={0,0,0}), + Rectangle( + extent={{-78,80},{82,-80}}, + lineColor={175,175,175}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-70,72},{70,44}}, + lineColor={28,108,200}, + textString="check"), + Text( + extent={{-70,18},{70,-10}}, + lineColor={28,108,200}, + textString="over")}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end CheckOver; diff --git a/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver_externals.mo b/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver_externals.mo new file mode 100644 index 0000000..18effa8 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver_externals.mo @@ -0,0 +1,56 @@ +within CRML_test.ETL.CheckOver; +model CheckOver_externals + inner CRML.TimeLocators.Continuous.Master master annotation( + Placement(transformation(origin = {50, -10}, extent = {{-10, -10}, {10, 10}}))); + CRML.Blocks.Logical.BooleanTable boolean4Constant1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.ETL.Connectors.Boolean4Output phi1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-20,46},{-12,54}}))); + CRML.Blocks.Logical4.And4 and4_1 + annotation (Placement(transformation(extent={{0,32},{20,52}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant3(K=CRML.ETL.Types.Boolean4.undecided) + annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-4,-54},{4,-46}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] tl1 + annotation (Placement(transformation(extent={{100,-40},{120,-20}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); + CRML.ETL.Connectors.CRMLPeriodOutput P1 + annotation (Placement(transformation(extent={{100,-90},{120,-70}}))); + CRML.CompilerCompliancy.CRMLPeriodTimePeriod cRMLPeriodTimePeriod + annotation (Placement(transformation(extent={{40,-90},{60,-70}}))); + protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; +equation + connect(boolean4Constant1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{-20.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, and4_1.u1) + annotation (Line(points={{-11.6,50},{-1,50}}, color={162,29,33})); + connect(boolean4Constant3.y, and4_1.u2) annotation (Line(points={{-13,30},{-6, + 30},{-6,34},{-1,34}}, color={162,29,33})); + connect(and4_1.y, phi1) annotation (Line(points={{21,42},{66,42},{66,50},{110, + 50}}, color={162,29,33})); + connect(b1.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,-50},{-4.4,-50}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, during.u) + annotation (Line(points={{4.4,-50},{39,-50}}, color={162,29,33})); + connect(during.y, tl1) annotation (Line(points={{50,-60},{50,-64},{96,-64},{ + 96,-30},{110,-30}}, color={0,0,255})); + connect(cRMLPeriodTimePeriod.tl, during.y[1]) + annotation (Line(points={{50,-70},{50,-60}}, color={0,0,255})); + connect(cRMLPeriodTimePeriod.y, P1) + annotation (Line(points={{61,-80},{110,-80}}, color={255,170,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end CheckOver_externals; diff --git a/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver_verif.mo b/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver_verif.mo new file mode 100644 index 0000000..2733366 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CheckOver/CheckOver_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.CheckOver; +model CheckOver_verif + extends CheckOver; + CheckOver_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + P1[:] =externals.tl1[:]; + phi1 =externals.phi1; + 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 CheckOver_verif; diff --git a/libraries/modelica/CRML_test/ETL/CheckOver/package.mo b/libraries/modelica/CRML_test/ETL/CheckOver/package.mo new file mode 100644 index 0000000..027aebc --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CheckOver/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package CheckOver +end CheckOver; diff --git a/libraries/modelica/CRML_test/ETL/CheckOver/package.order b/libraries/modelica/CRML_test/ETL/CheckOver/package.order new file mode 100644 index 0000000..a81f4c3 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CheckOver/package.order @@ -0,0 +1,3 @@ +CheckOver +CheckOver_externals +CheckOver_verif diff --git a/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/CheckOver_no_ext.mo b/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/CheckOver_no_ext.mo new file mode 100644 index 0000000..2d752f9 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/CheckOver_no_ext.mo @@ -0,0 +1,56 @@ +within CRML_test.ETL.CheckOver_no_ext; +model CheckOver_no_ext + import CRML_test; + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable phi1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-20,46},{-12,54}}))); + CRML.Blocks.Logical4.And4 and4_1 + annotation (Placement(transformation(extent={{0,32},{20,52}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant3(K=CRML.ETL.Types.Boolean4.undecided) + annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-4,-54},{4,-46}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); + CRML.ETL.Connectors.Boolean4Output b_check_over + annotation (Placement(transformation(extent={{316,-10},{336,10}}))); + CRML.ETL.Requirements.CheckOver checkOver + annotation (Placement(transformation(extent={{180,-10},{200,10}}))); +equation + connect(phi1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{-20.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, and4_1.u1) + annotation (Line(points={{-11.6,50},{-1,50}}, color={162,29,33})); + connect(boolean4Constant3.y, and4_1.u2) annotation (Line(points={{-13,30},{-6, + 30},{-6,34},{-1,34}}, color={162,29,33})); + connect(b1.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,-50},{-4.4,-50}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, during.u) + annotation (Line(points={{4.4,-50},{39,-50}}, color={162,29,33})); + connect(checkOver.y, b_check_over) + annotation (Line(points={{201,0},{326,0}}, color={162,29,33})); + connect(during.y, checkOver.tl) annotation (Line(points={{50,-60},{50,-78},{ + 140,-78},{140,38},{190,38},{190,10}}, color={0,0,255})); + connect(and4_1.y, checkOver.u) annotation (Line(points={{21,42},{62,42},{62, + 40},{100,40},{100,0},{179,0}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{320,100}}, + initialScale=0.1)), Diagram( + coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{320,100}}, + initialScale=0.1))); +end CheckOver_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/package.mo new file mode 100644 index 0000000..f14ef8d --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package CheckOver_no_ext +end CheckOver_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/package.order b/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/package.order new file mode 100644 index 0000000..9370f90 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CheckOver_no_ext/package.order @@ -0,0 +1 @@ +CheckOver_no_ext diff --git a/libraries/modelica/CRML_test/ETL/CountInside/CountInside.mo b/libraries/modelica/CRML_test/ETL/CountInside/CountInside.mo new file mode 100644 index 0000000..dd9223c --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CountInside/CountInside.mo @@ -0,0 +1,102 @@ +within CRML_test.ETL.CountInside; +partial model CountInside + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + Utilities.TimeLocatorConnector + P1 + annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); + Utilities.ClockConnector C1 + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + CRML.ETL.Connectors.IntegerOutput i_count_ticks_of_c1_inside_p1 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.ETL.Blocks.Clocks.Inside inside + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + CRML.Blocks.Events.EventCounter eventCounter + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-4,-4},{4,4}}))); + CRML.Blocks.Logical.BooleanConstant booleanConstant(K=false) + annotation (Placement(transformation(extent={{20,-60},{40,-40}}))); +equation + connect(eventCounter.y, i_count_ticks_of_c1_inside_p1) + annotation (Line(points={{61,0},{110,0}}, color={255,127,0})); + connect(inside.y, clockToBoolean.u) annotation (Line( + points={{-39,0},{-4.8,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean.y, eventCounter.u) + annotation (Line(points={{4.4,0},{39,0}}, color={217,67,180})); + connect(inside.u, C1) annotation (Line( + points={{-61,3},{-80,3},{-80,30},{-110,30}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(inside.tl, P1) annotation (Line(points={{-61,-3},{-80,-3},{-80,-30},{ + -110,-30}}, color={0,0,255})); + connect(booleanConstant.y, eventCounter.reset) + annotation (Line(points={{41,-50},{50,-50},{50,-11}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-250,170},{250,110}}, + textString="%name", + lineColor={0,0,255}), Line(points={{-72,34}, + {-28,34},{-28,78},{-28,78},{-28,34},{74,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{-38,88},{-18,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line(points={{-86,-32},{-50,-32},{-50,12},{60,12},{60,-34},{88,-34}}, + color={28,108,200}), + Ellipse( + extent={{4,88},{24,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line( + points={{14,78},{14,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{64,88},{84,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line( + points={{74,78},{74,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{-82,88},{-62,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line( + points={{-72,78},{-72,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{-38,22},{-18,2}}, + lineColor={0,140,72}, + fillPattern=FillPattern.Solid, + fillColor={255,255,255}), + Ellipse( + extent={{4,22},{24,2}}, + lineColor={0,140,72}, + fillPattern=FillPattern.Solid, + fillColor={255,255,255}), + Line(points={{-86,-80},{-30,-80},{-30,-66},{12,-66},{12,-54},{76,-54},{ + 76,-54}}, color={244,125,35})}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end CountInside; diff --git a/libraries/modelica/CRML_test/ETL/CountInside/CountInside_externals.mo b/libraries/modelica/CRML_test/ETL/CountInside/CountInside_externals.mo new file mode 100644 index 0000000..78d9061 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CountInside/CountInside_externals.mo @@ -0,0 +1,59 @@ +within CRML_test.ETL.CountInside; +model CountInside_externals + +public + CRML.Blocks.Logical.BooleanTable bool2( + y0=false, + option_width=false, + instant={2,3,3.5,4.5,6,7.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable bool1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.ETL.Connectors.TimeLocatorOutput tl1 + annotation (Placement(transformation(extent={{100,-40},{120,-20}}))); + CRML.Blocks.Events.ShowEvent showEvent_b2 + annotation (Placement(transformation(extent={{16,56},{24,64}}))); + CRML.ETL.Connectors.ClockOutput C1 + annotation (Placement(transformation(extent={{100,0},{120,20}}))); + CRML.Blocks.Events.ShowEvent showEvent_b1 + annotation (Placement(transformation(extent={{16,-44},{24,-36}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{20,0},{40,20}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-4,-64},{4,-56}}))); + inner CRML.TimeLocators.Continuous.Master master + annotation (Placement(transformation(extent={{60,60},{80,80}}))); + CRML.CompilerCompliancy.CRMLPeriodTimePeriod cRMLPeriodTimePeriod + annotation (Placement(transformation(extent={{40,-100},{60,-80}}))); + CRML.ETL.Connectors.CRMLPeriodOutput P1 + annotation (Placement(transformation(extent={{100,-100},{120,-80}}))); +equation + connect(showEvent_b2.u, bool2.y) annotation (Line(points={{15.6,60},{-10,60}, + {-10,50},{-39,50}}, color={217,67,180})); + connect(bool1.y, showEvent_b1.u) annotation (Line(points={{-39,-50},{-12,-50}, + {-12,-40},{15.6,-40}}, color={217,67,180})); + connect(clockEvent.y, C1) annotation (Line( + points={{41,10},{110,10}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent.u, bool2.y) annotation (Line(points={{19,10},{0,10},{0,50}, + {-39,50}}, color={217,67,180})); + connect(during.y[1], tl1) annotation (Line(points={{50,-70},{50,-74},{96,-74}, + {96,-30},{110,-30}}, color={0,0,255})); + connect(bool1.y, booleanToBoolean4_1.u) annotation (Line(points={{-39,-50},{ + -12,-50},{-12,-60},{-4.4,-60}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, during.u) + annotation (Line(points={{4.4,-60},{39,-60}}, color={162,29,33})); + connect(cRMLPeriodTimePeriod.y, P1) + annotation (Line(points={{61,-90},{110,-90}}, color={255,170,255})); + connect(cRMLPeriodTimePeriod.tl, during.y[1]) + annotation (Line(points={{50,-80},{50,-70}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end CountInside_externals; diff --git a/libraries/modelica/CRML_test/ETL/CountInside/CountInside_verif.mo b/libraries/modelica/CRML_test/ETL/CountInside/CountInside_verif.mo new file mode 100644 index 0000000..b7b6ccc --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CountInside/CountInside_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.CountInside; +model CountInside_verif + extends CountInside; + CountInside_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + P1 =externals.tl1; + C1 = externals.C1; + 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 CountInside_verif; diff --git a/libraries/modelica/CRML_test/ETL/CountInside/package.mo b/libraries/modelica/CRML_test/ETL/CountInside/package.mo new file mode 100644 index 0000000..05a0fcb --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CountInside/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package CountInside +end CountInside; diff --git a/libraries/modelica/CRML_test/ETL/CountInside/package.order b/libraries/modelica/CRML_test/ETL/CountInside/package.order new file mode 100644 index 0000000..f94f2da --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CountInside/package.order @@ -0,0 +1,3 @@ +CountInside +CountInside_externals +CountInside_verif diff --git a/libraries/modelica/CRML_test/ETL/CountInside_no_ext/CountInside_no_ext.mo b/libraries/modelica/CRML_test/ETL/CountInside_no_ext/CountInside_no_ext.mo new file mode 100644 index 0000000..c9e3f41 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CountInside_no_ext/CountInside_no_ext.mo @@ -0,0 +1,60 @@ +within CRML_test.ETL.CountInside_no_ext; +model CountInside_no_ext + + +public + CRML.ETL.Connectors.IntegerOutput i_count_ticks_of_c1_inside_p1 + annotation (Placement(transformation(extent={{160,-10},{180,10}}))); + CRML.ETL.Blocks.Clocks.CountInside countInside + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); +public + CRML.Blocks.Logical.BooleanTable bool2( + y0=false, + option_width=false, + instant={2,3,3.5,4.5,6,7.5}) + annotation (Placement(transformation(extent={{-140,30},{-120,50}}))); + CRML.Blocks.Logical.BooleanTable P1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-140,-70},{-120,-50}}))); + CRML.Blocks.Events.ShowEvent showEvent_b2 + annotation (Placement(transformation(extent={{-64,46},{-56,54}}))); + CRML.Blocks.Events.ShowEvent showEvent_b1 + annotation (Placement(transformation(extent={{-64,-54},{-56,-46}}))); + CRML.Blocks.Events.ClockEvent c1 + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-84,-74},{-76,-66}}))); + inner CRML.TimeLocators.Continuous.Master master + annotation (Placement(transformation(extent={{-20,50},{0,70}}))); +equation + connect(showEvent_b2.u,bool2. y) annotation (Line(points={{-64.4,50},{-90,50}, + {-90,40},{-119,40}},color={217,67,180})); + connect(P1.y, showEvent_b1.u) annotation (Line(points={{-119,-60},{-92,-60},{ + -92,-50},{-64.4,-50}}, color={217,67,180})); + connect(c1.u, bool2.y) annotation (Line(points={{-61,0},{-80,0},{-80,40},{-119, + 40}}, color={217,67,180})); + connect(P1.y, booleanToBoolean4_1.u) annotation (Line(points={{-119,-60},{-92, + -60},{-92,-70},{-84.4,-70}}, color={217,67,180})); + connect(booleanToBoolean4_1.y,during. u) + annotation (Line(points={{-75.6,-70},{-41,-70}}, + color={162,29,33})); + connect(c1.y, countInside.u) annotation (Line( + points={{-39,0},{-39,3},{59,3}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(during.y[1], countInside.tl) annotation (Line(points={{-30,-80},{-30,-86}, + {48,-86},{48,-3},{59,-3}}, color={0,0,255})); + connect(countInside.y, i_count_ticks_of_c1_inside_p1) + annotation (Line(points={{81,0},{170,0}}, color={255,127,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-160,-100},{160,100}}, + initialScale=0.1)), Diagram( + coordinateSystem(preserveAspectRatio=false, + extent={{-160,-100},{160,100}}, + initialScale=0.1))); +end CountInside_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/CountInside_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/CountInside_no_ext/package.mo new file mode 100644 index 0000000..0a0b7f0 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CountInside_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package CountInside_no_ext +end CountInside_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/CountInside_no_ext/package.order b/libraries/modelica/CRML_test/ETL/CountInside_no_ext/package.order new file mode 100644 index 0000000..cdfa3a5 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CountInside_no_ext/package.order @@ -0,0 +1 @@ +CountInside_no_ext diff --git a/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/CteFalse_no_ext.mo b/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/CteFalse_no_ext.mo new file mode 100644 index 0000000..5420622 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/CteFalse_no_ext.mo @@ -0,0 +1,21 @@ +within CRML_test.ETL.CteFalse_no_ext; +model CteFalse_no_ext + import CRML; + CRML.ETL.Types.Boolean4 b_true = CRML.ETL.Types.Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = CRML.ETL.Types.Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = CRML.ETL.Types.Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = CRML.ETL.Types.Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_cte_false_true; + CRML.ETL.Types.Boolean4 b_cte_false_false; + CRML.ETL.Types.Boolean4 b_cte_false_undecided; + CRML.ETL.Types.Boolean4 b_cte_false_undefined; + CRML.Blocks.Logical4.Boolean4Constant cte_false(K=CRML.ETL.Types.Boolean4.false4); +equation + b_cte_false_true = cte_false.y; + b_cte_false_false = cte_false.y; + b_cte_false_undecided = cte_false.y; + b_cte_false_undefined = cte_false.y; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end CteFalse_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/package.mo new file mode 100644 index 0000000..4d744cb --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package CteFalse_no_ext +end CteFalse_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/package.order b/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/package.order new file mode 100644 index 0000000..aafbd84 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CteFalse_no_ext/package.order @@ -0,0 +1 @@ +CteFalse_no_ext diff --git a/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/CteTrue_no_ext.mo b/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/CteTrue_no_ext.mo new file mode 100644 index 0000000..d9f08b0 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/CteTrue_no_ext.mo @@ -0,0 +1,21 @@ +within CRML_test.ETL.CteTrue_no_ext; +model CteTrue_no_ext + import CRML; + CRML.ETL.Types.Boolean4 b_true = CRML.ETL.Types.Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = CRML.ETL.Types.Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = CRML.ETL.Types.Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = CRML.ETL.Types.Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_cte_true_true; + CRML.ETL.Types.Boolean4 b_cte_true_false; + CRML.ETL.Types.Boolean4 b_cte_true_undecided; + CRML.ETL.Types.Boolean4 b_cte_true_undefined; + CRML.Blocks.Logical4.Boolean4Constant cte_true(K=CRML.ETL.Types.Boolean4.true4); +equation + b_cte_true_true = cte_true.y; + b_cte_true_false = cte_true.y; + b_cte_true_undecided = cte_true.y; + b_cte_true_undefined = cte_true.y; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end CteTrue_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/package.mo new file mode 100644 index 0000000..e3bcc8a --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package CteTrue_no_ext +end CteTrue_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/package.order b/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/package.order new file mode 100644 index 0000000..65d6252 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/CteTrue_no_ext/package.order @@ -0,0 +1 @@ +CteTrue_no_ext diff --git a/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver.mo b/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver.mo new file mode 100644 index 0000000..ea3166e --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver.mo @@ -0,0 +1,71 @@ +within CRML_test.ETL.DecideOver; +partial block DecideOver + +public + Utilities.Boolean4Connector phi1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,-10},{-100,10}}), iconTransformation( + extent={{-120,-10},{-100,10}}))); + Utilities.TimeLocatorConnector P1 annotation (Placement(transformation( + extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10, + 110}}))); + CRML.ETL.Connectors.Boolean4Output b_decide_over + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.ETL.TimeLocators.Attributes.PeriodEnd + periodEnd + annotation (Placement(transformation(extent={{-4,-12},{4,-4}}))); + CRML.Blocks.Logical4.Or4 or4_n + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4 + annotation (Placement(transformation(extent={{20,-12},{28,-4}}))); +equation + connect(periodEnd.y, booleanToBoolean4.u) + annotation (Line(points={{4.4,-8},{19.6,-8}}, color={217,67,180})); + connect(or4_n.u2, booleanToBoolean4.y) + annotation (Line(points={{39,-8},{28.4,-8}}, color={162,29,33})); + connect(or4_n.y, b_decide_over) + annotation (Line(points={{61,0},{110,0}}, color={162,29,33})); +// Text( +// extent={{-74,32},{74,-36}}, +// lineColor={0,0,0}, +// fillColor={28,108,200}, +// fillPattern=FillPattern.Solid, +// textString=boxName), + connect(or4_n.u1, phi1) annotation (Line(points={{39,8},{-20,8},{-20,0},{-110, + 0}}, color={162,29,33})); + connect(periodEnd.tl, P1) + annotation (Line(points={{0,-4},{0,100}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + fillColor={162,29,33}, + lineThickness=5, + fillPattern=FillPattern.Solid, + borderPattern=BorderPattern.Raised, + lineColor={0,0,0}), + Rectangle( + extent={{-78,80},{82,-80}}, + lineColor={175,175,175}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-70,72},{70,44}}, + lineColor={28,108,200}, + textString="decide"), + Text( + extent={{-70,18},{70,-10}}, + lineColor={28,108,200}, + textString="over")}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end DecideOver; diff --git a/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver_externals.mo b/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver_externals.mo new file mode 100644 index 0000000..be85c19 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver_externals.mo @@ -0,0 +1,54 @@ +within CRML_test.ETL.DecideOver; +model DecideOver_externals + +public + CRML.Blocks.Logical.BooleanTable boolean4Constant1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.ETL.Connectors.Boolean4Output phi1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-20,46},{-12,54}}))); + CRML.Blocks.Logical4.And4 and4_1 + annotation (Placement(transformation(extent={{0,32},{20,52}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant3(K=CRML.ETL.Types.Boolean4.undecided) + annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-4,-54},{4,-46}}))); + CRML.ETL.Connectors.TimeLocatorOutput tl1 + annotation (Placement(transformation(extent={{100,-40},{120,-20}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); + CRML.ETL.Connectors.CRMLPeriodOutput P1 + annotation (Placement(transformation(extent={{100,-100},{120,-80}}))); + CRML.CompilerCompliancy.CRMLPeriodTimePeriod cRMLPeriodTimePeriod + annotation (Placement(transformation(extent={{40,-100},{60,-80}}))); +equation + connect(boolean4Constant1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{-20.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, and4_1.u1) + annotation (Line(points={{-11.6,50},{-1,50}}, color={162,29,33})); + connect(boolean4Constant3.y, and4_1.u2) annotation (Line(points={{-13,30},{-6, + 30},{-6,34},{-1,34}}, color={162,29,33})); + connect(and4_1.y, phi1) annotation (Line(points={{21,42},{66,42},{66,50},{110, + 50}}, color={162,29,33})); + connect(b1.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,-50},{-4.4,-50}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, during.u) + annotation (Line(points={{4.4,-50},{39,-50}}, color={162,29,33})); + connect(during.y[1], tl1) annotation (Line(points={{50,-60},{50,-64},{96,-64}, + {96,-30},{110,-30}}, color={0,0,255})); + connect(cRMLPeriodTimePeriod.y, P1) + annotation (Line(points={{61,-90},{110,-90}}, color={255,170,255})); + connect(cRMLPeriodTimePeriod.tl, during.y[1]) + annotation (Line(points={{50,-80},{50,-60}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end DecideOver_externals; diff --git a/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver_verif.mo b/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver_verif.mo new file mode 100644 index 0000000..a7ed669 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/DecideOver/DecideOver_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.DecideOver; +model DecideOver_verif + extends DecideOver; + DecideOver_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + P1 =externals.tl1; + phi1 =externals.phi1; + 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 DecideOver_verif; diff --git a/libraries/modelica/CRML_test/ETL/DecideOver/package.mo b/libraries/modelica/CRML_test/ETL/DecideOver/package.mo new file mode 100644 index 0000000..7d10fc4 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/DecideOver/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package DecideOver +end DecideOver; diff --git a/libraries/modelica/CRML_test/ETL/DecideOver/package.order b/libraries/modelica/CRML_test/ETL/DecideOver/package.order new file mode 100644 index 0000000..8595ef1 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/DecideOver/package.order @@ -0,0 +1,3 @@ +DecideOver +DecideOver_externals +DecideOver_verif diff --git a/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/DecideOver_no_ext.mo b/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/DecideOver_no_ext.mo new file mode 100644 index 0000000..86bd55e --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/DecideOver_no_ext.mo @@ -0,0 +1,55 @@ +within CRML_test.ETL.DecideOver_no_ext; +model DecideOver_no_ext + import CRML_test; + + +public + CRML.Blocks.Logical.BooleanTable phi1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-20,46},{-12,54}}))); + CRML.Blocks.Logical4.And4 and4_1 + annotation (Placement(transformation(extent={{0,32},{20,52}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant3(K=CRML.ETL.Types.Boolean4.undecided) + annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-4,-54},{4,-46}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); + CRML.ETL.Connectors.Boolean4Output b_decide_over + annotation (Placement(transformation(extent={{320,-10},{340,10}}))); + CRML.ETL.Requirements.DecideOver decideOver + annotation (Placement(transformation(extent={{160,-20},{200,20}}))); +equation + connect(phi1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{-20.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, and4_1.u1) + annotation (Line(points={{-11.6,50},{-1,50}}, color={162,29,33})); + connect(boolean4Constant3.y, and4_1.u2) annotation (Line(points={{-13,30},{-6, + 30},{-6,34},{-1,34}}, color={162,29,33})); + connect(b1.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,-50},{-4.4,-50}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, during.u) + annotation (Line(points={{4.4,-50},{39,-50}}, color={162,29,33})); + connect(decideOver.y, b_decide_over) + annotation (Line(points={{202,0},{330,0}}, color={162,29,33})); + connect(and4_1.y, decideOver.u) annotation (Line(points={{21,42},{56,42},{56,38}, + {60,38},{60,0},{158,0}}, color={162,29,33})); + connect(decideOver.tl, during.y[1]) annotation (Line(points={{180,20},{180,40}, + {120,40},{120,-70},{50,-70},{50,-60}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{320,100}}, + initialScale=0.1)), Diagram( + coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{320,100}}, + initialScale=0.1)), + experiment(StopTime=14, __Dymola_Algorithm="Dassl")); +end DecideOver_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/package.mo new file mode 100644 index 0000000..f4ba2b7 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package DecideOver_no_ext +end DecideOver_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/package.order b/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/package.order new file mode 100644 index 0000000..1812f9a --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/DecideOver_no_ext/package.order @@ -0,0 +1 @@ +DecideOver_no_ext diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver.mo b/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver.mo new file mode 100644 index 0000000..c064bfa --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver.mo @@ -0,0 +1,90 @@ +within CRML_test.ETL.EvaluateOver; +partial block EvaluateOver + +public + Utilities.Boolean4Connector phi1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,-10},{-100,10}}), iconTransformation( + extent={{-120,-10},{-100,10}}))); + Utilities.TimeLocatorConnector P1 annotation (Placement(transformation( + extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10, + 110}}))); + CRML.ETL.Connectors.Boolean4Output b_evaluate_over + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + IntegrateUndefined integrateUndefined + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Requirements.DecideOver decideOver + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant(K=CRML.ETL.Types.Boolean4.false4) + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + CRML.Blocks.Events.EventFilter eventFilter + annotation (Placement(transformation(extent={{-20,-10},{0,10}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4 + annotation (Placement(transformation(extent={{6,-4},{14,4}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent + annotation (Placement(transformation(extent={{-44,4},{-36,12}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent1 + annotation (Placement(transformation(extent={{-44,-24},{-36,-16}}))); +equation +// Text( +// extent={{-74,32},{74,-36}}, +// lineColor={0,0,0}, +// fillColor={28,108,200}, +// fillPattern=FillPattern.Solid, +// textString=boxName), + connect(decideOver.u, phi1) + annotation (Line(points={{-81,0},{-110,0}}, color={162,29,33})); + connect(eventFilter.y, booleanToBoolean4.u) + annotation (Line(points={{1,0},{5.6,0}}, color={217,67,180})); + connect(decideOver.y, event4ToEvent.u) annotation (Line(points={{-59,0},{-50,0}, + {-50,8},{-44.4,8}}, color={162,29,33})); + connect(event4ToEvent1.u, phi1) annotation (Line(points={{-44.4,-20},{-90,-20}, + {-90,0},{-110,0}}, color={162,29,33})); + connect(event4ToEvent1.y, eventFilter.u) annotation (Line(points={{-35.6,-20}, + {-26,-20},{-26,0},{-21,0}}, color={217,67,180})); + connect(event4ToEvent.y, eventFilter.cond) + annotation (Line(points={{-35.6,8},{-21,8}}, color={217,67,180})); + connect(decideOver.tl, P1) annotation (Line(points={{-70,10},{-70,80},{0,80}, + {0,100}}, color={0,0,255})); + connect(integrateUndefined.tl, P1) annotation (Line(points={{50,10},{50,80},{ + 0,80},{0,100}}, color={0,0,255})); + connect(boolean4Constant.y, integrateUndefined.a) annotation (Line(points={{1, + 50},{20,50},{20,8},{39,8}}, color={162,29,33})); + connect(booleanToBoolean4.y, integrateUndefined.u) + annotation (Line(points={{14.4,0},{39,0}}, color={162,29,33})); + connect(integrateUndefined.y, b_evaluate_over) + annotation (Line(points={{61,0},{110,0}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + fillColor={162,29,33}, + lineThickness=5, + fillPattern=FillPattern.Solid, + borderPattern=BorderPattern.Raised, + lineColor={0,0,0}), + Rectangle( + extent={{-78,80},{82,-80}}, + lineColor={175,175,175}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-70,72},{70,44}}, + lineColor={28,108,200}, + textString="Check"), + Text( + extent={{-70,18},{70,-10}}, + lineColor={28,108,200}, + textString="at end")}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end EvaluateOver; diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver_externals.mo b/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver_externals.mo new file mode 100644 index 0000000..10bf011 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver_externals.mo @@ -0,0 +1,55 @@ +within CRML_test.ETL.EvaluateOver; +model EvaluateOver_externals + + +public + CRML.Blocks.Logical.BooleanTable boolean4Constant1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.ETL.Connectors.Boolean4Output phi1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-20,46},{-12,54}}))); + CRML.Blocks.Logical4.And4 and4_1 + annotation (Placement(transformation(extent={{0,32},{20,52}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant3(K=CRML.ETL.Types.Boolean4.undecided) + annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-4,-54},{4,-46}}))); + CRML.ETL.Connectors.TimeLocatorOutput tl1 + annotation (Placement(transformation(extent={{100,-40},{120,-20}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); + CRML.ETL.Connectors.CRMLPeriodOutput P1 + annotation (Placement(transformation(extent={{100,-90},{120,-70}}))); + CRML.CompilerCompliancy.CRMLPeriodTimePeriod cRMLPeriodTimePeriod + annotation (Placement(transformation(extent={{40,-90},{60,-70}}))); +equation + connect(boolean4Constant1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{-20.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, and4_1.u1) + annotation (Line(points={{-11.6,50},{-1,50}}, color={162,29,33})); + connect(boolean4Constant3.y, and4_1.u2) annotation (Line(points={{-13,30},{-6, + 30},{-6,34},{-1,34}}, color={162,29,33})); + connect(and4_1.y, phi1) annotation (Line(points={{21,42},{66,42},{66,50},{110, + 50}}, color={162,29,33})); + connect(b1.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,-50},{-4.4,-50}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, during.u) + annotation (Line(points={{4.4,-50},{39,-50}}, color={162,29,33})); + connect(during.y[1], tl1) annotation (Line(points={{50,-60},{50,-64},{96,-64}, + {96,-30},{110,-30}}, color={0,0,255})); + connect(cRMLPeriodTimePeriod.tl, during.y[1]) + annotation (Line(points={{50,-70},{50,-60}}, color={0,0,255})); + connect(cRMLPeriodTimePeriod.y, P1) + annotation (Line(points={{61,-80},{110,-80}}, color={255,170,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end EvaluateOver_externals; diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver_verif.mo b/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver_verif.mo new file mode 100644 index 0000000..dedef8d --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver/EvaluateOver_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.EvaluateOver; +model EvaluateOver_verif + extends EvaluateOver; + EvaluateOver_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + P1 =externals.tl1; + phi1 =externals.phi1; + 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 EvaluateOver_verif; diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver/IntegrateUndefined.mo b/libraries/modelica/CRML_test/ETL/EvaluateOver/IntegrateUndefined.mo new file mode 100644 index 0000000..64c925d --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver/IntegrateUndefined.mo @@ -0,0 +1,65 @@ +within CRML_test.ETL.EvaluateOver; +block IntegrateUndefined + import CRML.ETL.Types.Boolean4; + +protected + Boolean4 x(start=Boolean4.undefined, fixed=true); + Boolean4 d; + Boolean4 c; + Boolean4 v; + Boolean timePeriod(start=false, fixed=true) = tl.timePeriod; + Boolean not_timePeriod(start=true, fixed=true) = not tl.timePeriod; + Boolean sync1(start=false, fixed=true); + Boolean sync2(start=false, fixed=true); + +public + CRML.ETL.Connectors.Boolean4Input u(start=Boolean4.false4, fixed=true) + annotation (Placement(transformation(extent={{-120,-10},{-100,10}}))); + CRML.ETL.Connectors.Boolean4Output y + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.ETL.Connectors.TimeLocatorInput tl + annotation (Placement(transformation(extent={{-10,90},{10,110}}))); +public + CRML.ETL.Connectors.Boolean4Input a + annotation (Placement(transformation(extent={{-120,70},{-100,90}}))); + // Not taken into account in this version (set to undefined by default) +equation + + /* Compute the decision event d */ + d = CRML.Blocks.Logical4.or4(Boolean4.true4, CRML.ETL.Types.cvBooleanToBoolean4(edge( + not_timePeriod))); + + /* Determine whether the change of the condition u happens at the same instant as the start of the time period tl */ + sync1 = u <> pre(u) and edge(timePeriod); + + /* Determine whether the change of the condition u happens at the same instant as the end of the time period tl */ + sync2 = u <> pre(u) and edge(not_timePeriod); + + /* Compute the condition c from the condition u within the bounds of the time period tl */ + c = if (tl.isLeftBoundaryIncluded and edge(sync1)) or (not tl.isRightBoundaryIncluded and edge(sync2)) then pre(u) else u; + + /* Compute the integral of c over the time period tl, taking into account the fact + that the same time thread tl may accomodate several non-overlapping time periods */ + v = if timePeriod or edge(not_timePeriod) then + CRML.ETL.Evaluator.TemporalOperators.mul4(d, c) else Boolean4.undefined; + x = if edge(timePeriod) then CRML.Blocks.Logical4.and4(pre(x), v) else + CRML.ETL.Evaluator.TemporalOperators.add4(pre(x), v); + + /* The output y is the value of the integral of c until the current time */ + y = x; + + annotation (Placement(transformation(extent={{100,-90},{120,-70}})), + Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + fillColor={255,213,170}, + lineThickness=5, + fillPattern=FillPattern.Solid, + borderPattern=BorderPattern.Raised, + lineColor={0,0,0}), Text( + extent={{-76,54},{74,-50}}, + lineColor={0,0,0}, + fontName="Symbol", + textString="")}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end IntegrateUndefined; diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver/package.mo b/libraries/modelica/CRML_test/ETL/EvaluateOver/package.mo new file mode 100644 index 0000000..faf2ea3 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package EvaluateOver +end EvaluateOver; diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver/package.order b/libraries/modelica/CRML_test/ETL/EvaluateOver/package.order new file mode 100644 index 0000000..7a9b230 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver/package.order @@ -0,0 +1,4 @@ +EvaluateOver +EvaluateOver_externals +EvaluateOver_verif +IntegrateUndefined diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/EvaluateOver_no_ext.mo b/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/EvaluateOver_no_ext.mo new file mode 100644 index 0000000..11421ea --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/EvaluateOver_no_ext.mo @@ -0,0 +1,56 @@ +within CRML_test.ETL.EvaluateOver_no_ext; +model EvaluateOver_no_ext + import CRML_test; + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable phi1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-20,46},{-12,54}}))); + CRML.Blocks.Logical4.And4 and4_1 + annotation (Placement(transformation(extent={{0,32},{20,52}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant3(K=CRML.ETL.Types.Boolean4.undecided) + annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-4,-54},{4,-46}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); + CRML.ETL.Connectors.Boolean4Output b_evaluate_over + annotation (Placement(transformation(extent={{316,-10},{336,10}}))); + CRML.ETL.Requirements.EvaluateOver evaluateOver + annotation (Placement(transformation(extent={{160,-10},{180,10}}))); +equation + connect(phi1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{-20.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, and4_1.u1) + annotation (Line(points={{-11.6,50},{-1,50}}, color={162,29,33})); + connect(boolean4Constant3.y, and4_1.u2) annotation (Line(points={{-13,30},{-6, + 30},{-6,34},{-1,34}}, color={162,29,33})); + connect(b1.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,-50},{-4.4,-50}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, during.u) + annotation (Line(points={{4.4,-50},{39,-50}}, color={162,29,33})); + connect(and4_1.y, evaluateOver.u) annotation (Line(points={{21,42},{78,42},{ + 78,0},{159,0}}, color={162,29,33})); + connect(during.y[1], evaluateOver.tl) annotation (Line(points={{50,-60},{50, + -80},{140,-80},{140,20},{170,20},{170,10}}, color={0,0,255})); + connect(evaluateOver.y, b_evaluate_over) + annotation (Line(points={{181,0},{326,0}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{320,100}}, + initialScale=0.1)), Diagram( + coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{320,100}}, + initialScale=0.1))); +end EvaluateOver_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/package.mo new file mode 100644 index 0000000..d6801b8 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package EvaluateOver_no_ext +end EvaluateOver_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/package.order b/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/package.order new file mode 100644 index 0000000..b090072 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/EvaluateOver_no_ext/package.order @@ -0,0 +1 @@ +EvaluateOver_no_ext diff --git a/libraries/modelica/CRML_test/ETL/Id_no_ext/Id_no_ext.mo b/libraries/modelica/CRML_test/ETL/Id_no_ext/Id_no_ext.mo new file mode 100644 index 0000000..7e4f1c6 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Id_no_ext/Id_no_ext.mo @@ -0,0 +1,20 @@ +within CRML_test.ETL.Id_no_ext; +model Id_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_id_true; + CRML.ETL.Types.Boolean4 b_id_false; + CRML.ETL.Types.Boolean4 b_id_undecided; + CRML.ETL.Types.Boolean4 b_id_undefined; +equation + b_id_true = b_true; + b_id_false = b_false; + b_id_undecided = b_undecided; + b_id_undefined = b_undefined; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Id_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Id_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/Id_no_ext/package.mo new file mode 100644 index 0000000..f02d347 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Id_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Id_no_ext +end Id_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Id_no_ext/package.order b/libraries/modelica/CRML_test/ETL/Id_no_ext/package.order new file mode 100644 index 0000000..14a00af --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Id_no_ext/package.order @@ -0,0 +1 @@ +Id_no_ext diff --git a/libraries/modelica/CRML_test/ETL/Implies/Implies.mo b/libraries/modelica/CRML_test/ETL/Implies/Implies.mo new file mode 100644 index 0000000..51c17fc --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Implies/Implies.mo @@ -0,0 +1,13 @@ +within CRML_test.ETL.Implies; +partial model Implies + 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_implies_b2 + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); +equation + b1_implies_b2 = CRML.Blocks.Logical4.implies4(b1, b2); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Implies; diff --git a/libraries/modelica/CRML_test/ETL/Implies/Implies_externals.mo b/libraries/modelica/CRML_test/ETL/Implies/Implies_externals.mo new file mode 100644 index 0000000..ef90b3a --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Implies/Implies_externals.mo @@ -0,0 +1,18 @@ +within CRML_test.ETL.Implies; +model Implies_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 Implies_externals; diff --git a/libraries/modelica/CRML_test/ETL/Implies/Implies_verif.mo b/libraries/modelica/CRML_test/ETL/Implies/Implies_verif.mo new file mode 100644 index 0000000..294b2a8 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Implies/Implies_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.Implies; +model Implies_verif + extends Implies; + Implies_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + b2 = externals.b2; + 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 Implies_verif; diff --git a/libraries/modelica/CRML_test/ETL/Implies/package.mo b/libraries/modelica/CRML_test/ETL/Implies/package.mo new file mode 100644 index 0000000..aa99a45 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Implies/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Implies +end Implies; diff --git a/libraries/modelica/CRML_test/ETL/Implies/package.order b/libraries/modelica/CRML_test/ETL/Implies/package.order new file mode 100644 index 0000000..a3c2991 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Implies/package.order @@ -0,0 +1,3 @@ +Implies +Implies_externals +Implies_verif diff --git a/libraries/modelica/CRML_test/ETL/Implies_no_ext/Implies_no_ext.mo b/libraries/modelica/CRML_test/ETL/Implies_no_ext/Implies_no_ext.mo new file mode 100644 index 0000000..287a15d --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Implies_no_ext/Implies_no_ext.mo @@ -0,0 +1,47 @@ +within CRML_test.ETL.Implies_no_ext; +model Implies_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_true_implies_true; + CRML.ETL.Types.Boolean4 b_true_implies_false; + CRML.ETL.Types.Boolean4 b_true_implies_undecided; + CRML.ETL.Types.Boolean4 b_true_implies_undefined; + CRML.ETL.Types.Boolean4 b_false_implies_true; + CRML.ETL.Types.Boolean4 b_false_implies_false; + CRML.ETL.Types.Boolean4 b_false_implies_undecided; + CRML.ETL.Types.Boolean4 b_false_implies_undefined; + CRML.ETL.Types.Boolean4 b_undecided_implies_true; + CRML.ETL.Types.Boolean4 b_undecided_implies_false; + CRML.ETL.Types.Boolean4 b_undecided_implies_undecided; + CRML.ETL.Types.Boolean4 b_undecided_implies_undefined; + CRML.ETL.Types.Boolean4 b_undefined_implies_true; + CRML.ETL.Types.Boolean4 b_undefined_implies_false; + CRML.ETL.Types.Boolean4 b_undefined_implies_undecided; + CRML.ETL.Types.Boolean4 b_undefined_implies_undefined; +equation + b_true_implies_true = CRML.Blocks.Logical4.implies4(b_true, b_true); + b_true_implies_false = CRML.Blocks.Logical4.implies4(b_true, b_false); + b_true_implies_undecided = CRML.Blocks.Logical4.implies4(b_true, b_undecided); + b_true_implies_undefined = CRML.Blocks.Logical4.implies4(b_true, b_undefined); + + b_false_implies_true = CRML.Blocks.Logical4.implies4(b_false, b_true); + b_false_implies_false = CRML.Blocks.Logical4.implies4(b_false, b_false); + b_false_implies_undecided = CRML.Blocks.Logical4.implies4(b_false, b_undecided); + b_false_implies_undefined = CRML.Blocks.Logical4.implies4(b_false, b_undefined); + + b_undecided_implies_true = CRML.Blocks.Logical4.implies4(b_undecided, b_true); + b_undecided_implies_false = CRML.Blocks.Logical4.implies4(b_undecided, b_false); + b_undecided_implies_undecided = CRML.Blocks.Logical4.implies4(b_undecided, b_undecided); + b_undecided_implies_undefined = CRML.Blocks.Logical4.implies4(b_undecided, b_undefined); + + b_undefined_implies_true = CRML.Blocks.Logical4.implies4(b_undefined, b_true); + b_undefined_implies_false = CRML.Blocks.Logical4.implies4(b_undefined, b_false); + b_undefined_implies_undecided = CRML.Blocks.Logical4.implies4(b_undefined, b_undecided); + b_undefined_implies_undefined = CRML.Blocks.Logical4.implies4(b_undefined, b_undefined); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Implies_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Implies_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/Implies_no_ext/package.mo new file mode 100644 index 0000000..3c0bfc9 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Implies_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Implies_no_ext +end Implies_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Implies_no_ext/package.order b/libraries/modelica/CRML_test/ETL/Implies_no_ext/package.order new file mode 100644 index 0000000..601e57f --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Implies_no_ext/package.order @@ -0,0 +1 @@ +Implies_no_ext diff --git a/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/Increasing1_no_ext.mo b/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/Increasing1_no_ext.mo new file mode 100644 index 0000000..c9c7b40 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/Increasing1_no_ext.mo @@ -0,0 +1,36 @@ +within CRML_test.ETL.Increasing1_no_ext; +model Increasing1_no_ext + Integer x1 = 3; + Integer x2 = 7; + Integer x3 = 7; + + CRML.ETL.Types.Boolean4 b_increasing1_on_strictly_greater_1; + CRML.ETL.Types.Boolean4 b_increasing1_on_strictly_greater_2; + CRML.ETL.Types.Boolean4 b_increasing1_on_greater_or_equal_1; + CRML.ETL.Types.Boolean4 b_increasing1_on_greater_or_equal_2; + CRML.ETL.Types.Boolean4 b_increasing1_on_strictly_less_1; + CRML.ETL.Types.Boolean4 b_increasing1_on_strictly_less_2; + CRML.ETL.Types.Boolean4 b_increasing1_on_less_or_equal_1; + CRML.ETL.Types.Boolean4 b_increasing1_on_less_or_equal_2; + CRML.ETL.Types.Boolean4 b_increasing1_on_equal_1; + CRML.ETL.Types.Boolean4 b_increasing1_on_equal_2; + CRML.ETL.Types.Boolean4 b_increasing1_on_different_1; + CRML.ETL.Types.Boolean4 b_increasing1_on_different_2; + +equation + b_increasing1_on_strictly_greater_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 > x2); + b_increasing1_on_strictly_greater_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 > x1); + b_increasing1_on_greater_or_equal_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 >= x2); + b_increasing1_on_greater_or_equal_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 >= x1); + b_increasing1_on_strictly_less_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 >= x2); + b_increasing1_on_strictly_less_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 >= x1); + b_increasing1_on_less_or_equal_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 > x2); + b_increasing1_on_less_or_equal_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 > x1); + b_increasing1_on_equal_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 > x2); + b_increasing1_on_equal_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 > x3); + b_increasing1_on_different_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 > x2); + b_increasing1_on_different_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 > x3); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Increasing1_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/package.mo new file mode 100644 index 0000000..f793c20 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Increasing1_no_ext +end Increasing1_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/package.order b/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/package.order new file mode 100644 index 0000000..e62bbf1 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Increasing1_no_ext/package.order @@ -0,0 +1 @@ +Increasing1_no_ext diff --git a/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/Increasing2_no_ext.mo b/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/Increasing2_no_ext.mo new file mode 100644 index 0000000..9cefd04 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/Increasing2_no_ext.mo @@ -0,0 +1,36 @@ +within CRML_test.ETL.Increasing2_no_ext; +model Increasing2_no_ext + Integer x1 = 3; + Integer x2 = 7; + Integer x3 = 7; + + CRML.ETL.Types.Boolean4 b_increasing2_on_strictly_greater_1; + CRML.ETL.Types.Boolean4 b_increasing2_on_strictly_greater_2; + CRML.ETL.Types.Boolean4 b_increasing2_on_greater_or_equal_1; + CRML.ETL.Types.Boolean4 b_increasing2_on_greater_or_equal_2; + CRML.ETL.Types.Boolean4 b_increasing2_on_strictly_less_1; + CRML.ETL.Types.Boolean4 b_increasing2_on_strictly_less_2; + CRML.ETL.Types.Boolean4 b_increasing2_on_less_or_equal_1; + CRML.ETL.Types.Boolean4 b_increasing2_on_less_or_equal_2; + CRML.ETL.Types.Boolean4 b_increasing2_on_equal_1; + CRML.ETL.Types.Boolean4 b_increasing2_on_equal_2; + CRML.ETL.Types.Boolean4 b_increasing2_on_different_1; + CRML.ETL.Types.Boolean4 b_increasing2_on_different_2; + +equation + b_increasing2_on_strictly_greater_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 > x2); + b_increasing2_on_strictly_greater_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 > x1); + b_increasing2_on_greater_or_equal_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 >= x2); + b_increasing2_on_greater_or_equal_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 >= x1); + b_increasing2_on_strictly_less_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 >= x2); + b_increasing2_on_strictly_less_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 >= x1); + b_increasing2_on_less_or_equal_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 > x2); + b_increasing2_on_less_or_equal_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 > x1); + b_increasing2_on_equal_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 == x2); + b_increasing2_on_equal_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 == x3); + b_increasing2_on_different_1 = CRML.ETL.Types.cvBooleanToBoolean4(x1 <> x2); + b_increasing2_on_different_2 = CRML.ETL.Types.cvBooleanToBoolean4(x2 <> x3); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Increasing2_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/package.mo new file mode 100644 index 0000000..df2e008 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Increasing2_no_ext +end Increasing2_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/package.order b/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/package.order new file mode 100644 index 0000000..87a8620 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Increasing2_no_ext/package.order @@ -0,0 +1 @@ +Increasing2_no_ext diff --git a/libraries/modelica/CRML_test/ETL/Inside/Inside.mo b/libraries/modelica/CRML_test/ETL/Inside/Inside.mo new file mode 100644 index 0000000..22230e3 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Inside/Inside.mo @@ -0,0 +1,98 @@ +within CRML_test.ETL.Inside; +partial model Inside + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Events.EventFilter eventFilter + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + CRML.ETL.TimeLocators.Attributes.PeriodTimePeriod + periodTimePeriod + annotation (Placement(transformation(extent={{-84,-44},{-76,-36}}))); + CRML.ETL.Connectors.ClockOutput c_filtered_ticks_of_c1_inside_p1 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.Blocks.Events.ClockEvent + eventClock + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); + Utilities.ClockConnector C1 + annotation (Placement(transformation(extent={{-120,20},{-100,40}}))); + Utilities.TimeLocatorConnector P1 + annotation (Placement(transformation(extent={{-120,-40},{-100,-20}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-60,20},{-40,40}}))); +equation + connect(c_filtered_ticks_of_c1_inside_p1, eventClock.y) annotation (Line( + points={{110,0},{81,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(periodTimePeriod.tl, P1) annotation (Line(points={{-80,-36},{-80,-30}, + {-110,-30}}, color={0,0,255})); + connect(C1, clockToBoolean.u) + annotation (Line(points={{-110,30},{-62,30}}, color={0,0,0})); + connect(periodTimePeriod.y, eventFilter.cond) annotation (Line(points={{-75.6, + -40},{-20,-40},{-20,8},{-13,8}}, color={217,67,180})); + connect(eventFilter.u, clockToBoolean.y) annotation (Line(points={{-13,0},{ + -26,0},{-26,30},{-39,30}}, color={217,67,180})); + connect(eventFilter.y, eventClock.u) + annotation (Line(points={{9,0},{59,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-250,170},{250,110}}, + textString="%name", + lineColor={0,0,255}), Line(points={{-72,34}, + {-28,34},{-28,78},{-28,78},{-28,34},{74,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{-38,88},{-18,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line(points={{-86,-52},{-50,-52},{-50,-8},{60,-8},{60,-54},{88,-54}}, + color={0,0,0}), + Ellipse( + extent={{4,88},{24,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line( + points={{14,78},{14,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{64,88},{84,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line( + points={{74,78},{74,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{-82,88},{-62,68}}, + lineColor={0,140,72}, + fillColor={0,140,72}, + fillPattern=FillPattern.Solid), + Line( + points={{-72,78},{-72,34}}, + color={0,140,72}, + pattern=LinePattern.Dot), + Ellipse( + extent={{-38,2},{-18,-18}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{4,2},{24,-18}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Inside; diff --git a/libraries/modelica/CRML_test/ETL/Inside/Inside_externals.mo b/libraries/modelica/CRML_test/ETL/Inside/Inside_externals.mo new file mode 100644 index 0000000..fc89835 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Inside/Inside_externals.mo @@ -0,0 +1,74 @@ +within CRML_test.ETL.Inside; +model Inside_externals + +public + CRML.Blocks.Logical.BooleanTable bool2( + y0=false, + option_width=false, + instant={2,3,3.5,4.5,6,7.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable bool1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.ETL.Connectors.TimeLocatorOutput tl1 + annotation (Placement(transformation(extent={{100,-40},{120,-20}}))); + CRML.Blocks.Events.ShowEvent showEvent_b2 + annotation (Placement(transformation(extent={{16,56},{24,64}}))); + CRML.ETL.Connectors.ClockOutput clock1 + annotation (Placement(transformation(extent={{100,0},{120,20}}))); + CRML.Blocks.Events.ShowEvent showEvent_b1 + annotation (Placement(transformation(extent={{16,-44},{24,-36}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{20,0},{40,20}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-4,-64},{4,-56}}))); + inner CRML.TimeLocators.Continuous.Master master + annotation (Placement(transformation(extent={{60,60},{80,80}}))); + CRML.CompilerCompliancy.CRMLPeriodTimePeriod cRMLPeriodTimePeriod + annotation (Placement(transformation(extent={{40,-100},{60,-80}}))); + CRML.ETL.Connectors.CRMLPeriodOutput P1 + annotation (Placement(transformation(extent={{100,-90},{120,-70}}))); + CRML.CompilerCompliancy.CRMLClockClock cRMLClockClock + annotation (Placement(transformation(extent={{60,30},{80,50}}))); + CRML.ETL.Connectors.CRMLClockOutput C1 annotation (Placement(transformation( + extent={{100,30},{120,50}}), iconTransformation(extent={{100,30},{120, + 50}}))); +equation + connect(showEvent_b2.u, bool2.y) annotation (Line(points={{15.6,60},{-10,60}, + {-10,50},{-39,50}}, color={217,67,180})); + connect(bool1.y, showEvent_b1.u) annotation (Line(points={{-39,-50},{-12,-50}, + {-12,-40},{15.6,-40}}, color={217,67,180})); + connect(clockEvent.y, clock1) annotation (Line( + points={{41,10},{110,10}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent.u, bool2.y) annotation (Line(points={{19,10},{0,10},{0,50}, + {-39,50}}, color={217,67,180})); + connect(during.y[1], tl1) annotation (Line(points={{50,-70},{50,-74},{96,-74}, + {96,-30},{110,-30}}, color={0,0,255})); + connect(bool1.y, booleanToBoolean4_1.u) annotation (Line(points={{-39,-50},{ + -12,-50},{-12,-60},{-4.4,-60}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, during.u) + annotation (Line(points={{4.4,-60},{39,-60}}, color={162,29,33})); + connect(cRMLPeriodTimePeriod.y, P1) annotation (Line(points={{61,-90},{94,-90}, + {94,-80},{110,-80}}, color={255,170,255})); + connect(cRMLPeriodTimePeriod.tl, during.y[1]) + annotation (Line(points={{50,-80},{50,-70}}, color={0,0,255})); + connect(clockEvent.y, cRMLClockClock.c) annotation (Line( + points={{41,10},{54,10},{54,40},{59,40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(cRMLClockClock.y, C1) annotation (Line( + points={{81,40},{110,40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Inside_externals; diff --git a/libraries/modelica/CRML_test/ETL/Inside/Inside_verif.mo b/libraries/modelica/CRML_test/ETL/Inside/Inside_verif.mo new file mode 100644 index 0000000..d75372c --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Inside/Inside_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.Inside; +model Inside_verif + extends Inside; + Inside_externals externals + annotation (Placement(transformation(extent={{-200,20},{-140,80}}))); +equation + // Bindings + C1 =externals.clock1; + P1 =externals.tl1; + 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 Inside_verif; diff --git a/libraries/modelica/CRML_test/ETL/Inside/package.mo b/libraries/modelica/CRML_test/ETL/Inside/package.mo new file mode 100644 index 0000000..c55311c --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Inside/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Inside +end Inside; diff --git a/libraries/modelica/CRML_test/ETL/Inside/package.order b/libraries/modelica/CRML_test/ETL/Inside/package.order new file mode 100644 index 0000000..141c57f --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Inside/package.order @@ -0,0 +1,3 @@ +Inside +Inside_externals +Inside_verif diff --git a/libraries/modelica/CRML_test/ETL/Inside_no_ext/Inside_no_ext.mo b/libraries/modelica/CRML_test/ETL/Inside_no_ext/Inside_no_ext.mo new file mode 100644 index 0000000..e84287b --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Inside_no_ext/Inside_no_ext.mo @@ -0,0 +1,67 @@ +within CRML_test.ETL.Inside_no_ext; +model Inside_no_ext + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2,3,3.5,4.5,6,7.5}) + annotation (Placement(transformation(extent={{-100,30},{-80,50}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-100,-50},{-80,-30}}))); + CRML.ETL.Connectors.ClockOutput c_filtered_ticks_of_c1_inside_p1 + annotation (Placement(transformation(extent={{160,-10},{180,10}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{-38,30},{-18,50}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{0,-50},{20,-30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-36,-44},{-28,-36}}))); + inner CRML.TimeLocators.Continuous.Master master + annotation (Placement(transformation(extent={{60,60},{80,80}}))); + CRML.ETL.Blocks.Clocks.Inside inside + annotation (Placement(transformation(extent={{80,-10},{100,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput P1 + annotation (Placement(transformation(extent={{160,-70},{180,-50}}))); + CRML.ETL.Connectors.ClockOutput C1 + annotation (Placement(transformation(extent={{160,30},{180,50}}))); +equation + connect(booleanToBoolean4_1.y,during. u) + annotation (Line(points={{-27.6,-40},{-1,-40}}, + color={162,29,33})); + connect(clockEvent.u, b2.y) + annotation (Line(points={{-39,40},{-79,40}}, color={217,67,180})); + connect(b1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-79,-40},{-36.4,-40}}, color={217,67,180})); + connect(c_filtered_ticks_of_c1_inside_p1, inside.y) annotation (Line( + points={{170,0},{101,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent.y, inside.u) annotation (Line( + points={{-17,40},{12,40},{12,3},{79,3}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(during.y[1], inside.tl) annotation (Line(points={{10,-50},{10,-66},{ + 66,-66},{66,-3},{79,-3}}, color={0,0,255})); + connect(during.y[1], P1) annotation (Line(points={{10,-50},{10,-66},{66,-66}, + {66,-60},{170,-60}}, color={0,0,255})); + connect(clockEvent.y, C1) annotation (Line( + points={{-17,40},{170,40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-160,-100},{160,100}}, + initialScale=0.1)), Diagram( + coordinateSystem(preserveAspectRatio=false, + extent={{-160,-100},{160,100}}, + initialScale=0.1))); +end Inside_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Inside_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/Inside_no_ext/package.mo new file mode 100644 index 0000000..38c7c91 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Inside_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Inside_no_ext +end Inside_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Inside_no_ext/package.order b/libraries/modelica/CRML_test/ETL/Inside_no_ext/package.order new file mode 100644 index 0000000..4b5b517 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Inside_no_ext/package.order @@ -0,0 +1 @@ +Inside_no_ext diff --git a/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr.mo b/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr.mo new file mode 100644 index 0000000..8f59702 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr.mo @@ -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; diff --git a/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr_externals.mo b/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr_externals.mo new file mode 100644 index 0000000..471855a --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr_externals.mo @@ -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; diff --git a/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr_verif.mo b/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr_verif.mo new file mode 100644 index 0000000..a264d8d --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateOr/TemplateOr_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.TemplateOr; +model TemplateOr_verif + extends TemplateOr; + TemplateOr_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + b2 = externals.b2; + 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 TemplateOr_verif; diff --git a/libraries/modelica/CRML_test/ETL/TemplateOr/package.mo b/libraries/modelica/CRML_test/ETL/TemplateOr/package.mo new file mode 100644 index 0000000..583025b --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateOr/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package TemplateOr +end TemplateOr; diff --git a/libraries/modelica/CRML_test/ETL/TemplateOr/package.order b/libraries/modelica/CRML_test/ETL/TemplateOr/package.order new file mode 100644 index 0000000..fdd019d --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateOr/package.order @@ -0,0 +1,3 @@ +TemplateOr +TemplateOr_externals +TemplateOr_verif diff --git a/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/TemplateOr_no_ext.mo b/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/TemplateOr_no_ext.mo new file mode 100644 index 0000000..17ae7e8 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/TemplateOr_no_ext.mo @@ -0,0 +1,47 @@ +within CRML_test.ETL.TemplateOr_no_ext; +model TemplateOr_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_true_or_true; + CRML.ETL.Types.Boolean4 b_true_or_false; + CRML.ETL.Types.Boolean4 b_true_or_undecided; + CRML.ETL.Types.Boolean4 b_true_or_undefined; + CRML.ETL.Types.Boolean4 b_false_or_true; + CRML.ETL.Types.Boolean4 b_false_or_false; + CRML.ETL.Types.Boolean4 b_false_or_undecided; + CRML.ETL.Types.Boolean4 b_false_or_undefined; + CRML.ETL.Types.Boolean4 b_undecided_or_true; + CRML.ETL.Types.Boolean4 b_undecided_or_false; + CRML.ETL.Types.Boolean4 b_undecided_or_undecided; + CRML.ETL.Types.Boolean4 b_undecided_or_undefined; + CRML.ETL.Types.Boolean4 b_undefined_or_true; + CRML.ETL.Types.Boolean4 b_undefined_or_false; + CRML.ETL.Types.Boolean4 b_undefined_or_undecided; + CRML.ETL.Types.Boolean4 b_undefined_or_undefined; +equation + b_true_or_true = CRML.Blocks.Logical4.or4(b_true, b_true); + b_true_or_false = CRML.Blocks.Logical4.or4(b_true, b_false); + b_true_or_undecided = CRML.Blocks.Logical4.or4(b_true, b_undecided); + b_true_or_undefined = CRML.Blocks.Logical4.or4(b_true, b_undefined); + + b_false_or_true = CRML.Blocks.Logical4.or4(b_false, b_true); + b_false_or_false = CRML.Blocks.Logical4.or4(b_false, b_false); + b_false_or_undecided = CRML.Blocks.Logical4.or4(b_false, b_undecided); + b_false_or_undefined = CRML.Blocks.Logical4.or4(b_false, b_undefined); + + b_undecided_or_true = CRML.Blocks.Logical4.or4(b_undecided, b_true); + b_undecided_or_false = CRML.Blocks.Logical4.or4(b_undecided, b_false); + b_undecided_or_undecided = CRML.Blocks.Logical4.or4(b_undecided, b_undecided); + b_undecided_or_undefined = CRML.Blocks.Logical4.or4(b_undecided, b_undefined); + + b_undefined_or_true = CRML.Blocks.Logical4.or4(b_undefined, b_true); + b_undefined_or_false = CRML.Blocks.Logical4.or4(b_undefined, b_false); + b_undefined_or_undecided = CRML.Blocks.Logical4.or4(b_undefined, b_undecided); + b_undefined_or_undefined = CRML.Blocks.Logical4.or4(b_undefined, b_undefined); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TemplateOr_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/package.mo new file mode 100644 index 0000000..669d4cf --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package TemplateOr_no_ext +end TemplateOr_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/package.order b/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/package.order new file mode 100644 index 0000000..6f4610f --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateOr_no_ext/package.order @@ -0,0 +1 @@ +TemplateOr_no_ext diff --git a/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor.mo b/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor.mo new file mode 100644 index 0000000..6717c17 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor.mo @@ -0,0 +1,13 @@ +within CRML_test.ETL.TemplateXor; +partial model TemplateXor + 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_xor_b2 + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); +equation + b1_xor_b2 = CRML.Blocks.Logical4.xor4(b1, b2); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TemplateXor; diff --git a/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor_externals.mo b/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor_externals.mo new file mode 100644 index 0000000..907feff --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor_externals.mo @@ -0,0 +1,18 @@ +within CRML_test.ETL.TemplateXor; +model TemplateXor_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 TemplateXor_externals; diff --git a/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor_verif.mo b/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor_verif.mo new file mode 100644 index 0000000..226b524 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateXor/TemplateXor_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.ETL.TemplateXor; +model TemplateXor_verif + extends TemplateXor; + TemplateXor_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + b2 = externals.b2; + 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 TemplateXor_verif; diff --git a/libraries/modelica/CRML_test/ETL/TemplateXor/package.mo b/libraries/modelica/CRML_test/ETL/TemplateXor/package.mo new file mode 100644 index 0000000..1401ebf --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateXor/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package TemplateXor +end TemplateXor; diff --git a/libraries/modelica/CRML_test/ETL/TemplateXor/package.order b/libraries/modelica/CRML_test/ETL/TemplateXor/package.order new file mode 100644 index 0000000..87605fb --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateXor/package.order @@ -0,0 +1,3 @@ +TemplateXor +TemplateXor_externals +TemplateXor_verif diff --git a/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/TemplateXor_no_ext.mo b/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/TemplateXor_no_ext.mo new file mode 100644 index 0000000..0b1a18e --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/TemplateXor_no_ext.mo @@ -0,0 +1,47 @@ +within CRML_test.ETL.TemplateXor_no_ext; +model TemplateXor_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_true_xor_true; + CRML.ETL.Types.Boolean4 b_true_xor_false; + CRML.ETL.Types.Boolean4 b_true_xor_undecided; + CRML.ETL.Types.Boolean4 b_true_xor_undefined; + CRML.ETL.Types.Boolean4 b_false_xor_true; + CRML.ETL.Types.Boolean4 b_false_xor_false; + CRML.ETL.Types.Boolean4 b_false_xor_undecided; + CRML.ETL.Types.Boolean4 b_false_xor_undefined; + CRML.ETL.Types.Boolean4 b_undecided_xor_true; + CRML.ETL.Types.Boolean4 b_undecided_xor_false; + CRML.ETL.Types.Boolean4 b_undecided_xor_undecided; + CRML.ETL.Types.Boolean4 b_undecided_xor_undefined; + CRML.ETL.Types.Boolean4 b_undefined_xor_true; + CRML.ETL.Types.Boolean4 b_undefined_xor_false; + CRML.ETL.Types.Boolean4 b_undefined_xor_undecided; + CRML.ETL.Types.Boolean4 b_undefined_xor_undefined; +equation + b_true_xor_true = CRML.Blocks.Logical4.xor4(b_true, b_true); + b_true_xor_false = CRML.Blocks.Logical4.xor4(b_true, b_false); + b_true_xor_undecided = CRML.Blocks.Logical4.xor4(b_true, b_undecided); + b_true_xor_undefined = CRML.Blocks.Logical4.xor4(b_true, b_undefined); + + b_false_xor_true = CRML.Blocks.Logical4.xor4(b_false, b_true); + b_false_xor_false = CRML.Blocks.Logical4.xor4(b_false, b_false); + b_false_xor_undecided = CRML.Blocks.Logical4.xor4(b_false, b_undecided); + b_false_xor_undefined = CRML.Blocks.Logical4.xor4(b_false, b_undefined); + + b_undecided_xor_true = CRML.Blocks.Logical4.xor4(b_undecided, b_true); + b_undecided_xor_false = CRML.Blocks.Logical4.xor4(b_undecided, b_false); + b_undecided_xor_undecided = CRML.Blocks.Logical4.xor4(b_undecided, b_undecided); + b_undecided_xor_undefined = CRML.Blocks.Logical4.xor4(b_undecided, b_undefined); + + b_undefined_xor_true = CRML.Blocks.Logical4.xor4(b_undefined, b_true); + b_undefined_xor_false = CRML.Blocks.Logical4.xor4(b_undefined, b_false); + b_undefined_xor_undecided = CRML.Blocks.Logical4.xor4(b_undefined, b_undecided); + b_undefined_xor_undefined = CRML.Blocks.Logical4.xor4(b_undefined, b_undefined); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TemplateXor_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/package.mo new file mode 100644 index 0000000..1896262 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package TemplateXor_no_ext +end TemplateXor_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/package.order b/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/package.order new file mode 100644 index 0000000..ac2c096 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/TemplateXor_no_ext/package.order @@ -0,0 +1 @@ +TemplateXor_no_ext diff --git a/libraries/modelica/CRML_test/ETL/Varying1_no_ext/Varying1_no_ext.mo b/libraries/modelica/CRML_test/ETL/Varying1_no_ext/Varying1_no_ext.mo new file mode 100644 index 0000000..c077f25 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Varying1_no_ext/Varying1_no_ext.mo @@ -0,0 +1,23 @@ +within CRML_test.ETL.Varying1_no_ext; +model Varying1_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_varying1_on_id_true; + CRML.ETL.Types.Boolean4 b_varying1_on_id_false; + CRML.ETL.Types.Boolean4 b_varying1_on_id_undecided; + CRML.ETL.Types.Boolean4 b_varying1_on_id_undefined; + + CRML.Blocks.Logical4.Boolean4Constant cte_false(K=CRML.ETL.Types.Boolean4.false4); + +equation + b_varying1_on_id_true = cte_false.y; + b_varying1_on_id_false = cte_false.y; + b_varying1_on_id_undecided = cte_false.y; + b_varying1_on_id_undefined = cte_false.y; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Varying1_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Varying1_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/Varying1_no_ext/package.mo new file mode 100644 index 0000000..32b6335 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Varying1_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Varying1_no_ext +end Varying1_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Varying1_no_ext/package.order b/libraries/modelica/CRML_test/ETL/Varying1_no_ext/package.order new file mode 100644 index 0000000..239070e --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Varying1_no_ext/package.order @@ -0,0 +1 @@ +Varying1_no_ext diff --git a/libraries/modelica/CRML_test/ETL/Varying2_no_ext/Varying2_no_ext.mo b/libraries/modelica/CRML_test/ETL/Varying2_no_ext/Varying2_no_ext.mo new file mode 100644 index 0000000..a0408b8 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Varying2_no_ext/Varying2_no_ext.mo @@ -0,0 +1,23 @@ +within CRML_test.ETL.Varying2_no_ext; +model Varying2_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_varying2_on_id_true; + CRML.ETL.Types.Boolean4 b_varying2_on_id_false; + CRML.ETL.Types.Boolean4 b_varying2_on_id_undecided; + CRML.ETL.Types.Boolean4 b_varying2_on_id_undefined; + + CRML.Blocks.Logical4.Boolean4Constant cte_true(K=CRML.ETL.Types.Boolean4.true4); + +equation + b_varying2_on_id_true = cte_true.y; + b_varying2_on_id_false = cte_true.y; + b_varying2_on_id_undecided = cte_true.y; + b_varying2_on_id_undefined = cte_true.y; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end Varying2_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Varying2_no_ext/package.mo b/libraries/modelica/CRML_test/ETL/Varying2_no_ext/package.mo new file mode 100644 index 0000000..6d9bc61 --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Varying2_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.ETL; +package Varying2_no_ext +end Varying2_no_ext; diff --git a/libraries/modelica/CRML_test/ETL/Varying2_no_ext/package.order b/libraries/modelica/CRML_test/ETL/Varying2_no_ext/package.order new file mode 100644 index 0000000..c75638a --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/Varying2_no_ext/package.order @@ -0,0 +1 @@ +Varying2_no_ext diff --git a/libraries/modelica/CRML_test/ETL/package.mo b/libraries/modelica/CRML_test/ETL/package.mo new file mode 100644 index 0000000..af3c0eb --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/package.mo @@ -0,0 +1,19 @@ +within CRML_test; +package ETL +annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100,-100},{100,100}}, + radius=25.0), Text( + extent={{-42,38},{44,-30}}, + lineColor={0,0,0}, + fontName="Symbol", + textString=""), + Rectangle( + lineColor={128,128,128}, + fillPattern=FillPattern.None, + extent={{-100,-100},{100,100}}, + radius=25.0)})); +end ETL; diff --git a/libraries/modelica/CRML_test/ETL/package.order b/libraries/modelica/CRML_test/ETL/package.order new file mode 100644 index 0000000..535eafb --- /dev/null +++ b/libraries/modelica/CRML_test/ETL/package.order @@ -0,0 +1,31 @@ +BecomesFalse +BecomesFalse_no_ext +BecomesFalseInside +BecomesFalseInside_no_ext +BecomesTrue +BecomesTrue_no_ext +BecomesTrueInside +BecomesTrueInside_no_ext +CheckOver +CheckOver_no_ext +CountInside +CountInside_no_ext +CteFalse_no_ext +CteTrue_no_ext +DecideOver +DecideOver_no_ext +EvaluateOver +EvaluateOver_no_ext +Id_no_ext +Implies +Implies_no_ext +Increasing1_no_ext +Increasing2_no_ext +Inside +Inside_no_ext +TemplateOr +TemplateOr_no_ext +TemplateXor +TemplateXor_no_ext +Varying1_no_ext +Varying2_no_ext diff --git a/libraries/modelica/CRML_test/Examples/TrafficLight/Spec.mo b/libraries/modelica/CRML_test/Examples/TrafficLight/Spec.mo new file mode 100644 index 0000000..d6fb481 --- /dev/null +++ b/libraries/modelica/CRML_test/Examples/TrafficLight/Spec.mo @@ -0,0 +1,127 @@ +within CRML_test.Examples.TrafficLight; + +model Spec + CRML.TimeLocators.Continuous.AfterBefore afterBefore annotation( + Placement(transformation(extent = {{-40, 64}, {-20, 84}}))); + CRML.Requirements.CheckCountEqual checkInPCount(threshold = 0) annotation( + Placement(transformation(extent = {{-40, 24}, {-20, 44}}))); + CRML.TimeLocators.Continuous.AfterFor afterFor annotation( + Placement(transformation(extent = {{-40, -40}, {-20, -20}}))); + CRML.Blocks.Math.Constant const(k = 30) annotation( + Placement(transformation(extent = {{-80, -60}, {-60, -40}}))); + CRML.Requirements.Ensure checkBoolean annotation( + Placement(transformation(extent = {{-40, -80}, {-20, -60}}))); + CRML.TimeLocators.Continuous.AfterFor When annotation( + Placement(transformation(extent = {{100, 70}, {120, 90}}))); + CRML.Blocks.Math.Constant const1(k = 0.2) annotation( + Placement(transformation(extent = {{20, 14}, {40, 34}}))); + CRML.Requirements.CheckAtEnd checkInPCount1 annotation( + Placement(transformation(extent = {{100, 0}, {120, 20}}))); + CRML.Blocks.Math.Constant const2(k = 30) annotation( + Placement(transformation(extent = {{22, 50}, {42, 70}}))); + CRML.ETL.Connectors.BooleanInput red "External Boolean variable" annotation( + Placement(transformation(extent = {{-120, 70}, {-100, 90}}))); + CRML.ETL.Connectors.BooleanInput green annotation( + Placement(transformation(extent = {{-120, -90}, {-100, -70}}))); + CRML.ETL.Connectors.BooleanInput yellow "Boolean condition" annotation( + Placement(transformation(extent = {{-120, -10}, {-100, 10}}))); + CRML.Blocks.Logical4.ShowBoolean4 show_req1 annotation( + Placement(transformation(extent = {{-8, 20}, {14, 48}}))); + CRML.Blocks.Logical4.ShowBoolean4 show_req2 annotation( + Placement(transformation(extent = {{-10, -82}, {14, -58}}))); + CRML.Blocks.Logical4.ShowBoolean4 show_req3 annotation( + Placement(transformation(origin = {-2, 14}, extent = {{140, -2}, {162, 22}}))); + CRML.Blocks.Logical4.And4 and4_1 annotation( + Placement(transformation(extent = {{20, -58}, {40, -38}}))); + CRML.Blocks.Logical4.And4 and4_2 annotation( + Placement(transformation(extent = {{112, -50}, {132, -30}}))); + CRML.Blocks.Logical4.ShowBoolean4 show_req annotation( + Placement(transformation(extent = {{138, -52}, {160, -28}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 annotation( + Placement(transformation(extent = {{-84, 76}, {-76, 84}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 annotation( + Placement(transformation(extent = {{-84, 62}, {-76, 70}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_3 annotation( + Placement(transformation(extent = {{-84, -84}, {-76, -76}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_4 annotation( + Placement(transformation(extent = {{-84, -4}, {-76, 4}}))); + CRML.Blocks.Events.EventDelay booleanDelay annotation( + Placement(transformation(extent = {{58, 70}, {78, 90}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_5 annotation( + Placement(transformation(extent = {{84, 76}, {92, 84}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent annotation( + Placement(transformation(extent = {{42, 76}, {50, 84}}))); + CRML.ETL.Connectors.Boolean4Output req1 annotation( + Placement(transformation(origin = {170, 60}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {170, 60}, extent = {{-10, -10}, {10, 10}}))); + CRML.ETL.Connectors.Boolean4Output req2 annotation( + Placement(transformation(origin = {170, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {170, 0}, extent = {{-10, -10}, {10, 10}}))); + CRML.ETL.Connectors.Boolean4Output req3 annotation( + Placement(transformation(origin = {170, -60}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {170, -60}, extent = {{-10, -10}, {10, 10}}))); +equation + connect(afterBefore.y, checkInPCount.tl) annotation( + Line(points = {{-30, 64}, {-30, 44}}, color = {0, 0, 255})); + connect(const.y, afterFor.duration) annotation( + Line(points = {{-59, -50}, {-50, -50}, {-50, -38}, {-41, -38}}, color = {0, 0, 0})); + connect(afterFor.y, checkBoolean.tl) annotation( + Line(points = {{-30, -40}, {-30, -60}}, color = {0, 0, 255})); + connect(const1.y, When.duration) annotation( + Line(points = {{41, 24}, {90, 24}, {90, 72}, {99, 72}}, color = {0, 0, 0})); + connect(checkInPCount.y, show_req1.u) annotation( + Line(points = {{-19, 34}, {-8.55, 34}}, color = {162, 29, 33})); + connect(checkBoolean.y, show_req2.u) annotation( + Line(points = {{-19, -70}, {-10.6, -70}}, color = {162, 29, 33})); + connect(checkBoolean.y, and4_1.u2) annotation( + Line(points = {{-19, -70}, {-16, -70}, {-16, -56}, {19, -56}}, color = {162, 29, 33})); + connect(checkInPCount.y, and4_1.u1) annotation( + Line(points = {{-19, 34}, {-16, 34}, {-16, -40}, {19, -40}}, color = {162, 29, 33})); + connect(and4_2.y, show_req.u) annotation( + Line(points = {{133, -40}, {137.45, -40}}, color = {162, 29, 33})); + connect(and4_1.y, and4_2.u2) annotation( + Line(points = {{41, -48}, {111, -48}}, color = {162, 29, 33})); + connect(checkInPCount.u, booleanToBoolean4_1.y) annotation( + Line(points = {{-41, 34}, {-72, 34}, {-72, 80}, {-75.6, 80}}, color = {162, 29, 33})); + connect(booleanToBoolean4_1.u, red) annotation( + Line(points = {{-84.4, 80}, {-110, 80}}, color = {217, 67, 180})); + connect(yellow, booleanToBoolean4_2.u) annotation( + Line(points = {{-110, 0}, {-94, 0}, {-94, 66}, {-84.4, 66}}, color = {217, 67, 180})); + connect(booleanToBoolean4_2.y, afterBefore.u2) annotation( + Line(points = {{-75.6, 66}, {-41, 66}}, color = {162, 29, 33})); + connect(green, booleanToBoolean4_3.u) annotation( + Line(points = {{-110, -80}, {-84.4, -80}}, color = {217, 67, 180})); + connect(booleanToBoolean4_3.y, checkBoolean.u) annotation( + Line(points = {{-75.6, -80}, {-52, -80}, {-52, -70}, {-41, -70}}, color = {162, 29, 33})); + connect(booleanToBoolean4_3.y, afterFor.u) annotation( + Line(points = {{-75.6, -80}, {-52, -80}, {-52, -30}, {-41, -30}}, color = {162, 29, 33})); + connect(booleanToBoolean4_3.y, afterBefore.u1) annotation( + Line(points = {{-75.6, -80}, {-52, -80}, {-52, 74}, {-41, 74}}, color = {162, 29, 33})); + connect(checkInPCount1.u, booleanToBoolean4_4.y) annotation( + Line(points = {{99, 10}, {90, 10}, {90, 0}, {-75.6, 0}}, color = {162, 29, 33})); + connect(booleanToBoolean4_4.u, yellow) annotation( + Line(points = {{-84.4, 0}, {-110, 0}}, color = {217, 67, 180})); + connect(When.y, checkInPCount1.tl) annotation( + Line(points = {{110, 70}, {110, 20}}, color = {0, 0, 255})); + connect(const2.y, booleanDelay.delay) annotation( + Line(points = {{43, 60}, {50, 60}, {50, 72}, {57, 72}}, color = {0, 0, 0})); + connect(checkInPCount1.y, show_req3.u) annotation( + Line(points = {{121, 10}, {129, 10}, {129, 24}, {137, 24}}, color = {162, 29, 33})); + connect(checkInPCount1.y, and4_2.u1) annotation( + Line(points = {{121, 10}, {128, 10}, {128, -22}, {98, -22}, {98, -32}, {111, -32}}, color = {162, 29, 33})); + connect(booleanDelay.y, booleanToBoolean4_5.u) annotation( + Line(points = {{79, 80}, {83.6, 80}}, color = {217, 67, 180})); + connect(booleanToBoolean4_5.y, When.u) annotation( + Line(points = {{92.4, 80}, {99, 80}}, color = {162, 29, 33})); + connect(event4ToEvent.y, booleanDelay.u) annotation( + Line(points = {{50.4, 80}, {57, 80}}, color = {217, 67, 180})); + connect(booleanToBoolean4_3.y, event4ToEvent.u) annotation( + Line(points = {{-75.6, -80}, {-52, -80}, {-52, 88}, {28, 88}, {28, 80}, {41.6, 80}}, color = {162, 29, 33})); + connect(checkInPCount.y, req1) annotation( + Line(points = {{-18, 34}, {-10, 34}, {-10, 100}, {140, 100}, {140, 60}, {170, 60}}, color = {162, 29, 33})); + connect(checkBoolean.y, req2) annotation( + Line(points = {{-18, -70}, {-12, -70}, {-12, -20}, {140, -20}, {140, 0}, {170, 0}}, color = {162, 29, 33})); + connect(checkInPCount1.y, req3) annotation( + Line(points = {{122, 10}, {128, 10}, {128, -22}, {98, -22}, {98, -60}, {170, -60}}, color = {162, 29, 33})); + annotation( + Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {160, 100}}), graphics = {Rectangle(origin = {30, 0},lineColor = {28, 108, 200}, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, extent = {{-130, 100}, {130, -100}}), Ellipse(origin = {32, 0},lineColor = {238, 46, 47}, fillColor = {238, 46, 47}, fillPattern = FillPattern.Solid, extent = {{-20, 98}, {20, 58}}), Ellipse(origin = {32, 0},lineColor = {244, 125, 35}, fillColor = {244, 125, 35}, fillPattern = FillPattern.Solid, extent = {{-20, 18}, {20, -20}}), Ellipse(origin = {32, 0},lineColor = {0, 140, 72}, fillColor = {0, 140, 72}, fillPattern = FillPattern.Solid, extent = {{-20, -60}, {20, -98}}), Text(textColor = {28, 108, 200}, extent = {{-92, 126}, {90, 108}}, textString = "%name")}), + Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {160, 100}}), graphics = {Rectangle(lineColor = {28, 108, 200}, fillColor = {255, 255, 170}, fillPattern = FillPattern.Solid, extent = {{-86, -16}, {-14, -94}}), Rectangle(lineColor = {28, 108, 200}, fillColor = {255, 255, 170}, fillPattern = FillPattern.Solid, extent = {{-86, 96}, {-14, -10}}), Text(textColor = {28, 108, 200}, extent = {{-72, -2}, {-30, -6}}, textString = "After green, next step is yellow"), Text(textColor = {28, 108, 200}, extent = {{-82, -82}, {-16, -94}}, textString = "Step green should stay active for at least 30 seconds"), Rectangle(lineColor = {28, 108, 200}, fillColor = {255, 255, 170}, fillPattern = FillPattern.Solid, extent = {{16, 96}, {134, -16}}), Text(textColor = {28, 108, 200}, extent = {{24, -4}, {76, -8}}, textString = "After green becomes active + 30 seconds,"), Text(textColor = {28, 108, 200}, extent = {{25, -8}, {81, -14}}, textString = "next step should turn yellow within 0.2 seconds"), Text(textColor = {28, 108, 200}, extent = {{-126, 100}, {-96, 92}}, textString = "red"), Text(textColor = {28, 108, 200}, extent = {{-126, -58}, {-96, -66}}, textString = "green"), Text(textColor = {28, 108, 200}, extent = {{-126, 22}, {-96, 14}}, textString = "yellow"), Text(textColor = {28, 108, 200}, extent = {{-84, 96}, {-58, 86}}, textString = "req1"), Text(textColor = {28, 108, 200}, extent = {{28, 96}, {54, 86}}, textString = "req3"), Text(textColor = {28, 108, 200}, extent = {{-84, -18}, {-58, -28}}, textString = "req2")}), + experiment(StopTime = 100)); +end Spec; diff --git a/libraries/modelica/CRML_test/Examples/TrafficLight/Spec_externals.mo b/libraries/modelica/CRML_test/Examples/TrafficLight/Spec_externals.mo new file mode 100644 index 0000000..85c9662 --- /dev/null +++ b/libraries/modelica/CRML_test/Examples/TrafficLight/Spec_externals.mo @@ -0,0 +1,55 @@ +within CRML_test.Examples.TrafficLight; + +model Spec_externals + Modelica.Blocks.Sources.RealExpression greenObserver(y = phys.greenLamp.i) annotation( + Placement(transformation(extent = {{56, 10}, {30, 30}}))); + Modelica.Blocks.Logical.GreaterEqualThreshold oGreen(threshold = 9) annotation( + Placement(transformation(extent = {{12, 16}, {4, 24}}))); + Modelica.Blocks.Sources.RealExpression yellowObservor(y = phys.yellowLamp.i) annotation( + Placement(transformation(extent = {{56, 30}, {30, 50}}))); + Modelica.Blocks.Logical.GreaterEqualThreshold oYellow(threshold = 9) annotation( + Placement(transformation(extent = {{12, 36}, {4, 44}}))); + Modelica.Blocks.Sources.RealExpression redObserver(y = phys.redLamp.i) annotation( + Placement(transformation(extent = {{56, 50}, {30, 70}}))); + CRML.Examples.TrafficLight.Log2 log annotation( + Placement(transformation(extent = {{148, 30}, {128, 50}}))); + Modelica.Blocks.Logical.GreaterEqualThreshold oRed(threshold = 9) annotation( + Placement(transformation(extent = {{12, 56}, {4, 64}}))); + CRML.Examples.TrafficLight.Phys1 phys annotation( + Placement(transformation(extent = {{108, 30}, {88, 50}}))); + Modelica.Blocks.Sources.BooleanExpression green_active(y = oGreen.y) annotation( + Placement(transformation(extent = {{-30, 10}, {-50, 30}}))); + Modelica.Blocks.Sources.BooleanExpression yellow_active(y = oYellow.y) annotation( + Placement(transformation(extent = {{-30, 30}, {-50, 50}}))); + Modelica.Blocks.Sources.BooleanExpression red_active(y = oRed.y) annotation( + Placement(transformation(extent = {{-30, 50}, {-50, 70}}))); + Modelica.Blocks.Interfaces.BooleanOutput red annotation( + Placement(transformation(origin = {-72, 60}, extent = {{10, -10}, {-10, 10}}), iconTransformation(origin = {-110, 60}, extent = {{-10, -10}, {10, 10}}))); + Modelica.Blocks.Interfaces.BooleanOutput yellow annotation( + Placement(transformation(origin = {-72, 40}, extent = {{10, -10}, {-10, 10}}), iconTransformation(origin = {-110, 0}, extent = {{-10, -10}, {10, 10}}))); + Modelica.Blocks.Interfaces.BooleanOutput green annotation( + Placement(transformation(origin = {-72, 20}, extent = {{10, -10}, {-10, 10}}), iconTransformation(origin = {-110, -60}, extent = {{-10, -10}, {10, 10}}))); +equation + connect(greenObserver.y, oGreen.u) annotation( + Line(points = {{28.7, 20}, {12.8, 20}}, color = {0, 0, 127})); + connect(yellowObservor.y, oYellow.u) annotation( + Line(points = {{28.7, 40}, {12.8, 40}}, color = {0, 0, 127})); + connect(redObserver.y, oRed.u) annotation( + Line(points = {{28.7, 60}, {12.8, 60}}, color = {0, 0, 127})); + connect(phys.green, log.y_green) annotation( + Line(points = {{109, 32}, {114, 32}, {114, 32}, {118, 32}, {118, 32}, {127, 32}}, color = {217, 67, 180})); + connect(phys.yellow, log.y_yellow) annotation( + Line(points = {{109, 40}, {127, 40}}, color = {217, 67, 180})); + connect(phys.red, log.y_red) annotation( + Line(points = {{109, 48}, {114, 48}, {114, 48}, {118, 48}, {118, 48}, {127, 48}}, color = {217, 67, 180})); + connect(red_active.y, red) annotation( + Line(points = {{-50, 60}, {-72, 60}}, color = {255, 0, 255})); + connect(yellow_active.y, yellow) annotation( + Line(points = {{-50, 40}, {-72, 40}}, color = {255, 0, 255})); + connect(green_active.y, green) annotation( + Line(points = {{-50, 20}, {-72, 20}}, color = {255, 0, 255})); + annotation( + Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}})), + Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics = {Rectangle(lineColor = {28, 108, 200}, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, extent = {{-150, 90}, {172, -30}}), Rectangle(lineColor = {28, 108, 200}, fillColor = {170, 255, 213}, fillPattern = FillPattern.Solid, extent = {{80, 80}, {158, 0}}), Text(textColor = {28, 108, 200}, extent = {{84, 14}, {156, 4}}, textString = "Behavioral model"), Rectangle(lineColor = {28, 108, 200}, fillColor = {170, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-4, 80}, {60, 0}}), Text(textColor = {28, 108, 200}, extent = {{-10, 12}, {64, 4}}, textString = "Observation model"), Text(textColor = {28, 108, 200}, extent = {{116, 64}, {156, 56}}, textString = "I&C"), Text(textColor = {28, 108, 200}, extent = {{80, 64}, {120, 56}}, textString = "Physical"), Rectangle(lineColor = {28, 108, 200}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, extent = {{-54, 80}, {-26, 0}}), Text(textColor = {28, 108, 200}, extent = {{-76, 12}, {-4, 4}}, textString = "Bindings"), Text(textColor = {28, 108, 200}, extent = {{-66, -8}, {78, -26}}, textString = "Model for computing externals")}), + experiment(StopTime = 100)); +end Spec_externals; diff --git a/libraries/modelica/CRML_test/Examples/TrafficLight/Spec_verif.mo b/libraries/modelica/CRML_test/Examples/TrafficLight/Spec_verif.mo new file mode 100644 index 0000000..4f00294 --- /dev/null +++ b/libraries/modelica/CRML_test/Examples/TrafficLight/Spec_verif.mo @@ -0,0 +1,61 @@ +within CRML_test.Examples.TrafficLight; + +model Spec_verif + Modelica.Blocks.Sources.RealExpression greenObserver(y = phys.greenLamp.i) annotation( + Placement(transformation(extent = {{56, 10}, {30, 30}}))); + Modelica.Blocks.Logical.GreaterEqualThreshold oGreen(threshold = 9) annotation( + Placement(transformation(extent = {{12, 16}, {4, 24}}))); + Modelica.Blocks.Sources.RealExpression yellowObservor(y = phys.yellowLamp.i) annotation( + Placement(transformation(extent = {{56, 30}, {30, 50}}))); + Modelica.Blocks.Logical.GreaterEqualThreshold oYellow(threshold = 9) annotation( + Placement(transformation(extent = {{12, 36}, {4, 44}}))); + Modelica.Blocks.Sources.RealExpression redObserver(y = phys.redLamp.i) annotation( + Placement(transformation(extent = {{56, 50}, {30, 70}}))); + CRML.Examples.TrafficLight.Log2 log annotation( + Placement(transformation(extent = {{148, 30}, {128, 50}}))); + Modelica.Blocks.Logical.GreaterEqualThreshold oRed(threshold = 9) annotation( + Placement(transformation(extent = {{12, 56}, {4, 64}}))); + CRML.Examples.TrafficLight.Phys1 phys annotation( + Placement(transformation(extent = {{108, 30}, {88, 50}}))); + Modelica.Blocks.Sources.BooleanExpression green_active(y = oGreen.y) annotation( + Placement(transformation(extent = {{-30, 10}, {-50, 30}}))); + Modelica.Blocks.Sources.BooleanExpression yellow_active(y = oYellow.y) annotation( + Placement(transformation(extent = {{-30, 30}, {-50, 50}}))); + Modelica.Blocks.Sources.BooleanExpression red_active(y = oRed.y) annotation( + Placement(transformation(extent = {{-30, 50}, {-50, 70}}))); + Modelica.Blocks.Interfaces.BooleanOutput red annotation( + Placement(transformation(origin = {-72, 60}, extent = {{10, -10}, {-10, 10}}, rotation = -0), iconTransformation(origin = {-68, 58}, extent = {{-10, -10}, {10, 10}}))); + Modelica.Blocks.Interfaces.BooleanOutput yellow annotation( + Placement(transformation(origin = {-72, 40}, extent = {{10, -10}, {-10, 10}}), iconTransformation(origin = {-58, 68}, extent = {{-10, -10}, {10, 10}}))); + Modelica.Blocks.Interfaces.BooleanOutput green annotation( + Placement(transformation(origin = {-72, 20}, extent = {{10, -10}, {-10, 10}}), iconTransformation(origin = {-48, 78}, extent = {{-10, -10}, {10, 10}}))); + Spec spec annotation( + Placement(transformation(origin = {-110, 40}, extent = {{13, -10}, {-13, 10}}, rotation = -0))); +equation + // Bindings + spec.red = red; + spec.green = green; + spec.yellow = yellow; + connect(greenObserver.y, oGreen.u) annotation( + Line(points = {{28.7, 20}, {12.8, 20}}, color = {0, 0, 127})); + connect(yellowObservor.y, oYellow.u) annotation( + Line(points = {{28.7, 40}, {12.8, 40}}, color = {0, 0, 127})); + connect(redObserver.y, oRed.u) annotation( + Line(points = {{28.7, 60}, {12.8, 60}}, color = {0, 0, 127})); + connect(phys.green, log.y_green) annotation( + Line(points = {{109, 32}, {114, 32}, {114, 32}, {118, 32}, {118, 32}, {127, 32}}, color = {217, 67, 180})); + connect(phys.yellow, log.y_yellow) annotation( + Line(points = {{109, 40}, {127, 40}}, color = {217, 67, 180})); + connect(phys.red, log.y_red) annotation( + Line(points = {{109, 48}, {114, 48}, {114, 48}, {118, 48}, {118, 48}, {127, 48}}, color = {217, 67, 180})); + connect(red_active.y, red) annotation( + Line(points = {{-50, 60}, {-72, 60}}, color = {255, 0, 255})); + connect(yellow_active.y, yellow) annotation( + Line(points = {{-50, 40}, {-72, 40}}, color = {255, 0, 255})); + connect(green_active.y, green) annotation( + Line(points = {{-50, 20}, {-72, 20}}, color = {255, 0, 255})); + annotation( + Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-160, -40}, {180, 100}}), graphics = {Rectangle(extent = {{-160, 100}, {180, -40}}, lineColor = {28, 108, 200}), Line(points = {{-40, 28}, {0, -30}, {62, 96}}, color = {0, 127, 0}, smooth = Smooth.None, thickness = 1)}), + Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-160, -40}, {180, 100}}), graphics = {Rectangle(lineColor = {28, 108, 200}, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, extent = {{-150, 90}, {172, -30}}), Rectangle(lineColor = {28, 108, 200}, fillColor = {170, 255, 213}, fillPattern = FillPattern.Solid, extent = {{80, 80}, {158, 0}}), Text(textColor = {28, 108, 200}, extent = {{84, 14}, {156, 4}}, textString = "Behavioral model"), Rectangle(lineColor = {28, 108, 200}, fillColor = {170, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-4, 80}, {60, 0}}), Text(textColor = {28, 108, 200}, extent = {{-10, 12}, {64, 4}}, textString = "Observation model"), Text(textColor = {28, 108, 200}, extent = {{116, 64}, {156, 56}}, textString = "I&C"), Text(textColor = {28, 108, 200}, extent = {{80, 64}, {120, 56}}, textString = "Physical"), Rectangle(lineColor = {28, 108, 200}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, extent = {{-54, 80}, {-26, 0}}), Text(textColor = {28, 108, 200}, extent = {{-76, 12}, {-4, 4}}, textString = "Bindings"), Text(textColor = {28, 108, 200}, extent = {{-66, -8}, {78, -26}}, textString = "Model for computing externals")}), + experiment(StopTime = 100)); +end Spec_verif; diff --git a/libraries/modelica/CRML_test/Examples/TrafficLight/package.mo b/libraries/modelica/CRML_test/Examples/TrafficLight/package.mo new file mode 100644 index 0000000..277dc1b --- /dev/null +++ b/libraries/modelica/CRML_test/Examples/TrafficLight/package.mo @@ -0,0 +1,4 @@ +within CRML_test.Examples; + +package TrafficLight +end TrafficLight; diff --git a/libraries/modelica/CRML_test/Examples/TrafficLight/package.order b/libraries/modelica/CRML_test/Examples/TrafficLight/package.order new file mode 100644 index 0000000..d731db0 --- /dev/null +++ b/libraries/modelica/CRML_test/Examples/TrafficLight/package.order @@ -0,0 +1,3 @@ +Spec +Spec_externals +Spec_verif diff --git a/libraries/modelica/CRML_test/Examples/package.mo b/libraries/modelica/CRML_test/Examples/package.mo new file mode 100644 index 0000000..1f19cd2 --- /dev/null +++ b/libraries/modelica/CRML_test/Examples/package.mo @@ -0,0 +1,7 @@ +within CRML_test; + +package Examples + annotation( + Diagram(graphics), + Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100, -100}, {100, 100}}, radius = 25), Text(extent = {{-42, 38}, {44, -30}}, textString = "", fontName = "Symbol"), Rectangle(lineColor = {128, 128, 128}, extent = {{-100, -100}, {100, 100}}, radius = 25)})); +end Examples; diff --git a/libraries/modelica/CRML_test/Examples/package.order b/libraries/modelica/CRML_test/Examples/package.order new file mode 100644 index 0000000..1a142bd --- /dev/null +++ b/libraries/modelica/CRML_test/Examples/package.order @@ -0,0 +1 @@ +TrafficLight diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore.mo b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore.mo new file mode 100644 index 0000000..8de3f7e --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore.mo @@ -0,0 +1,69 @@ +within CRML_test.FORML.AfterBefore; +block AfterBefore +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation( + Placement(transformation(extent = {{-120, 30}, {-100, 50}}), iconTransformation(extent = {{-120, 30}, {-100, 50}}))); + CRML.ETL.Connectors.WhileInput tl annotation( + Placement(transformation(extent = {{-10, 90}, {10, 110}}), iconTransformation(extent = {{-10, 90}, {10, 110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_before_b2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.ETL.TimeLocators.Periods periods(leftBoundaryIncluded = false, rightBoundaryIncluded = false) annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 annotation( + Placement(transformation(extent = {{-80, 30}, {-60, 50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 annotation( + Placement(transformation(extent = {{-44, 36}, {-36, 44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 annotation( + Placement(transformation(extent = {{-80, -50}, {-60, -30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 annotation( + Placement(transformation(extent = {{-44, -44}, {-36, -36}}))); + +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation( + Placement(transformation(extent={{-120,-50},{-100,-30}}), iconTransformation(extent={{-120, + -50},{-100,-30}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + connect(ck1, clockToBoolean_ck1.u) annotation( + Line(points = {{-110, 40}, {-82, 40}}, color = {175, 175, 175}, pattern = LinePattern.Dot, thickness = 0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) annotation( + Line(points = {{-59, 40}, {-44.4, 40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck1.y, periods.u1) annotation( + Line(points = {{-35.6, 40}, {-20, 40}, {-20, 0}, {-11, 0}}, color = {162, 29, 33})); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) annotation( + Line(points = {{-59, -40}, {-44.4, -40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck2.y, periods.u2) annotation( + Line(points = {{-35.6, -40}, {-20, -40}, {-20, -8}, {-11, -8}}, color = {162, 29, 33})); + connect(periods.y, p_after_b1_before_b2) annotation (Line(points={{0,-10},{0,-20}, + {80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, periods.tl) annotation( + Line(points = {{0, 100}, {0, 10}}, color = {0, 0, 255})); + connect(clockToBoolean_ck2.u, ck2) annotation (Line( + points={{-82,-40},{-110,-40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation( + Icon(coordinateSystem(preserveAspectRatio = false), graphics = {Rectangle(fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid, lineThickness = 5, borderPattern = BorderPattern.Raised, extent = {{-100, 100}, {100, -100}}), Rectangle(lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-70, 30}, {70, -52}}), Line(points = {{-50, -34}, {-50, -12}}, pattern = LinePattern.Dash), Line(points = {{-48, -12}, {52, -12}}, pattern = LinePattern.Dash), Line(points = {{52, -12}, {52, -34}}, pattern = LinePattern.Dash), Line(points = {{-62, -34}, {58, -34}}, color = {175, 175, 175}), Line(points = {{-50, -12}, {-50, 10}}, pattern = LinePattern.Dash), Rectangle(fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid, extent = {{22, 2}, {52, -12}}), Line(points = {{-50, 10}, {22, 10}}, pattern = LinePattern.Dash), Line(points = {{22, 10}, {22, -12}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {20, -10}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {24, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-52, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-48, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, 30}, {-70, 30}, {-70, -52}, {-50, -52}}), Line(points = {{50, 30}, {70, 30}, {70, -52}, {50, -52}}), Text(textColor = {175, 175, 175}, extent = {{-28, -10}, {22, -34}}, textString = "%u"), Text(extent = {{-78, 86}, {76, 38}}, textString = "after before")}), + Diagram(coordinateSystem(preserveAspectRatio = false)), + Documentation(info = " +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end AfterBefore; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore2.mo b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore2.mo new file mode 100644 index 0000000..db552b0 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore2.mo @@ -0,0 +1,96 @@ +within CRML_test.FORML.AfterBefore; +block AfterBefore2 + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; + +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,30},{-100,50}}), iconTransformation(extent={{-120,30}, + {-100,50}}))); + CRML.ETL.Connectors.WhileInput tl annotation (Placement( + transformation(extent={{-10,90},{10,110}}), iconTransformation(extent={ + {-10,90},{10,110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_before_b2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,-50},{-100,-30}}), iconTransformation( + extent={{-120,-50},{-100,-30}}))); + CRML.TimeLocators.Continuous.AfterBefore + afterBefore + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 + annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 + annotation (Placement(transformation(extent={{-44,36},{-36,44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 + annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 + annotation (Placement(transformation(extent={{-44,-44},{-36,-36}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + + connect(ck1, clockToBoolean_ck1.u) annotation (Line( + points={{-110,40},{-110,40},{-110,40},{-82,40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) + annotation (Line(points={{-59,40},{-44.4,40}}, color={255,0,255})); + connect(booleanToBoolean4_ck1.y, afterBefore.u1) annotation (Line(points={{-35.6, + 40},{-20,40},{-20,0},{-11,0}}, color={162,29,33})); + connect(ck2, clockToBoolean_ck2.u) annotation (Line( + points={{-110,-40},{-82,-40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) + annotation (Line(points={{-59,-40},{-44.4,-40}}, color={255,0,255})); + connect(booleanToBoolean4_ck2.y, afterBefore.u2) annotation (Line(points={{-35.6, + -40},{-20,-40},{-20,-8},{-11,-8}}, color={162,29,33})); + connect(afterBefore.y, p_after_b1_before_b2) annotation (Line(points={{0,-10}, + {0,-20},{80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, afterBefore.tl) + annotation (Line(points={{0,100},{0,10}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle(extent={{-100, + 100},{100,-100}}, fillColor = {85, 170, 255}, lineThickness = 5, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Raised, lineColor = {0, 0, 0}), Rectangle(extent={{-70,30}, + {70,-52}}, lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points={{-50,-34}, + {-50,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-48,-12}, + {52,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{52,-12}, + {52,-34}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-62,-34}, + {58,-34}}, color = {175, 175, 175}), Line(points={{-50,-12}, + {-50,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Rectangle(extent={{22,2},{ + 52,-12}}, lineColor = {0, 0, 0}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid), Line(points={{-50,10}, + {22,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,10}, + {22,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {20,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {24,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-52,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-48,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,30}, + {-70,30},{-70,-52},{-50,-52}}, color = {0, 0, 0}), Line(points={{50,30}, + {70,30},{70,-52},{50,-52}}, color = {0, 0, 0}), Text(extent={{-28,-10}, + {22,-34}}, lineColor = {175, 175, 175}, pattern = LinePattern.Dash, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, textString = "%u"), Text(extent={{-78,86}, + {76,38}}, lineColor = {0, 0, 0}, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, textString = "after before")}), + Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end AfterBefore2; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_externals.mo b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_externals.mo new file mode 100644 index 0000000..be4f972 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_externals.mo @@ -0,0 +1,43 @@ +within CRML_test.FORML.AfterBefore; +model AfterBefore_externals + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); + CRML.ETL.Connectors.ClockOutput ck1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.ClockOutput ck2 + annotation (Placement(transformation(extent={{100,-80},{120,-60}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-6,54},{6,66}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-6,-66},{6,-54}}))); +equation + connect(b1.y, clockEvent_1.u) + annotation (Line(points={{-39,60},{-6.6,60}}, color={217,67,180})); + connect(clockEvent_1.y, ck1) annotation (Line( + points={{6.6,60},{40,60},{40,50},{110,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(b2.y, clockEvent_2.u) + annotation (Line(points={{-39,-60},{-6.6,-60}}, color={217,67,180})); + connect(clockEvent_2.y, ck2) annotation (Line( + points={{6.6,-60},{40,-60},{40,-70},{110,-70}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end AfterBefore_externals; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_verif.mo b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_verif.mo new file mode 100644 index 0000000..3e7cc59 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_verif.mo @@ -0,0 +1,21 @@ +within CRML_test.FORML.AfterBefore; +model AfterBefore_verif + AfterBefore_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + AfterBefore afterBefore + annotation (Placement(transformation(extent={{0,0},{20,20}}))); +equation + // Bindings + externals.ck1 = afterBefore.ck1; + externals.ck2 = afterBefore.ck2; + annotation (Icon(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}})})); +end AfterBefore_verif; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_verif2.mo b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_verif2.mo new file mode 100644 index 0000000..479b951 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore/AfterBefore_verif2.mo @@ -0,0 +1,22 @@ +within CRML_test.FORML.AfterBefore; +model AfterBefore_verif2 + + AfterBefore_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + AfterBefore2 afterBefore2 + annotation (Placement(transformation(extent={{-26,16},{-6,36}}))); +equation + // Bindings + externals.ck1 = afterBefore2.ck1; + externals.ck2 = afterBefore2.ck2; + annotation (Icon(graphics={ + Ellipse(lineColor = {75,138,73}, + fillColor={255,255,255}, + fillPattern = FillPattern.Solid, + extent={{-100,-102},{100,98}}), + Polygon(lineColor = {0,0,255}, + fillColor = {75,138,73}, + pattern = LinePattern.None, + fillPattern = FillPattern.Solid, + points={{-36,58},{64,-2},{-36,-62},{-36,58}})})); +end AfterBefore_verif2; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore/package.mo b/libraries/modelica/CRML_test/FORML/AfterBefore/package.mo new file mode 100644 index 0000000..cbdced7 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package AfterBefore +end AfterBefore; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore/package.order b/libraries/modelica/CRML_test/FORML/AfterBefore/package.order new file mode 100644 index 0000000..0aa4531 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore/package.order @@ -0,0 +1,5 @@ +AfterBefore +AfterBefore2 +AfterBefore_externals +AfterBefore_verif +AfterBefore_verif2 diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/AfterBefore_no_ext.mo b/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/AfterBefore_no_ext.mo new file mode 100644 index 0000000..2faefc0 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/AfterBefore_no_ext.mo @@ -0,0 +1,42 @@ +within CRML_test.FORML.AfterBefore_no_ext; +model AfterBefore_no_ext +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,24},{-14,36}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-26,-56},{-14,-44}}))); + AfterBefore.AfterBefore afterBefore + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_until_b2 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +equation + + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,30},{-26.6,30}},color={217,67,180})); + connect(b2.y,clockEvent_2. u) + annotation (Line(points={{-59,-50},{-26.6,-50}},color={217,67,180})); + connect(clockEvent_2.y, afterBefore.ck2) annotation (Line( + points={{-13.4,-50},{34,-50},{34,-4},{39,-4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent_1.y, afterBefore.ck1) annotation (Line( + points={{-13.4,30},{34,30},{34,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(afterBefore.p_after_b1_before_b2, p_after_b1_until_b2) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); +end AfterBefore_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/AfterBefore_no_ext2.mo b/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/AfterBefore_no_ext2.mo new file mode 100644 index 0000000..b12cda8 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/AfterBefore_no_ext2.mo @@ -0,0 +1,42 @@ +within CRML_test.FORML.AfterBefore_no_ext; +model AfterBefore_no_ext2 +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,24},{-14,36}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-26,-56},{-14,-44}}))); + AfterBefore.AfterBefore2 afterBefore2_1 + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_until_b2 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +equation + + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,30},{-26.6,30}},color={217,67,180})); + connect(b2.y,clockEvent_2. u) + annotation (Line(points={{-59,-50},{-26.6,-50}},color={217,67,180})); + connect(clockEvent_2.y, afterBefore2_1.ck2) annotation (Line( + points={{-13.4,-50},{34,-50},{34,-4},{39,-4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent_1.y, afterBefore2_1.ck1) annotation (Line( + points={{-13.4,30},{34,30},{34,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(afterBefore2_1.p_after_b1_before_b2, p_after_b1_until_b2) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); +end AfterBefore_no_ext2; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/package.mo b/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/package.mo new file mode 100644 index 0000000..fa39504 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package AfterBefore_no_ext +end AfterBefore_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/package.order b/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/package.order new file mode 100644 index 0000000..558f001 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterBefore_no_ext/package.order @@ -0,0 +1,2 @@ +AfterBefore_no_ext +AfterBefore_no_ext2 diff --git a/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor2.mo b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor2.mo new file mode 100644 index 0000000..37ddad9 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor2.mo @@ -0,0 +1,85 @@ +within CRML_test.FORML.AfterFor; +block AfterFor2 + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; + +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,30},{-100,50}}), iconTransformation(extent={{-120,30}, + {-100,50}}))); + CRML.ETL.Connectors.WhileInput tl annotation (Placement( + transformation(extent={{-10,90},{10,110}}), iconTransformation(extent={ + {-10,90},{10,110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_for_d1 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +public + CRML.ETL.Connectors.RealInput d1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,-50},{-100,-30}}), iconTransformation( + extent={{-120,-50},{-100,-30}}))); + CRML.TimeLocators.Continuous.AfterFor + afterFor + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 + annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 + annotation (Placement(transformation(extent={{-44,36},{-36,44}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + + connect(ck1, clockToBoolean_ck1.u) annotation (Line( + points={{-110,40},{-110,40},{-110,40},{-82,40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) + annotation (Line(points={{-59,40},{-44.4,40}}, color={255,0,255})); + connect(afterFor.y, p_after_b1_for_d1) annotation (Line(points={{0,-10},{0,-20}, + {80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, afterFor.tl) + annotation (Line(points={{0,100},{0,10}}, color={0,0,255})); + connect(booleanToBoolean4_ck1.y, afterFor.u) annotation (Line(points={{-35.6, + 40},{-16,40},{-16,0},{-11,0}}, color={162,29,33})); + connect(d1, afterFor.duration) annotation (Line(points={{-110,-40},{-16,-40}, + {-16,-8},{-11,-8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle(extent={{-100, + 100},{100,-100}}, fillColor = {85, 170, 255}, lineThickness = 5, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Raised, lineColor = {0, 0, 0}), Rectangle(extent={{-70,30}, + {70,-52}}, lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points={{-50,-34}, + {-50,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-48,-12}, + {52,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{52,-12}, + {52,-34}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-62,-34}, + {58,-34}}, color = {175, 175, 175}), Line(points={{-50,-12}, + {-50,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Rectangle(extent={{22,2},{ + 52,-12}}, lineColor = {0, 0, 0}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid), Line(points={{-50,10}, + {22,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,10}, + {22,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {20,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {24,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-52,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-48,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,30}, + {-70,30},{-70,-52},{-50,-52}}, color = {0, 0, 0}), Line(points={{50,30}, + {70,30},{70,-52},{50,-52}}, color = {0, 0, 0}), Text(extent={{-28,-10}, + {22,-34}}, lineColor = {175, 175, 175}, pattern = LinePattern.Dash, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, textString = "%u"), Text(extent={{-78,86}, + {76,38}}, lineColor = {0, 0, 0}, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, textString = "after before")}), + Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end AfterFor2; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_externals.mo b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_externals.mo new file mode 100644 index 0000000..a841b6a --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_externals.mo @@ -0,0 +1,33 @@ +within CRML_test.FORML.AfterFor; +model AfterFor_externals + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); + CRML.Blocks.Math.Constant duration(k=3) + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); + CRML.ETL.Connectors.ClockOutput ck1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.RealOutput d1 + annotation (Placement(transformation(extent={{100,-80},{120,-60}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-6,54},{6,66}}))); +equation + connect(b1.y, clockEvent_1.u) + annotation (Line(points={{-39,60},{-6.6,60}}, color={217,67,180})); + connect(clockEvent_1.y, ck1) annotation (Line( + points={{6.6,60},{40,60},{40,50},{110,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(duration.y, d1) annotation (Line(points={{-39,-60},{94,-60},{94,-70}, + {110,-70}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end AfterFor_externals; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_verif.mo b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_verif.mo new file mode 100644 index 0000000..7fe13c0 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_verif.mo @@ -0,0 +1,21 @@ +within CRML_test.FORML.AfterFor; +model AfterFor_verif + AfterFor_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + AfterFor_wip afterFor + annotation (Placement(transformation(extent={{0,0},{20,20}}))); +equation + // Bindings + externals.ck1 =afterFor.ck1; + externals.d1 = afterFor.ck2; + annotation (Icon(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}})})); +end AfterFor_verif; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_verif2.mo b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_verif2.mo new file mode 100644 index 0000000..09e4357 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_verif2.mo @@ -0,0 +1,23 @@ +within CRML_test.FORML.AfterFor; +model AfterFor_verif2 + + AfterFor_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + AfterFor2 afterFor2 + annotation (Placement(transformation(extent={{-26,16},{-6,36}}))); +equation + // Bindings + externals.ck1 =afterFor2.ck1; + externals.d1 = afterFor2.d1; + annotation (Icon(graphics={ + Ellipse(lineColor = {75,138,73}, + fillColor={255,255,255}, + fillPattern = FillPattern.Solid, + extent={{-100,-102},{100,98}}), + Polygon(lineColor = {0,0,255}, + fillColor = {75,138,73}, + pattern = LinePattern.None, + fillPattern = FillPattern.Solid, + points={{-36,58},{64,-2},{-36,-62},{-36,58}})}), experiment( + StopTime=100, __Dymola_Algorithm="Dassl")); +end AfterFor_verif2; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_wip.mo b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_wip.mo new file mode 100644 index 0000000..7223fec --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor/AfterFor_wip.mo @@ -0,0 +1,69 @@ +within CRML_test.FORML.AfterFor; +block AfterFor_wip +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation( + Placement(transformation(extent = {{-120, 30}, {-100, 50}}), iconTransformation(extent = {{-120, 30}, {-100, 50}}))); + CRML.ETL.Connectors.WhileInput tl annotation( + Placement(transformation(extent = {{-10, 90}, {10, 110}}), iconTransformation(extent = {{-10, 90}, {10, 110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_for_d1 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.ETL.TimeLocators.Periods periods(leftBoundaryIncluded = false, rightBoundaryIncluded = false) annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 annotation( + Placement(transformation(extent = {{-80, 30}, {-60, 50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 annotation( + Placement(transformation(extent = {{-44, 36}, {-36, 44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 annotation( + Placement(transformation(extent = {{-80, -50}, {-60, -30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 annotation( + Placement(transformation(extent = {{-44, -44}, {-36, -36}}))); + +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation( + Placement(transformation(extent={{-120,-50},{-100,-30}}), iconTransformation(extent={{-120, + -50},{-100,-30}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + connect(ck1, clockToBoolean_ck1.u) annotation( + Line(points = {{-110, 40}, {-82, 40}}, color = {175, 175, 175}, pattern = LinePattern.Dot, thickness = 0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) annotation( + Line(points = {{-59, 40}, {-44.4, 40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck1.y, periods.u1) annotation( + Line(points = {{-35.6, 40}, {-20, 40}, {-20, 0}, {-11, 0}}, color = {162, 29, 33})); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) annotation( + Line(points = {{-59, -40}, {-44.4, -40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck2.y, periods.u2) annotation( + Line(points = {{-35.6, -40}, {-20, -40}, {-20, -8}, {-11, -8}}, color = {162, 29, 33})); + connect(periods.y, p_after_b1_for_d1) annotation (Line(points={{0,-10},{0,-20}, + {80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, periods.tl) annotation( + Line(points = {{0, 100}, {0, 10}}, color = {0, 0, 255})); + connect(clockToBoolean_ck2.u, ck2) annotation (Line( + points={{-82,-40},{-110,-40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation( + Icon(coordinateSystem(preserveAspectRatio = false), graphics = {Rectangle(fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid, lineThickness = 5, borderPattern = BorderPattern.Raised, extent = {{-100, 100}, {100, -100}}), Rectangle(lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-70, 30}, {70, -52}}), Line(points = {{-50, -34}, {-50, -12}}, pattern = LinePattern.Dash), Line(points = {{-48, -12}, {52, -12}}, pattern = LinePattern.Dash), Line(points = {{52, -12}, {52, -34}}, pattern = LinePattern.Dash), Line(points = {{-62, -34}, {58, -34}}, color = {175, 175, 175}), Line(points = {{-50, -12}, {-50, 10}}, pattern = LinePattern.Dash), Rectangle(fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid, extent = {{22, 2}, {52, -12}}), Line(points = {{-50, 10}, {22, 10}}, pattern = LinePattern.Dash), Line(points = {{22, 10}, {22, -12}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {20, -10}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {24, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-52, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-48, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, 30}, {-70, 30}, {-70, -52}, {-50, -52}}), Line(points = {{50, 30}, {70, 30}, {70, -52}, {50, -52}}), Text(textColor = {175, 175, 175}, extent = {{-28, -10}, {22, -34}}, textString = "%u"), Text(extent = {{-78, 86}, {76, 38}}, textString = "after before")}), + Diagram(coordinateSystem(preserveAspectRatio = false)), + Documentation(info = " +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end AfterFor_wip; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor/package.mo b/libraries/modelica/CRML_test/FORML/AfterFor/package.mo new file mode 100644 index 0000000..f8b61c1 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package AfterFor +end AfterFor; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor/package.order b/libraries/modelica/CRML_test/FORML/AfterFor/package.order new file mode 100644 index 0000000..bb9892d --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor/package.order @@ -0,0 +1,5 @@ +AfterFor_wip +AfterFor2 +AfterFor_externals +AfterFor_verif +AfterFor_verif2 diff --git a/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/AfterFor_no_ext2.mo b/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/AfterFor_no_ext2.mo new file mode 100644 index 0000000..0306c5d --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/AfterFor_no_ext2.mo @@ -0,0 +1,33 @@ +within CRML_test.FORML.AfterFor_no_ext; +model AfterFor_no_ext2 +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + AfterFor.AfterFor2 afterFor2 + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_for_d1 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); + CRML.Blocks.Math.Constant duration(k=3) + annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,54},{-14,66}}))); +equation + + connect(afterFor2.p_after_b1_for_d1, p_after_b1_for_d1) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,60},{-26.6,60}},color={217,67,180})); + connect(clockEvent_1.y, afterFor2.ck1) annotation (Line( + points={{-13.4,60},{12,60},{12,4},{39,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(duration.y, afterFor2.d1) annotation (Line(points={{-59,-60},{34,-60}, + {34,-4},{39,-4}}, color={0,0,0})); +end AfterFor_no_ext2; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/AfterFor_no_ext_wip.mo b/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/AfterFor_no_ext_wip.mo new file mode 100644 index 0000000..88d771c --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/AfterFor_no_ext_wip.mo @@ -0,0 +1,31 @@ +within CRML_test.FORML.AfterFor_no_ext; +model AfterFor_no_ext_wip +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + AfterFor.AfterFor_wip afterFor + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_for_d1 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); + CRML.Blocks.Math.Constant duration(k=3) + annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,54},{-14,66}}))); +equation + + connect(afterFor.p_after_b1_for_d1, p_after_b1_for_d1) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,60},{-26.6,60}},color={217,67,180})); + connect(clockEvent_1.y, afterFor.ck1) annotation (Line( + points={{-13.4,60},{18,60},{18,0},{39,0},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); +end AfterFor_no_ext_wip; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/package.mo b/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/package.mo new file mode 100644 index 0000000..b39ada5 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package AfterFor_no_ext +end AfterFor_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/package.order b/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/package.order new file mode 100644 index 0000000..9b27688 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterFor_no_ext/package.order @@ -0,0 +1,2 @@ +AfterFor_no_ext_wip +AfterFor_no_ext2 diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil.mo b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil.mo new file mode 100644 index 0000000..0d4583b --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil.mo @@ -0,0 +1,69 @@ +within CRML_test.FORML.AfterUntil; +block AfterUntil +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation( + Placement(transformation(extent = {{-120, 30}, {-100, 50}}), iconTransformation(extent = {{-120, 30}, {-100, 50}}))); + CRML.ETL.Connectors.WhileInput tl annotation( + Placement(transformation(extent = {{-10, 90}, {10, 110}}), iconTransformation(extent = {{-10, 90}, {10, 110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_until_b2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation( + Placement(transformation(extent = {{-120, -50}, {-100, -30}}), iconTransformation(extent={{-120, + -50},{-100,-30}}))); + CRML.ETL.TimeLocators.Periods periods(leftBoundaryIncluded = false, + rightBoundaryIncluded=true) annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 annotation( + Placement(transformation(extent = {{-80, 30}, {-60, 50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 annotation( + Placement(transformation(extent = {{-44, 36}, {-36, 44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 annotation( + Placement(transformation(extent = {{-80, -50}, {-60, -30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 annotation( + Placement(transformation(extent = {{-44, -44}, {-36, -36}}))); + +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + connect(ck1, clockToBoolean_ck1.u) annotation( + Line(points = {{-110, 40}, {-82, 40}}, color = {175, 175, 175}, pattern = LinePattern.Dot, thickness = 0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) annotation( + Line(points = {{-59, 40}, {-44.4, 40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck1.y, periods.u1) annotation( + Line(points = {{-35.6, 40}, {-20, 40}, {-20, 0}, {-11, 0}}, color = {162, 29, 33})); + connect(ck2, clockToBoolean_ck2.u) annotation( + Line(points = {{-110, -40}, {-82, -40}}, color = {175, 175, 175}, pattern = LinePattern.Dot, thickness = 0.5)); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) annotation( + Line(points = {{-59, -40}, {-44.4, -40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck2.y, periods.u2) annotation( + Line(points = {{-35.6, -40}, {-20, -40}, {-20, -8}, {-11, -8}}, color = {162, 29, 33})); + connect(periods.y, p_after_b1_until_b2) annotation (Line(points={{0,-10},{0,-20}, + {80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, periods.tl) annotation( + Line(points = {{0, 100}, {0, 10}}, color = {0, 0, 255})); + annotation( + Icon(coordinateSystem(preserveAspectRatio = false), graphics = {Rectangle(fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid, lineThickness = 5, borderPattern = BorderPattern.Raised, extent = {{-100, 100}, {100, -100}}), Rectangle(lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-70, 30}, {70, -52}}), Line(points = {{-50, -34}, {-50, -12}}, pattern = LinePattern.Dash), Line(points = {{-48, -12}, {52, -12}}, pattern = LinePattern.Dash), Line(points = {{52, -12}, {52, -34}}, pattern = LinePattern.Dash), Line(points = {{-62, -34}, {58, -34}}, color = {175, 175, 175}), Line(points = {{-50, -12}, {-50, 10}}, pattern = LinePattern.Dash), Rectangle(fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid, extent = {{22, 2}, {52, -12}}), Line(points = {{-50, 10}, {22, 10}}, pattern = LinePattern.Dash), Line(points = {{22, 10}, {22, -12}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {20, -10}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {24, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-52, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-48, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, 30}, {-70, 30}, {-70, -52}, {-50, -52}}), Line(points = {{50, 30}, {70, 30}, {70, -52}, {50, -52}}), Text(textColor = {175, 175, 175}, extent = {{-28, -10}, {22, -34}}, textString = "%u"), Text(extent = {{-78, 86}, {76, 38}}, + textString="after until", + textColor={0,0,0})}), + Diagram(coordinateSystem(preserveAspectRatio = false)), + Documentation(info = " +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end AfterUntil; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_externals.mo b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_externals.mo new file mode 100644 index 0000000..8bb6f74 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_externals.mo @@ -0,0 +1,43 @@ +within CRML_test.FORML.AfterUntil; +model AfterUntil_externals + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); + CRML.ETL.Connectors.ClockOutput ck1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.ClockOutput ck2 + annotation (Placement(transformation(extent={{100,-80},{120,-60}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-6,54},{6,66}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-6,-66},{6,-54}}))); +equation + connect(b1.y, clockEvent_1.u) + annotation (Line(points={{-39,60},{-6.6,60}}, color={217,67,180})); + connect(clockEvent_1.y, ck1) annotation (Line( + points={{6.6,60},{40,60},{40,50},{110,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(b2.y, clockEvent_2.u) + annotation (Line(points={{-39,-60},{-6.6,-60}}, color={217,67,180})); + connect(clockEvent_2.y, ck2) annotation (Line( + points={{6.6,-60},{40,-60},{40,-70},{110,-70}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end AfterUntil_externals; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_verif.mo b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_verif.mo new file mode 100644 index 0000000..d2e5fee --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_verif.mo @@ -0,0 +1,24 @@ +within CRML_test.FORML.AfterUntil; +model AfterUntil_verif + AfterUntil_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + AfterUntil afterUntil + annotation (Placement(transformation(extent={{0,0},{20,20}}))); +equation + // Bindings + externals.ck1 =afterUntil.ck1; + externals.ck2 =afterUntil.ck2; + annotation (Icon(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}})}), experiment( + StopTime=20, + __Dymola_fixedstepsize=0.1, + __Dymola_Algorithm="Dassl")); +end AfterUntil_verif; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_verif2.mo b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_verif2.mo new file mode 100644 index 0000000..cd9ca8a --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntil_verif2.mo @@ -0,0 +1,22 @@ +within CRML_test.FORML.AfterUntil; +model AfterUntil_verif2 + + AfterUntil_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + AfterUntill2 afterUntil2 + annotation (Placement(transformation(extent={{-26,16},{-6,36}}))); +equation + // Bindings + externals.ck1 =afterUntil2.ck1; + externals.ck2 =afterUntil2.ck2; + annotation (Icon(graphics={ + Ellipse(lineColor = {75,138,73}, + fillColor={255,255,255}, + fillPattern = FillPattern.Solid, + extent={{-100,-102},{100,98}}), + Polygon(lineColor = {0,0,255}, + fillColor = {75,138,73}, + pattern = LinePattern.None, + fillPattern = FillPattern.Solid, + points={{-36,58},{64,-2},{-36,-62},{-36,58}})})); +end AfterUntil_verif2; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntill2.mo b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntill2.mo new file mode 100644 index 0000000..0ff44ef --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil/AfterUntill2.mo @@ -0,0 +1,96 @@ +within CRML_test.FORML.AfterUntil; +block AfterUntill2 + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; + +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,30},{-100,50}}), iconTransformation(extent={{-120,30}, + {-100,50}}))); + CRML.ETL.Connectors.WhileInput tl annotation (Placement( + transformation(extent={{-10,90},{10,110}}), iconTransformation(extent={ + {-10,90},{10,110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_until_b2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,-50},{-100,-30}}), iconTransformation( + extent={{-120,-50},{-100,-30}}))); + CRML.TimeLocators.Continuous.AfterUntil + afterUntil + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 + annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 + annotation (Placement(transformation(extent={{-44,36},{-36,44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 + annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 + annotation (Placement(transformation(extent={{-44,-44},{-36,-36}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + + connect(ck1, clockToBoolean_ck1.u) annotation (Line( + points={{-110,40},{-110,40},{-110,40},{-82,40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) + annotation (Line(points={{-59,40},{-44.4,40}}, color={255,0,255})); + connect(booleanToBoolean4_ck1.y, afterUntil.u1) annotation (Line(points={{-35.6, + 40},{-20,40},{-20,0},{-11,0}}, color={162,29,33})); + connect(ck2, clockToBoolean_ck2.u) annotation (Line( + points={{-110,-40},{-82,-40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) + annotation (Line(points={{-59,-40},{-44.4,-40}}, color={255,0,255})); + connect(booleanToBoolean4_ck2.y, afterUntil.u2) annotation (Line(points={{-35.6, + -40},{-20,-40},{-20,-8},{-11,-8}}, color={162,29,33})); + connect(afterUntil.y, p_after_b1_until_b2) annotation (Line(points={{0,-10},{ + 0,-20},{80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, afterUntil.tl) + annotation (Line(points={{0,100},{0,10}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle(extent={{-100, + 100},{100,-100}}, fillColor = {85, 170, 255}, lineThickness = 5, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Raised, lineColor = {0, 0, 0}), Rectangle(extent={{-70,30}, + {70,-52}}, lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points={{-50,-34}, + {-50,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-48,-12}, + {52,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{52,-12}, + {52,-34}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-62,-34}, + {58,-34}}, color = {175, 175, 175}), Line(points={{-50,-12}, + {-50,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Rectangle(extent={{22,2},{ + 52,-12}}, lineColor = {0, 0, 0}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid), Line(points={{-50,10}, + {22,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,10}, + {22,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {20,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {24,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-52,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-48,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,30}, + {-70,30},{-70,-52},{-50,-52}}, color = {0, 0, 0}), Line(points={{50,30}, + {70,30},{70,-52},{50,-52}}, color = {0, 0, 0}), Text(extent={{-28,-10}, + {22,-34}}, lineColor = {175, 175, 175}, pattern = LinePattern.Dash, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, textString = "%u"), Text(extent={{-78,86}, + {76,38}}, lineColor={0,0,0}, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, + textString="after until")}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end AfterUntill2; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil/package.mo b/libraries/modelica/CRML_test/FORML/AfterUntil/package.mo new file mode 100644 index 0000000..0aa04c3 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package AfterUntil +end AfterUntil; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil/package.order b/libraries/modelica/CRML_test/FORML/AfterUntil/package.order new file mode 100644 index 0000000..7b71aaf --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil/package.order @@ -0,0 +1,5 @@ +AfterUntil +AfterUntill2 +AfterUntil_externals +AfterUntil_verif +AfterUntil_verif2 diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/AfterUntil_no_ext.mo b/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/AfterUntil_no_ext.mo new file mode 100644 index 0000000..aedbc21 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/AfterUntil_no_ext.mo @@ -0,0 +1,42 @@ +within CRML_test.FORML.AfterUntil_no_ext; +model AfterUntil_no_ext +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,24},{-14,36}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-26,-56},{-14,-44}}))); + AfterUntil.AfterUntil afterUntil + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_until_b2 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +equation + + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,30},{-26.6,30}},color={217,67,180})); + connect(b2.y,clockEvent_2. u) + annotation (Line(points={{-59,-50},{-26.6,-50}},color={217,67,180})); + connect(clockEvent_2.y, afterUntil.ck2) annotation (Line( + points={{-13.4,-50},{34,-50},{34,-4},{39,-4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent_1.y, afterUntil.ck1) annotation (Line( + points={{-13.4,30},{34,30},{34,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(afterUntil.p_after_b1_until_b2, p_after_b1_until_b2) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); +end AfterUntil_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/AfterUntil_no_ext2.mo b/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/AfterUntil_no_ext2.mo new file mode 100644 index 0000000..2c05e42 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/AfterUntil_no_ext2.mo @@ -0,0 +1,42 @@ +within CRML_test.FORML.AfterUntil_no_ext; +model AfterUntil_no_ext2 +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,24},{-14,36}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-26,-56},{-14,-44}}))); + AfterUntil.AfterUntill2 afterUntill2_1 + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_after_b1_until_b2 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +equation + + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,30},{-26.6,30}},color={217,67,180})); + connect(b2.y,clockEvent_2. u) + annotation (Line(points={{-59,-50},{-26.6,-50}},color={217,67,180})); + connect(clockEvent_1.y, afterUntill2_1.ck1) annotation (Line( + points={{-13.4,30},{34,30},{34,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent_2.y, afterUntill2_1.ck2) annotation (Line( + points={{-13.4,-50},{34,-50},{34,-4},{39,-4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(afterUntill2_1.p_after_b1_until_b2, p_after_b1_until_b2) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); +end AfterUntil_no_ext2; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/package.mo b/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/package.mo new file mode 100644 index 0000000..451b69e --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package AfterUntil_no_ext +end AfterUntil_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/package.order b/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/package.order new file mode 100644 index 0000000..226f9d7 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/AfterUntil_no_ext/package.order @@ -0,0 +1,2 @@ +AfterUntil_no_ext +AfterUntil_no_ext2 diff --git a/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd.mo b/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd.mo new file mode 100644 index 0000000..3fa98fb --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd.mo @@ -0,0 +1,73 @@ +within CRML_test.FORML.CheckAtEnd; +block CheckAtEnd + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.ETL.Connectors.Boolean4Input u "Boolean4 condition" annotation ( + Placement(transformation(extent={{-120,-10},{-100,10}}), + iconTransformation(extent={{-120,-10},{-100,10}}))); + CRML.ETL.Connectors.TimeLocatorInput[N] tl annotation (Placement( + transformation(extent={{-10,90},{10,110}}), iconTransformation(extent={ + {-10,90},{10,110}}))); + CRML.ETL.Connectors.Boolean4Output y + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.Blocks.Logical4.And4_n and4(N=N) + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.Blocks.Routing.Boolean4Replicator boolean4Replicator(nout=N) + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + EvaluateAtEnd [N] evaluateAtEnd + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); +equation + connect(u, boolean4Replicator.u) + annotation (Line(points={{-110,0},{-62,0}}, color={162,29,33})); + connect(and4.y, y) + annotation (Line(points={{61,0},{110,0}}, color={162,29,33})); +// Text( +// extent={{-74,32},{74,-36}}, +// lineColor={0,0,0}, +// fillColor={28,108,200}, +// fillPattern=FillPattern.Solid, +// textString=boxName), + connect(evaluateAtEnd.tl, tl) + annotation (Line(points={{0,10},{0,100}}, color={0,0,255})); + connect(evaluateAtEnd.u, boolean4Replicator.y) + annotation (Line(points={{-11,0},{-39,0}}, color={162,29,33})); + connect(evaluateAtEnd.y, and4.u) + annotation (Line(points={{11,0},{39,0}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + fillColor={162,29,33}, + lineThickness=5, + fillPattern=FillPattern.Solid, + borderPattern=BorderPattern.Raised, + lineColor={0,0,0}), + Rectangle( + extent={{-78,80},{82,-80}}, + lineColor={175,175,175}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-70,72},{70,44}}, + lineColor={28,108,200}, + textString="check"), + Text( + extent={{-70,18},{70,-10}}, + lineColor={28,108,200}, + textString="at end")}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end CheckAtEnd; diff --git a/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd_externals.mo b/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd_externals.mo new file mode 100644 index 0000000..8a6729c --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd_externals.mo @@ -0,0 +1,49 @@ +within CRML_test.FORML.CheckAtEnd; +model CheckAtEnd_externals + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable boolean4Constant1( + y0=false, + option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2.5,5}) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.ETL.Connectors.Boolean4Output u + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{-20,46},{-12,54}}))); + CRML.Blocks.Logical4.And4 and4_1 + annotation (Placement(transformation(extent={{0,32},{20,52}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant3(K=CRML.ETL.Types.Boolean4.undecided) + annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{-4,-54},{4,-46}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] P1 + annotation (Placement(transformation(extent={{100,-80},{120,-60}}))); + CRML.TimeLocators.Continuous.During during + annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); +equation + connect(boolean4Constant1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{-20.4,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, and4_1.u1) + annotation (Line(points={{-11.6,50},{-1,50}}, color={162,29,33})); + connect(boolean4Constant3.y, and4_1.u2) annotation (Line(points={{-13,30},{-6, + 30},{-6,34},{-1,34}}, color={162,29,33})); + connect(and4_1.y, u) annotation (Line(points={{21,42},{66,42},{66,50},{110,50}}, + color={162,29,33})); + connect(b1.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,-50},{-4.4,-50}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, during.u) + annotation (Line(points={{4.4,-50},{39,-50}}, color={162,29,33})); + connect(during.y, P1) annotation (Line(points={{50,-60},{84,-60},{84,-70},{110, + -70}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end CheckAtEnd_externals; diff --git a/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd_verif.mo b/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd_verif.mo new file mode 100644 index 0000000..a668574 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/CheckAtEnd/CheckAtEnd_verif.mo @@ -0,0 +1,32 @@ +within CRML_test.FORML.CheckAtEnd; +model CheckAtEnd_verif + CheckAtEnd_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + CRML.Requirements.CheckAtEnd checkAtEnd + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + CRML.ETL.Connectors.Boolean4Output b_check_at_end + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +equation + // Bindings + checkAtEnd.u = externals.u; + checkAtEnd.tl[:] = externals.P1[:]; + connect(checkAtEnd.y, b_check_at_end) + annotation (Line(points={{-29,0},{110,0}}, color={162,29,33})); + 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 CheckAtEnd_verif; diff --git a/libraries/modelica/CRML_test/FORML/CheckAtEnd/EvaluateAtEnd.mo b/libraries/modelica/CRML_test/FORML/CheckAtEnd/EvaluateAtEnd.mo new file mode 100644 index 0000000..15baf47 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/CheckAtEnd/EvaluateAtEnd.mo @@ -0,0 +1,92 @@ +within CRML_test.FORML.CheckAtEnd; +block EvaluateAtEnd + +public + CRML.ETL.Connectors.Boolean4Input u "Boolean4 condition" annotation ( + Placement(transformation(extent={{-120,-10},{-100,10}}), + iconTransformation(extent={{-120,-10},{-100,10}}))); + CRML.ETL.Connectors.TimeLocatorInput tl annotation (Placement(transformation( + extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10, + 110}}))); + CRML.ETL.Connectors.Boolean4Output y + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML_test.ETL.EvaluateOver.IntegrateUndefined integrateUndefined + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Requirements.DecideOver decideOver + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant(K=CRML.ETL.Types.Boolean4.false4) + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + CRML.Blocks.Events.EventFilter eventFilter + annotation (Placement(transformation(extent={{-20,-10},{0,10}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4 + annotation (Placement(transformation(extent={{6,-4},{14,4}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent + annotation (Placement(transformation(extent={{-44,4},{-36,12}}))); + CRML.Blocks.Events.Event4ToEvent event4ToEvent1 + annotation (Placement(transformation(extent={{-44,-24},{-36,-16}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant1 + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); +equation +// Text( +// extent={{-74,32},{74,-36}}, +// lineColor={0,0,0}, +// fillColor={28,108,200}, +// fillPattern=FillPattern.Solid, +// textString=boxName), + connect(eventFilter.y, booleanToBoolean4.u) + annotation (Line(points={{1,0},{5.6,0}}, color={217,67,180})); + connect(decideOver.y, event4ToEvent.u) annotation (Line(points={{-59,0},{-50,0}, + {-50,8},{-44.4,8}}, color={162,29,33})); + connect(event4ToEvent1.u, u) annotation (Line(points={{-44.4,-20},{-90,-20},{-90, + 0},{-110,0}}, color={162,29,33})); + connect(event4ToEvent1.y, eventFilter.u) annotation (Line(points={{-35.6,-20}, + {-26,-20},{-26,0},{-21,0}}, color={217,67,180})); + connect(event4ToEvent.y, eventFilter.cond) + annotation (Line(points={{-35.6,8},{-21,8}}, color={217,67,180})); + connect(decideOver.tl,tl) annotation (Line(points={{-70,10},{-70,80},{0,80}, + {0,100}}, color={0,0,255})); + connect(integrateUndefined.tl,tl) annotation (Line(points={{50,10},{50,80},{ + 0,80},{0,100}}, color={0,0,255})); + connect(boolean4Constant.y, integrateUndefined.a) annotation (Line(points={{1, + 50},{20,50},{20,8},{39,8}}, color={162,29,33})); + connect(booleanToBoolean4.y, integrateUndefined.u) + annotation (Line(points={{14.4,0},{39,0}}, color={162,29,33})); + connect(integrateUndefined.y, y) + annotation (Line(points={{61,0},{110,0}}, color={162,29,33})); + connect(boolean4Constant1.y, decideOver.u) annotation (Line(points={{-79,50}, + {-74,50},{-74,14},{-88,14},{-88,0},{-81,0}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + fillColor={162,29,33}, + lineThickness=5, + fillPattern=FillPattern.Solid, + borderPattern=BorderPattern.Raised, + lineColor={0,0,0}), + Rectangle( + extent={{-78,80},{82,-80}}, + lineColor={175,175,175}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-70,72},{70,44}}, + lineColor={28,108,200}, + textString="evaluate"), + Text( + extent={{-70,18},{70,-10}}, + lineColor={28,108,200}, + textString="at end")}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end EvaluateAtEnd; diff --git a/libraries/modelica/CRML_test/FORML/CheckAtEnd/package.mo b/libraries/modelica/CRML_test/FORML/CheckAtEnd/package.mo new file mode 100644 index 0000000..8602a38 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/CheckAtEnd/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package CheckAtEnd +end CheckAtEnd; diff --git a/libraries/modelica/CRML_test/FORML/CheckAtEnd/package.order b/libraries/modelica/CRML_test/FORML/CheckAtEnd/package.order new file mode 100644 index 0000000..c6f3eaf --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/CheckAtEnd/package.order @@ -0,0 +1,4 @@ +CheckAtEnd +CheckAtEnd_externals +CheckAtEnd_verif +EvaluateAtEnd diff --git a/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore.mo b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore.mo new file mode 100644 index 0000000..94fdb21 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore.mo @@ -0,0 +1,71 @@ +within CRML_test.FORML.FromBefore; +block FromBefore +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation( + Placement(transformation(extent = {{-120, 30}, {-100, 50}}), iconTransformation(extent = {{-120, 30}, {-100, 50}}))); + CRML.ETL.Connectors.WhileInput tl annotation( + Placement(transformation(extent = {{-10, 90}, {10, 110}}), iconTransformation(extent = {{-10, 90}, {10, 110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_from_b1_before_b2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.ETL.TimeLocators.Periods periods(leftBoundaryIncluded=true, rightBoundaryIncluded = false) annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 annotation( + Placement(transformation(extent = {{-80, 30}, {-60, 50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 annotation( + Placement(transformation(extent = {{-44, 36}, {-36, 44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 annotation( + Placement(transformation(extent = {{-80, -50}, {-60, -30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 annotation( + Placement(transformation(extent = {{-44, -44}, {-36, -36}}))); + +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation( + Placement(transformation(extent={{-120,-50},{-100,-30}}), iconTransformation(extent={{-120, + -50},{-100,-30}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + connect(ck1, clockToBoolean_ck1.u) annotation( + Line(points = {{-110, 40}, {-82, 40}}, color = {175, 175, 175}, pattern = LinePattern.Dot, thickness = 0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) annotation( + Line(points = {{-59, 40}, {-44.4, 40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck1.y, periods.u1) annotation( + Line(points = {{-35.6, 40}, {-20, 40}, {-20, 0}, {-11, 0}}, color = {162, 29, 33})); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) annotation( + Line(points = {{-59, -40}, {-44.4, -40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck2.y, periods.u2) annotation( + Line(points = {{-35.6, -40}, {-20, -40}, {-20, -8}, {-11, -8}}, color = {162, 29, 33})); + connect(periods.y, p_from_b1_before_b2) annotation (Line(points={{0,-10},{0,-20}, + {80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, periods.tl) annotation( + Line(points = {{0, 100}, {0, 10}}, color = {0, 0, 255})); + connect(clockToBoolean_ck2.u, ck2) annotation (Line( + points={{-82,-40},{-110,-40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation( + Icon(coordinateSystem(preserveAspectRatio = false), graphics = {Rectangle(fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid, lineThickness = 5, borderPattern = BorderPattern.Raised, extent = {{-100, 100}, {100, -100}}), Rectangle(lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-70, 30}, {70, -52}}), Line(points = {{-50, -34}, {-50, -12}}, pattern = LinePattern.Dash), Line(points = {{-48, -12}, {52, -12}}, pattern = LinePattern.Dash), Line(points = {{52, -12}, {52, -34}}, pattern = LinePattern.Dash), Line(points = {{-62, -34}, {58, -34}}, color = {175, 175, 175}), Line(points = {{-50, -12}, {-50, 10}}, pattern = LinePattern.Dash), Rectangle(fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid, extent = {{22, 2}, {52, -12}}), Line(points = {{-50, 10}, {22, 10}}, pattern = LinePattern.Dash), Line(points = {{22, 10}, {22, -12}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {20, -10}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {24, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-52, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-48, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, 30}, {-70, 30}, {-70, -52}, {-50, -52}}), Line(points = {{50, 30}, {70, 30}, {70, -52}, {50, -52}}), Text(textColor = {175, 175, 175}, extent = {{-28, -10}, {22, -34}}, textString = "%u"), Text(extent = {{-78, 86}, {76, 38}}, + textString="from before", + textColor={0,0,0})}), + Diagram(coordinateSystem(preserveAspectRatio = false)), + Documentation(info = " +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end FromBefore; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore2.mo b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore2.mo new file mode 100644 index 0000000..787cb2e --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore2.mo @@ -0,0 +1,96 @@ +within CRML_test.FORML.FromBefore; +block FromBefore2 + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; + +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,30},{-100,50}}), iconTransformation(extent={{-120,30}, + {-100,50}}))); + CRML.ETL.Connectors.WhileInput tl annotation (Placement( + transformation(extent={{-10,90},{10,110}}), iconTransformation(extent={ + {-10,90},{10,110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_from_b1_before_b2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,-50},{-100,-30}}), iconTransformation( + extent={{-120,-50},{-100,-30}}))); + CRML.TimeLocators.Continuous.FromBefore + fromBefore + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 + annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 + annotation (Placement(transformation(extent={{-44,36},{-36,44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 + annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 + annotation (Placement(transformation(extent={{-44,-44},{-36,-36}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + + connect(ck1, clockToBoolean_ck1.u) annotation (Line( + points={{-110,40},{-110,40},{-110,40},{-82,40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) + annotation (Line(points={{-59,40},{-44.4,40}}, color={255,0,255})); + connect(booleanToBoolean4_ck1.y, fromBefore.u1) annotation (Line(points={{-35.6, + 40},{-20,40},{-20,0},{-11,0}}, color={162,29,33})); + connect(ck2, clockToBoolean_ck2.u) annotation (Line( + points={{-110,-40},{-82,-40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) + annotation (Line(points={{-59,-40},{-44.4,-40}}, color={255,0,255})); + connect(booleanToBoolean4_ck2.y, fromBefore.u2) annotation (Line(points={{-35.6, + -40},{-20,-40},{-20,-8},{-11,-8}}, color={162,29,33})); + connect(fromBefore.y, p_from_b1_before_b2) annotation (Line(points={{0,-10},{ + 0,-20},{80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, fromBefore.tl) + annotation (Line(points={{0,100},{0,10}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle(extent={{-100, + 100},{100,-100}}, fillColor = {85, 170, 255}, lineThickness = 5, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Raised, lineColor = {0, 0, 0}), Rectangle(extent={{-70,30}, + {70,-52}}, lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points={{-50,-34}, + {-50,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-48,-12}, + {52,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{52,-12}, + {52,-34}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-62,-34}, + {58,-34}}, color = {175, 175, 175}), Line(points={{-50,-12}, + {-50,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Rectangle(extent={{22,2},{ + 52,-12}}, lineColor = {0, 0, 0}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid), Line(points={{-50,10}, + {22,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,10}, + {22,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {20,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {24,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-52,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-48,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,30}, + {-70,30},{-70,-52},{-50,-52}}, color = {0, 0, 0}), Line(points={{50,30}, + {70,30},{70,-52},{50,-52}}, color = {0, 0, 0}), Text(extent={{-28,-10}, + {22,-34}}, lineColor = {175, 175, 175}, pattern = LinePattern.Dash, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, textString = "%u"), Text(extent={{-78,86}, + {76,38}}, lineColor={0,0,0}, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, + textString="from before")}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end FromBefore2; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_externals.mo b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_externals.mo new file mode 100644 index 0000000..3a4902e --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_externals.mo @@ -0,0 +1,43 @@ +within CRML_test.FORML.FromBefore; +model FromBefore_externals + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); + CRML.ETL.Connectors.ClockOutput ck1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.ClockOutput ck2 + annotation (Placement(transformation(extent={{100,-80},{120,-60}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-6,54},{6,66}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-6,-66},{6,-54}}))); +equation + connect(b1.y, clockEvent_1.u) + annotation (Line(points={{-39,60},{-6.6,60}}, color={217,67,180})); + connect(clockEvent_1.y, ck1) annotation (Line( + points={{6.6,60},{40,60},{40,50},{110,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(b2.y, clockEvent_2.u) + annotation (Line(points={{-39,-60},{-6.6,-60}}, color={217,67,180})); + connect(clockEvent_2.y, ck2) annotation (Line( + points={{6.6,-60},{40,-60},{40,-70},{110,-70}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end FromBefore_externals; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_verif.mo b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_verif.mo new file mode 100644 index 0000000..8ff6182 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_verif.mo @@ -0,0 +1,21 @@ +within CRML_test.FORML.FromBefore; +model FromBefore_verif + FromBefore_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + FromBefore fromBefore + annotation (Placement(transformation(extent={{0,0},{20,20}}))); +equation + // Bindings + externals.ck1 =fromBefore.ck1; + externals.ck2 =fromBefore.ck2; + annotation (Icon(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}})})); +end FromBefore_verif; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_verif2.mo b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_verif2.mo new file mode 100644 index 0000000..767ad1a --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore/FromBefore_verif2.mo @@ -0,0 +1,22 @@ +within CRML_test.FORML.FromBefore; +model FromBefore_verif2 + + FromBefore_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + FromBefore2 fromBefore2 + annotation (Placement(transformation(extent={{-26,16},{-6,36}}))); +equation + // Bindings + externals.ck1 =fromBefore2.ck1; + externals.ck2 =fromBefore2.ck2; + annotation (Icon(graphics={ + Ellipse(lineColor = {75,138,73}, + fillColor={255,255,255}, + fillPattern = FillPattern.Solid, + extent={{-100,-102},{100,98}}), + Polygon(lineColor = {0,0,255}, + fillColor = {75,138,73}, + pattern = LinePattern.None, + fillPattern = FillPattern.Solid, + points={{-36,58},{64,-2},{-36,-62},{-36,58}})})); +end FromBefore_verif2; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore/package.mo b/libraries/modelica/CRML_test/FORML/FromBefore/package.mo new file mode 100644 index 0000000..cf974fe --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package FromBefore +end FromBefore; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore/package.order b/libraries/modelica/CRML_test/FORML/FromBefore/package.order new file mode 100644 index 0000000..472beef --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore/package.order @@ -0,0 +1,5 @@ +FromBefore +FromBefore2 +FromBefore_externals +FromBefore_verif +FromBefore_verif2 diff --git a/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/FromBefore_no_ext.mo b/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/FromBefore_no_ext.mo new file mode 100644 index 0000000..3bd6028 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/FromBefore_no_ext.mo @@ -0,0 +1,42 @@ +within CRML_test.FORML.FromBefore_no_ext; +model FromBefore_no_ext +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,24},{-14,36}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-26,-56},{-14,-44}}))); + FromBefore.FromBefore fromBefore + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_from_b1_before_b2 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +equation + + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,30},{-26.6,30}},color={217,67,180})); + connect(b2.y,clockEvent_2. u) + annotation (Line(points={{-59,-50},{-26.6,-50}},color={217,67,180})); + connect(clockEvent_2.y, fromBefore.ck2) annotation (Line( + points={{-13.4,-50},{34,-50},{34,-4},{39,-4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent_1.y, fromBefore.ck1) annotation (Line( + points={{-13.4,30},{34,30},{34,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(fromBefore.p_from_b1_before_b2, p_from_b1_before_b2) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); +end FromBefore_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/FromBefore_no_ext2.mo b/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/FromBefore_no_ext2.mo new file mode 100644 index 0000000..e32a55c --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/FromBefore_no_ext2.mo @@ -0,0 +1,42 @@ +within CRML_test.FORML.FromBefore_no_ext; +model FromBefore_no_ext2 +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,24},{-14,36}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-26,-56},{-14,-44}}))); + FromBefore.FromBefore2 fromBefore2_1 + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_from_b1_before_b2 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +equation + + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,30},{-26.6,30}},color={217,67,180})); + connect(b2.y,clockEvent_2. u) + annotation (Line(points={{-59,-50},{-26.6,-50}},color={217,67,180})); + connect(clockEvent_1.y, fromBefore2_1.ck1) annotation (Line( + points={{-13.4,30},{34,30},{34,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent_2.y, fromBefore2_1.ck2) annotation (Line( + points={{-13.4,-50},{34,-50},{34,-4},{39,-4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(fromBefore2_1.p_from_b1_before_b2, p_from_b1_before_b2) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); +end FromBefore_no_ext2; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/package.mo b/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/package.mo new file mode 100644 index 0000000..51fbeb9 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package FromBefore_no_ext +end FromBefore_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/package.order b/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/package.order new file mode 100644 index 0000000..389ba5c --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromBefore_no_ext/package.order @@ -0,0 +1,2 @@ +FromBefore_no_ext +FromBefore_no_ext2 diff --git a/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil.mo b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil.mo new file mode 100644 index 0000000..61a89b5 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil.mo @@ -0,0 +1,72 @@ +within CRML_test.FORML.FromUntil; +block FromUntil +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation( + Placement(transformation(extent = {{-120, 30}, {-100, 50}}), iconTransformation(extent = {{-120, 30}, {-100, 50}}))); + CRML.ETL.Connectors.WhileInput tl annotation( + Placement(transformation(extent = {{-10, 90}, {10, 110}}), iconTransformation(extent = {{-10, 90}, {10, 110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_from_b1_until_b2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.ETL.TimeLocators.Periods periods(leftBoundaryIncluded=true, + rightBoundaryIncluded=true) annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 annotation( + Placement(transformation(extent = {{-80, 30}, {-60, 50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 annotation( + Placement(transformation(extent = {{-44, 36}, {-36, 44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 annotation( + Placement(transformation(extent = {{-80, -50}, {-60, -30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 annotation( + Placement(transformation(extent = {{-44, -44}, {-36, -36}}))); + +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation( + Placement(transformation(extent={{-120,-50},{-100,-30}}), iconTransformation(extent={{-120, + -50},{-100,-30}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + connect(ck1, clockToBoolean_ck1.u) annotation( + Line(points = {{-110, 40}, {-82, 40}}, color = {175, 175, 175}, pattern = LinePattern.Dot, thickness = 0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) annotation( + Line(points = {{-59, 40}, {-44.4, 40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck1.y, periods.u1) annotation( + Line(points = {{-35.6, 40}, {-20, 40}, {-20, 0}, {-11, 0}}, color = {162, 29, 33})); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) annotation( + Line(points = {{-59, -40}, {-44.4, -40}}, color = {255, 0, 255})); + connect(booleanToBoolean4_ck2.y, periods.u2) annotation( + Line(points = {{-35.6, -40}, {-20, -40}, {-20, -8}, {-11, -8}}, color = {162, 29, 33})); + connect(periods.y, p_from_b1_until_b2) annotation (Line(points={{0,-10},{0,-20}, + {80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, periods.tl) annotation( + Line(points = {{0, 100}, {0, 10}}, color = {0, 0, 255})); + connect(clockToBoolean_ck2.u, ck2) annotation (Line( + points={{-82,-40},{-110,-40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation( + Icon(coordinateSystem(preserveAspectRatio = false), graphics = {Rectangle(fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid, lineThickness = 5, borderPattern = BorderPattern.Raised, extent = {{-100, 100}, {100, -100}}), Rectangle(lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-70, 30}, {70, -52}}), Line(points = {{-50, -34}, {-50, -12}}, pattern = LinePattern.Dash), Line(points = {{-48, -12}, {52, -12}}, pattern = LinePattern.Dash), Line(points = {{52, -12}, {52, -34}}, pattern = LinePattern.Dash), Line(points = {{-62, -34}, {58, -34}}, color = {175, 175, 175}), Line(points = {{-50, -12}, {-50, 10}}, pattern = LinePattern.Dash), Rectangle(fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid, extent = {{22, 2}, {52, -12}}), Line(points = {{-50, 10}, {22, 10}}, pattern = LinePattern.Dash), Line(points = {{22, 10}, {22, -12}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {20, -10}}, pattern = LinePattern.Dash), Line(points = {{22, -12}, {24, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-52, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, -12}, {-48, -10}}, pattern = LinePattern.Dash), Line(points = {{-50, 30}, {-70, 30}, {-70, -52}, {-50, -52}}), Line(points = {{50, 30}, {70, 30}, {70, -52}, {50, -52}}), Text(textColor = {175, 175, 175}, extent = {{-28, -10}, {22, -34}}, textString = "%u"), Text(extent = {{-78, 86}, {76, 38}}, + textColor={0,0,0}, + textString="from until")}), + Diagram(coordinateSystem(preserveAspectRatio = false)), + Documentation(info = " +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end FromUntil; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil2.mo b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil2.mo new file mode 100644 index 0000000..77a74f3 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil2.mo @@ -0,0 +1,96 @@ +within CRML_test.FORML.FromUntil; +block FromUntil2 + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + CRML.ETL.Connectors.WhileOutput tl1 = tl; + +public + CRML.ETL.Connectors.ClockInput ck1 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,30},{-100,50}}), iconTransformation(extent={{-120,30}, + {-100,50}}))); + CRML.ETL.Connectors.WhileInput tl annotation (Placement( + transformation(extent={{-10,90},{10,110}}), iconTransformation(extent={ + {-10,90},{10,110}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_from_b1_until_b2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +public + CRML.ETL.Connectors.ClockInput ck2 "Boolean4 condition" annotation (Placement( + transformation(extent={{-120,-50},{-100,-30}}), iconTransformation( + extent={{-120,-50},{-100,-30}}))); + CRML.TimeLocators.Continuous.FromUntil + fromUntil + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck1 + annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck1 + annotation (Placement(transformation(extent={{-44,36},{-36,44}}))); + Modelica.Clocked.BooleanSignals.NonPeriodic.ClockToBoolean clockToBoolean_ck2 + annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_ck2 + annotation (Placement(transformation(extent={{-44,-44},{-36,-36}}))); +equation + if (cardinality(tl) == 0) then + tl.timePeriod = true; + tl.clock = CRML.ETL.Types.Boolean4.true4; + tl.isLeftBoundaryIncluded = true; + tl.isRightBoundaryIncluded = true; + end if; + + connect(ck1, clockToBoolean_ck1.u) annotation (Line( + points={{-110,40},{-110,40},{-110,40},{-82,40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck1.y, booleanToBoolean4_ck1.u) + annotation (Line(points={{-59,40},{-44.4,40}}, color={255,0,255})); + connect(booleanToBoolean4_ck1.y, fromUntil.u1) annotation (Line(points={{-35.6, + 40},{-20,40},{-20,0},{-11,0}}, color={162,29,33})); + connect(ck2, clockToBoolean_ck2.u) annotation (Line( + points={{-110,-40},{-82,-40}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean_ck2.y, booleanToBoolean4_ck2.u) + annotation (Line(points={{-59,-40},{-44.4,-40}}, color={255,0,255})); + connect(booleanToBoolean4_ck2.y, fromUntil.u2) annotation (Line(points={{-35.6, + -40},{-20,-40},{-20,-8},{-11,-8}}, color={162,29,33})); + connect(fromUntil.y, p_from_b1_until_b2) annotation (Line(points={{0,-10},{0, + -20},{80,-20},{80,0},{110,0}}, color={0,0,255})); + connect(tl1, fromUntil.tl) + annotation (Line(points={{0,100},{0,10}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle(extent={{-100, + 100},{100,-100}}, fillColor = {85, 170, 255}, lineThickness = 5, fillPattern = FillPattern.Solid, borderPattern = BorderPattern.Raised, lineColor = {0, 0, 0}), Rectangle(extent={{-70,30}, + {70,-52}}, lineColor = {175, 175, 175}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points={{-50,-34}, + {-50,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-48,-12}, + {52,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{52,-12}, + {52,-34}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-62,-34}, + {58,-34}}, color = {175, 175, 175}), Line(points={{-50,-12}, + {-50,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Rectangle(extent={{22,2},{ + 52,-12}}, lineColor = {0, 0, 0}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid), Line(points={{-50,10}, + {22,10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,10}, + {22,-12}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {20,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{22,-12}, + {24,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-52,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,-12}, + {-48,-10}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points={{-50,30}, + {-70,30},{-70,-52},{-50,-52}}, color = {0, 0, 0}), Line(points={{50,30}, + {70,30},{70,-52},{50,-52}}, color = {0, 0, 0}), Text(extent={{-28,-10}, + {22,-34}}, lineColor = {175, 175, 175}, pattern = LinePattern.Dash, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, textString = "%u"), Text(extent={{-78,86}, + {76,38}}, lineColor={0,0,0}, fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, + textString="from until")}), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Syntax

+
y = CheckAtEnd (u = condition, tl = time_period, checkAtEnd);
+

Description

+

Each instance of this block creates a requirement that evaluates whether the condition u is satisfied (true) at the end of the time period tl (which can be a continuous or discrete time period). The condition is a Boolean4 that takes its values in the { true, false, undecided, undefined } set.

+

To create time locators, refer to the Periods block.

+

The value of a requirement is a Boolean4 that can be used as input of another Ensure block. It is therefore possible to express requirements on requirements.

+

Requirements can be combined using Boolean4 operators, refer to the Logical4 package.

+

The condition u can be generated by converting Boolean signals to Boolean4 signals with the block BooleanToBoolean4, or by using the output y of another Check, CheckInteger or CheckReal block.

+


Example

+

This block is demonstrated with the following example:

+")); +end FromUntil2; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_externals.mo b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_externals.mo new file mode 100644 index 0000000..7b84c2c --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_externals.mo @@ -0,0 +1,43 @@ +within CRML_test.FORML.FromUntil; +model FromUntil_externals + +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; + +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); + CRML.ETL.Connectors.ClockOutput ck1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.ClockOutput ck2 + annotation (Placement(transformation(extent={{100,-80},{120,-60}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-6,54},{6,66}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-6,-66},{6,-54}}))); +equation + connect(b1.y, clockEvent_1.u) + annotation (Line(points={{-39,60},{-6.6,60}}, color={217,67,180})); + connect(clockEvent_1.y, ck1) annotation (Line( + points={{6.6,60},{40,60},{40,50},{110,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(b2.y, clockEvent_2.u) + annotation (Line(points={{-39,-60},{-6.6,-60}}, color={217,67,180})); + connect(clockEvent_2.y, ck2) annotation (Line( + points={{6.6,-60},{40,-60},{40,-70},{110,-70}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end FromUntil_externals; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_verif.mo b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_verif.mo new file mode 100644 index 0000000..c87b165 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_verif.mo @@ -0,0 +1,21 @@ +within CRML_test.FORML.FromUntil; +model FromUntil_verif + FromUntil_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + FromUntil fromUntil + annotation (Placement(transformation(extent={{0,0},{20,20}}))); +equation + // Bindings + externals.ck1 =fromUntil.ck1; + externals.ck2 =fromUntil.ck2; + annotation (Icon(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}})})); +end FromUntil_verif; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_verif2.mo b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_verif2.mo new file mode 100644 index 0000000..8e3a476 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil/FromUntil_verif2.mo @@ -0,0 +1,22 @@ +within CRML_test.FORML.FromUntil; +model FromUntil_verif2 + + FromUntil_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + FromUntil2 fromUntil2 + annotation (Placement(transformation(extent={{-26,16},{-6,36}}))); +equation + // Bindings + externals.ck1 =fromUntil2.ck1; + externals.ck2 =fromUntil2.ck2; + annotation (Icon(graphics={ + Ellipse(lineColor = {75,138,73}, + fillColor={255,255,255}, + fillPattern = FillPattern.Solid, + extent={{-100,-102},{100,98}}), + Polygon(lineColor = {0,0,255}, + fillColor = {75,138,73}, + pattern = LinePattern.None, + fillPattern = FillPattern.Solid, + points={{-36,58},{64,-2},{-36,-62},{-36,58}})})); +end FromUntil_verif2; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil/package.mo b/libraries/modelica/CRML_test/FORML/FromUntil/package.mo new file mode 100644 index 0000000..740fa4a --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package FromUntil +end FromUntil; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil/package.order b/libraries/modelica/CRML_test/FORML/FromUntil/package.order new file mode 100644 index 0000000..47ec878 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil/package.order @@ -0,0 +1,5 @@ +FromUntil +FromUntil2 +FromUntil_externals +FromUntil_verif +FromUntil_verif2 diff --git a/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/FromUntil_no_ext.mo b/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/FromUntil_no_ext.mo new file mode 100644 index 0000000..4458ed9 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/FromUntil_no_ext.mo @@ -0,0 +1,42 @@ +within CRML_test.FORML.FromUntil_no_ext; +model FromUntil_no_ext +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,24},{-14,36}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-26,-56},{-14,-44}}))); + FromUntil.FromUntil fromUntil + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_from_b1_until_b2 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +equation + + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,30},{-26.6,30}},color={217,67,180})); + connect(b2.y,clockEvent_2. u) + annotation (Line(points={{-59,-50},{-26.6,-50}},color={217,67,180})); + connect(clockEvent_2.y, fromUntil.ck2) annotation (Line( + points={{-13.4,-50},{34,-50},{34,-4},{39,-4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent_1.y, fromUntil.ck1) annotation (Line( + points={{-13.4,30},{34,30},{34,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(fromUntil.p_from_b1_until_b2, p_from_b1_until_b2) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); +end FromUntil_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/FromUntil_no_ext2.mo b/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/FromUntil_no_ext2.mo new file mode 100644 index 0000000..46d561a --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/FromUntil_no_ext2.mo @@ -0,0 +1,42 @@ +within CRML_test.FORML.FromUntil_no_ext; +model FromUntil_no_ext2 +protected + parameter Integer N = CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical.BooleanTable b1( + y0=false, + option_width=false, + instant={2,3.5,4,5,5.5,5.6,8,8.1,16}) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + CRML.Blocks.Logical.BooleanTable b2( + y0=false, + option_width=false, + instant={2.5,5,6,7,7.5,10}) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent_1 + annotation (Placement(transformation(extent={{-26,24},{-14,36}}))); + CRML.Blocks.Events.ClockEvent clockEvent_2 + annotation (Placement(transformation(extent={{-26,-56},{-14,-44}}))); + FromUntil.FromUntil2 fromUntil2_1 + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] p_from_b1_until_b2 + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); +equation + + connect(b1.y,clockEvent_1. u) + annotation (Line(points={{-59,30},{-26.6,30}},color={217,67,180})); + connect(b2.y,clockEvent_2. u) + annotation (Line(points={{-59,-50},{-26.6,-50}},color={217,67,180})); + connect(clockEvent_1.y, fromUntil2_1.ck1) annotation (Line( + points={{-13.4,30},{34,30},{34,4},{39,4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent_2.y, fromUntil2_1.ck2) annotation (Line( + points={{-13.4,-50},{34,-50},{34,-4},{39,-4}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(fromUntil2_1.p_from_b1_until_b2, p_from_b1_until_b2) + annotation (Line(points={{61,0},{102,0}}, color={0,0,255})); +end FromUntil_no_ext2; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/package.mo b/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/package.mo new file mode 100644 index 0000000..119b79f --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.FORML; +package FromUntil_no_ext +end FromUntil_no_ext; diff --git a/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/package.order b/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/package.order new file mode 100644 index 0000000..75a39ea --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/FromUntil_no_ext/package.order @@ -0,0 +1,2 @@ +FromUntil_no_ext +FromUntil_no_ext2 diff --git a/libraries/modelica/CRML_test/FORML/Tests/DelayedTimePeriods.mo b/libraries/modelica/CRML_test/FORML/Tests/DelayedTimePeriods.mo new file mode 100644 index 0000000..7a3f140 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/Tests/DelayedTimePeriods.mo @@ -0,0 +1,52 @@ +within CRML_test.FORML.Tests; +model DelayedTimePeriods + import CRML; + CRML.Blocks.Events.EventTable event1(option_width = false, instant = {0.5, 4, 5, 7, 10}) annotation( + Placement(transformation(extent = {{-100, 30}, {-80, 50}}))); + CRML.Blocks.Events.ShowEvent showEvent1 annotation( + Placement(transformation(extent = {{-64, 46}, {-56, 54}}))); + CRML.ETL.TimeLocators.Periods fromFor + annotation (Placement(transformation(extent={{40,0},{60,20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 annotation( + Placement(transformation(extent = {{16, 6}, {24, 14}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 annotation( + Placement(transformation(extent = {{16, -2}, {24, 6}}))); + CRML.ETL.TimeLocators.Periods fromFor_duration(durationSpecified=true, + discreteClockSpecified=false) + annotation (Placement(transformation(extent={{40,-40},{60,-20}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_4 annotation( + Placement(transformation(extent = {{16, -34}, {24, -26}}))); + CRML.Blocks.Math.Constant duration(k=5) + annotation (Placement(transformation(extent={{-100,-50},{-80,-30}}))); + CRML.Blocks.Events.ShowEvent showDelayedEvent1 + annotation (Placement(transformation(extent={{-28,10},{-20,18}}))); + CRML.Blocks.Events.EventDelay eventDelay + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); +equation + connect(event1.y, showEvent1.u) annotation( + Line(points = {{-79, 40}, {-70, 40}, {-70, 50}, {-64.4, 50}}, color = {217, 67, 180})); + connect(booleanToBoolean4_2.y, fromFor.u1) + annotation (Line(points={{24.4,10},{39,10}}, color={162,29,33})); + connect(booleanToBoolean4_1.y, fromFor.u2) + annotation (Line(points={{24.4,2},{39,2}}, color={162,29,33})); + connect(booleanToBoolean4_4.y, fromFor_duration.u1) + annotation (Line(points={{24.4,-30},{39,-30}}, color={162,29,33})); + connect(duration.y, fromFor_duration.continuousDuration) annotation (Line( + points={{-79,-40},{36,-40},{36,-38},{39,-38}}, color={0,0,0})); + connect(eventDelay.delay, duration.y) annotation (Line(points={{-61,-8},{-66, + -8},{-66,-40},{-79,-40}}, color={0,0,0})); + connect(eventDelay.u, event1.y) annotation (Line(points={{-61,0},{-68,0},{-68, + 10},{-79,10},{-79,40}}, color={217,67,180})); + connect(booleanToBoolean4_2.u, event1.y) annotation (Line(points={{15.6,10},{ + 2,10},{2,32},{-79,32},{-79,40}}, color={217,67,180})); + connect(booleanToBoolean4_1.u, eventDelay.y) annotation (Line(points={{15.6,2}, + {-36,2},{-36,0},{-39,0}}, color={217,67,180})); + connect(showDelayedEvent1.u, eventDelay.y) annotation (Line(points={{-28.4,14}, + {-30,14},{-30,2},{-36,2},{-36,0},{-39,0}}, color={217,67,180})); + connect(booleanToBoolean4_4.u, event1.y) annotation (Line(points={{15.6,-30}, + {-8,-30},{-8,32},{-79,32},{-79,40}}, color={217,67,180})); + 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)), + experiment(StopTime = 20)); +end DelayedTimePeriods; diff --git a/libraries/modelica/CRML_test/FORML/Tests/package.mo b/libraries/modelica/CRML_test/FORML/Tests/package.mo new file mode 100644 index 0000000..cfdf504 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/Tests/package.mo @@ -0,0 +1,6 @@ +within CRML_test.FORML; +package Tests + + annotation( + Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})})); +end Tests; diff --git a/libraries/modelica/CRML_test/FORML/Tests/package.order b/libraries/modelica/CRML_test/FORML/Tests/package.order new file mode 100644 index 0000000..82997bd --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/Tests/package.order @@ -0,0 +1 @@ +DelayedTimePeriods diff --git a/libraries/modelica/CRML_test/FORML/package.mo b/libraries/modelica/CRML_test/FORML/package.mo new file mode 100644 index 0000000..d59120e --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/package.mo @@ -0,0 +1,19 @@ +within CRML_test; +package FORML +annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100,-100},{100,100}}, + radius=25.0), Text( + extent={{-42,38},{44,-30}}, + lineColor={0,0,0}, + fontName="Symbol", + textString=""), + Rectangle( + lineColor={128,128,128}, + fillPattern=FillPattern.None, + extent={{-100,-100},{100,100}}, + radius=25.0)})); +end FORML; diff --git a/libraries/modelica/CRML_test/FORML/package.order b/libraries/modelica/CRML_test/FORML/package.order new file mode 100644 index 0000000..45b5b26 --- /dev/null +++ b/libraries/modelica/CRML_test/FORML/package.order @@ -0,0 +1,12 @@ +CheckAtEnd +AfterBefore +AfterBefore_no_ext +AfterFor +AfterFor_no_ext +AfterUntil +AfterUntil_no_ext +FromBefore +FromBefore_no_ext +FromUntil +FromUntil_no_ext +Tests diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation.mo new file mode 100644 index 0000000..9b43616 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation.mo @@ -0,0 +1,13 @@ +within CRML_test.Spec_doc.BooleanAccumulation; +partial model BooleanAccumulation + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.Boolean4Connector b2 + annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); + Utilities.Boolean4Connector b_accumulation + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); +equation + b_accumulation = CRML.ETL.Evaluator.TemporalOperators.add4(b1,b2); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanAccumulation; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_externals.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_externals.mo new file mode 100644 index 0000000..e412a08 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_externals.mo @@ -0,0 +1,18 @@ +within CRML_test.Spec_doc.BooleanAccumulation; +model BooleanAccumulation_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 BooleanAccumulation_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_ref.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_ref.mo new file mode 100644 index 0000000..e3d0ecb --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_ref.mo @@ -0,0 +1,13 @@ +within CRML_test.Spec_doc.BooleanAccumulation; +partial model BooleanAccumulation_ref + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.Boolean4Connector b2 + annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); + Utilities.Boolean4Connector b_accumulation + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); +equation + b_accumulation = CRML.ETL.Evaluator.TemporalOperators.add4(b1,b2); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanAccumulation_ref; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_verif.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_verif.mo new file mode 100644 index 0000000..0c59aed --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.BooleanAccumulation; +model BooleanAccumulation_verif + extends BooleanAccumulation; + BooleanAccumulation_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + b2 = externals.b2; + 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 BooleanAccumulation_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_verif_ref.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_verif_ref.mo new file mode 100644 index 0000000..2451dea --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/BooleanAccumulation_verif_ref.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.BooleanAccumulation; +model BooleanAccumulation_verif_ref + extends BooleanAccumulation_ref; + BooleanAccumulation_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + b2 = externals.b2; + 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 BooleanAccumulation_verif_ref; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/package.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/package.mo new file mode 100644 index 0000000..714e6f7 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package BooleanAccumulation +end BooleanAccumulation; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/package.order b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/package.order new file mode 100644 index 0000000..3e14366 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation/package.order @@ -0,0 +1,5 @@ +BooleanAccumulation +BooleanAccumulation_externals +BooleanAccumulation_ref +BooleanAccumulation_verif +BooleanAccumulation_verif_ref diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/BooleanAccumulation_no_ext.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/BooleanAccumulation_no_ext.mo new file mode 100644 index 0000000..2dbd0ff --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/BooleanAccumulation_no_ext.mo @@ -0,0 +1,47 @@ +within CRML_test.Spec_doc.BooleanAccumulation_no_ext; +model BooleanAccumulation_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_true_accumulates_true; + CRML.ETL.Types.Boolean4 b_true_accumulates_false; + CRML.ETL.Types.Boolean4 b_true_accumulates_undecided; + CRML.ETL.Types.Boolean4 b_true_accumulates_undefined; + CRML.ETL.Types.Boolean4 b_false_accumulates_true; + CRML.ETL.Types.Boolean4 b_false_accumulates_false; + CRML.ETL.Types.Boolean4 b_false_accumulates_undecided; + CRML.ETL.Types.Boolean4 b_false_accumulates_undefined; + CRML.ETL.Types.Boolean4 b_undecided_accumulates_true; + CRML.ETL.Types.Boolean4 b_undecided_accumulates_false; + CRML.ETL.Types.Boolean4 b_undecided_accumulates_undecided; + CRML.ETL.Types.Boolean4 b_undecided_accumulates_undefined; + CRML.ETL.Types.Boolean4 b_undefined_accumulates_true; + CRML.ETL.Types.Boolean4 b_undefined_accumulates_false; + CRML.ETL.Types.Boolean4 b_undefined_accumulates_undecided; + CRML.ETL.Types.Boolean4 b_undefined_accumulates_undefined; +equation + b_true_accumulates_true = CRML.ETL.Evaluator.TemporalOperators.add4(b_true, b_true); + b_true_accumulates_false = CRML.ETL.Evaluator.TemporalOperators.add4(b_true, b_false); + b_true_accumulates_undecided = CRML.ETL.Evaluator.TemporalOperators.add4(b_true, b_undecided); + b_true_accumulates_undefined = CRML.ETL.Evaluator.TemporalOperators.add4(b_true, b_undefined); + + b_false_accumulates_true = CRML.ETL.Evaluator.TemporalOperators.add4(b_false, b_true); + b_false_accumulates_false = CRML.ETL.Evaluator.TemporalOperators.add4(b_false, b_false); + b_false_accumulates_undecided = CRML.ETL.Evaluator.TemporalOperators.add4(b_false, b_undecided); + b_false_accumulates_undefined = CRML.ETL.Evaluator.TemporalOperators.add4(b_false, b_undefined); + + b_undecided_accumulates_true = CRML.ETL.Evaluator.TemporalOperators.add4(b_undecided, b_true); + b_undecided_accumulates_false = CRML.ETL.Evaluator.TemporalOperators.add4(b_undecided, b_false); + b_undecided_accumulates_undecided = CRML.ETL.Evaluator.TemporalOperators.add4(b_undecided, b_undecided); + b_undecided_accumulates_undefined = CRML.ETL.Evaluator.TemporalOperators.add4(b_undecided, b_undefined); + + b_undefined_accumulates_true = CRML.ETL.Evaluator.TemporalOperators.add4(b_undefined, b_true); + b_undefined_accumulates_false = CRML.ETL.Evaluator.TemporalOperators.add4(b_undefined, b_false); + b_undefined_accumulates_undecided = CRML.ETL.Evaluator.TemporalOperators.add4(b_undefined, b_undecided); + b_undefined_accumulates_undefined = CRML.ETL.Evaluator.TemporalOperators.add4(b_undefined, b_undefined); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanAccumulation_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/package.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/package.mo new file mode 100644 index 0000000..c72889c --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package BooleanAccumulation_no_ext +end BooleanAccumulation_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/package.order b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/package.order new file mode 100644 index 0000000..cf37336 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAccumulation_no_ext/package.order @@ -0,0 +1 @@ +BooleanAccumulation_no_ext diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent.mo new file mode 100644 index 0000000..5033d58 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent.mo @@ -0,0 +1,30 @@ +within CRML_test.Spec_doc.BooleanAtEvent; +partial model BooleanAtEvent + Utilities.BooleanConnector b1 + annotation (Placement(transformation(extent={{-10,10},{10,-10}}, + rotation=-90, + origin={-110,30}))); + Utilities.ClockConnector c + annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); + Utilities.BooleanConnector b_at_event + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Logical.BooleanClockedDelay booleanClockedDelay + annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-80,-34},{-72,-26}}))); + CRML.Blocks.MathInteger.IntegerConstant integerConstant(K=0) + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); +equation + connect(c, clockToBoolean.u) annotation (Line(points={{-110,-30},{-80.8,-30},{ + -80.8,-30}}, color={0,0,0})); + connect(booleanClockedDelay.u, b1) annotation (Line(points={{-9,0},{-60,0},{ + -60,30},{-110,30}}, color={217,67,180})); + connect(booleanClockedDelay.clock, clockToBoolean.y) annotation (Line(points= + {{-9,8},{-40,8},{-40,-30},{-71.2,-30}}, color={217,67,180})); + connect(booleanClockedDelay.delay, integerConstant.y) annotation (Line(points + ={{-9,-8},{-20,-8},{-20,-60},{-39,-60}}, color={255,127,0})); + connect(booleanClockedDelay.y, b_at_event) + annotation (Line(points={{13,0},{110,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanAtEvent; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent_externals.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent_externals.mo new file mode 100644 index 0000000..55791ab --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent_externals.mo @@ -0,0 +1,37 @@ +within CRML_test.Spec_doc.BooleanAtEvent; +model BooleanAtEvent_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1( + startTime=2, + period=1.5, + width=1) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanPulse boolean4Constant2(period=1.5, startTime= + 1) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.ETL.Connectors.BooleanOutput b1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.ClockOutput c + annotation (Placement(transformation(extent={{100,-60},{120,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{0,-70},{40,-30}}))); + CRML.Blocks.Events.ShowEvent showEvent_b + annotation (Placement(transformation(extent={{-16,-78},{-8,-70}}))); + CRML.Blocks.Events.ShowEvent showEvent_b1 + annotation (Placement(transformation(extent={{-18,26},{-10,34}}))); +equation + connect(boolean4Constant2.y, clockEvent.u) + annotation (Line(points={{-39,-50},{-2,-50}}, color={217,67,180})); + connect(clockEvent.y, c) annotation (Line( + points={{42,-50},{74,-50},{74,-50},{110,-50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(showEvent_b.u, clockEvent.u) annotation (Line(points={{-16.4,-74},{ + -20,-74},{-20,-50},{-2,-50}}, color={217,67,180})); + connect(boolean4Constant1.y, b1) + annotation (Line(points={{-39,50},{110,50}}, color={217,67,180})); + connect(showEvent_b1.u, b1) annotation (Line(points={{-18.4,30},{-20,30},{-20, + 50},{110,50}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanAtEvent_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent_verif.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent_verif.mo new file mode 100644 index 0000000..32b57ed --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanAtEvent/BooleanAtEvent_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.BooleanAtEvent; +model BooleanAtEvent_verif + extends BooleanAtEvent; + BooleanAtEvent_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + c =externals.c; + 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 BooleanAtEvent_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction.mo new file mode 100644 index 0000000..2c8a038 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction.mo @@ -0,0 +1,13 @@ +within CRML_test.Spec_doc.BooleanConjunction; +partial model BooleanConjunction + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.Boolean4Connector b2 + annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); + Utilities.Boolean4Connector b_conjunction + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); +equation + b_conjunction = CRML.Blocks.Logical4.and4(b1, b2); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanConjunction; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction_externals.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction_externals.mo new file mode 100644 index 0000000..23f026d --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction_externals.mo @@ -0,0 +1,18 @@ +within CRML_test.Spec_doc.BooleanConjunction; +model BooleanConjunction_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 BooleanConjunction_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction_verif.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction_verif.mo new file mode 100644 index 0000000..326da50 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/BooleanConjunction_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.BooleanConjunction; +model BooleanConjunction_verif + extends BooleanConjunction; + BooleanConjunction_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + b2 = externals.b2; + 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 BooleanConjunction_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/package.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/package.mo new file mode 100644 index 0000000..2f4798c --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package BooleanConjunction +end BooleanConjunction; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/package.order b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/package.order new file mode 100644 index 0000000..47ea87e --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction/package.order @@ -0,0 +1,3 @@ +BooleanConjunction +BooleanConjunction_externals +BooleanConjunction_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/BooleanConjunction_no_ext.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/BooleanConjunction_no_ext.mo new file mode 100644 index 0000000..d95c2f0 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/BooleanConjunction_no_ext.mo @@ -0,0 +1,47 @@ +within CRML_test.Spec_doc.BooleanConjunction_no_ext; +model BooleanConjunction_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_true_and_true; + CRML.ETL.Types.Boolean4 b_true_and_false; + CRML.ETL.Types.Boolean4 b_true_and_undecided; + CRML.ETL.Types.Boolean4 b_true_and_undefined; + CRML.ETL.Types.Boolean4 b_false_and_true; + CRML.ETL.Types.Boolean4 b_false_and_false; + CRML.ETL.Types.Boolean4 b_false_and_undecided; + CRML.ETL.Types.Boolean4 b_false_and_undefined; + CRML.ETL.Types.Boolean4 b_undecided_and_true; + CRML.ETL.Types.Boolean4 b_undecided_and_false; + CRML.ETL.Types.Boolean4 b_undecided_and_undecided; + CRML.ETL.Types.Boolean4 b_undecided_and_undefined; + CRML.ETL.Types.Boolean4 b_undefined_and_true; + CRML.ETL.Types.Boolean4 b_undefined_and_false; + CRML.ETL.Types.Boolean4 b_undefined_and_undecided; + CRML.ETL.Types.Boolean4 b_undefined_and_undefined; +equation + b_true_and_true = CRML.Blocks.Logical4.and4(b_true, b_true); + b_true_and_false = CRML.Blocks.Logical4.and4(b_true, b_false); + b_true_and_undecided = CRML.Blocks.Logical4.and4(b_true, b_undecided); + b_true_and_undefined = CRML.Blocks.Logical4.and4(b_true, b_undefined); + + b_false_and_true = CRML.Blocks.Logical4.and4(b_false, b_true); + b_false_and_false = CRML.Blocks.Logical4.and4(b_false, b_false); + b_false_and_undecided = CRML.Blocks.Logical4.and4(b_false, b_undecided); + b_false_and_undefined = CRML.Blocks.Logical4.and4(b_false, b_undefined); + + b_undecided_and_true = CRML.Blocks.Logical4.and4(b_undecided, b_true); + b_undecided_and_false = CRML.Blocks.Logical4.and4(b_undecided, b_false); + b_undecided_and_undecided = CRML.Blocks.Logical4.and4(b_undecided, b_undecided); + b_undecided_and_undefined = CRML.Blocks.Logical4.and4(b_undecided, b_undefined); + + b_undefined_and_true = CRML.Blocks.Logical4.and4(b_undefined, b_true); + b_undefined_and_false = CRML.Blocks.Logical4.and4(b_undefined, b_false); + b_undefined_and_undecided = CRML.Blocks.Logical4.and4(b_undefined, b_undecided); + b_undefined_and_undefined = CRML.Blocks.Logical4.and4(b_undefined, b_undefined); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanConjunction_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/package.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/package.mo new file mode 100644 index 0000000..0bfd3e2 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package BooleanConjunction_no_ext +end BooleanConjunction_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/package.order b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/package.order new file mode 100644 index 0000000..1520053 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanConjunction_no_ext/package.order @@ -0,0 +1 @@ +BooleanConjunction_no_ext diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration.mo new file mode 100644 index 0000000..33ffe40 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration.mo @@ -0,0 +1,28 @@ +within CRML_test.Spec_doc.BooleanIntegration; +partial model BooleanIntegration + Utilities.Boolean4Connector a + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.Boolean4Connector b_integration + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + Utilities.TimeLocatorConnector P + annotation (Placement(transformation(extent={{-10,120},{10,100}}))); +// protected +// parameter Integer N=CRML.ETL.Types.nMaxOverlap; +public + CRML.ETL.Evaluator.Integrate boolean4Integrator + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant(K=CRML.ETL.Types.Boolean4.true4) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); +equation + b_integration = CRML.Blocks.Logical4.not4(a); + connect(boolean4Integrator.u, a) annotation (Line(points={{-11,0},{-60,0},{-60, + 30},{-110,30}}, color={162,29,33})); + connect(P, boolean4Integrator.tl) + annotation (Line(points={{0,110},{0,10}}, color={0,0,255})); + connect(boolean4Integrator.y, b_integration) annotation (Line(points={{11,0}, + {64,0},{64,0},{110,0}}, color={162,29,33})); + connect(boolean4Integrator.a, boolean4Constant.y) annotation (Line(points={{ + -11,8},{-26,8},{-26,50},{-39,50}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanIntegration; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration_externals.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration_externals.mo new file mode 100644 index 0000000..2f6aaeb --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration_externals.mo @@ -0,0 +1,66 @@ +within CRML_test.Spec_doc.BooleanIntegration; +model BooleanIntegration_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1 + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + Utilities.Boolean4Connector a + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{12,46},{20,54}}))); + Utilities.TimeLocatorConnector P + annotation (Placement(transformation(extent={{100,-60},{120,-40}}))); + CRML.Blocks.Events.EventPeriodic eventPeriodic1(period=20, startTime=2) + annotation (Placement(transformation(extent={{-60,0},{-40,20}}))); + CRML.Blocks.Events.EventPeriodic eventPeriodic2(period=20, startTime=3.5) + annotation (Placement(transformation(extent={{-60,-50},{-40,-30}}))); + CRML.Blocks.Events.ShowEvent showEvent_e1 + annotation (Placement(transformation(extent={{-8,-24},{0,-16}}))); + CRML.Blocks.Events.ShowEvent showEvent_e2 + annotation (Placement(transformation(extent={{-8,-84},{0,-76}}))); + CRML.ETL.TimeLocators.Periods periods + annotation (Placement(transformation(extent={{40,-20},{60,0}}))); +public + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{10,6},{18,14}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_3 + annotation (Placement(transformation(extent={{10,-44},{18,-36}}))); + inner CRML.TimeLocators.Continuous.Master master + annotation (Placement(transformation(extent={{40,70},{60,90}}))); + CRML.Blocks.Logical.BooleanPulse booleanPulse( + width=6, + period=20, + startTime=2) + annotation (Placement(transformation(extent={{-20,70},{0,90}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 + booleanToBoolean4_7 + annotation (Placement(transformation(extent={{12,76},{20,84}}))); +equation + connect(boolean4Constant1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{11.6,50}}, color={217,67,180})); + connect(a, booleanToBoolean4_1.y) + annotation (Line(points={{110,50},{20.4,50}}, color={162,29,33})); + connect(showEvent_e1.u,eventPeriodic1. y) annotation (Line(points={{-8.4,-20}, + {-24,-20},{-24,10},{-39,10}}, + color={217,67,180})); + connect(eventPeriodic2.y,showEvent_e2. u) annotation (Line(points={{-39,-40}, + {-24,-40},{-24,-80},{-8.4,-80}}, + color={217,67,180})); + connect(eventPeriodic1.y,booleanToBoolean4_2. u) + annotation (Line(points={{-39,10},{9.6,10}}, color={217,67,180})); + connect(eventPeriodic2.y,booleanToBoolean4_3. u) + annotation (Line(points={{-39,-40},{9.6,-40}}, + color={217,67,180})); + connect(booleanToBoolean4_3.y,periods. u2) annotation (Line(points={{18.4,-40}, + {28,-40},{28,-18},{39,-18}}, + color={162,29,33})); + connect(booleanToBoolean4_2.y,periods. u1) annotation (Line(points={{18.4,10}, + {30,10},{30,-10},{39,-10}}, + color={162,29,33})); + connect(P, periods.y[1]) + annotation (Line(points={{110,-50},{50,-50},{50,-20}}, color={0,0,255})); + connect(booleanPulse.y, booleanToBoolean4_7.u) + annotation (Line(points={{1,80},{11.6,80}}, color={217,67,180})); + connect(master.u, booleanToBoolean4_7.y) + annotation (Line(points={{39,80},{20.4,80}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanIntegration_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration_verif.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration_verif.mo new file mode 100644 index 0000000..2bda4f2 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanIntegration/BooleanIntegration_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.BooleanIntegration; +model BooleanIntegration_verif + extends BooleanIntegration; + BooleanIntegration_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings +// a =externals.a; + P =externals.P; + 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 BooleanIntegration_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation.mo new file mode 100644 index 0000000..3a4bc35 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation.mo @@ -0,0 +1,11 @@ +within CRML_test.Spec_doc.BooleanNegation; +partial model BooleanNegation + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.Boolean4Connector not_b1 + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); +equation + not_b1 = CRML.Blocks.Logical4.not4(b1); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanNegation; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation_externals.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation_externals.mo new file mode 100644 index 0000000..44c612f --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation_externals.mo @@ -0,0 +1,12 @@ +within CRML_test.Spec_doc.BooleanNegation; +model BooleanNegation_externals + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant1(K=CRML.ETL.Types.Boolean4.true4) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.Boolean4Output b1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); +equation + connect(boolean4Constant1.y, b1) + annotation (Line(points={{-39,50},{110,50}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanNegation_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation_verif.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation_verif.mo new file mode 100644 index 0000000..b69186f --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/BooleanNegation_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.Spec_doc.BooleanNegation; +model BooleanNegation_verif + extends BooleanNegation; + BooleanNegation_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + 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 BooleanNegation_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/package.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/package.mo new file mode 100644 index 0000000..e53807c --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package BooleanNegation +end BooleanNegation; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/package.order b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/package.order new file mode 100644 index 0000000..dcb1dda --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation/package.order @@ -0,0 +1,3 @@ +BooleanNegation +BooleanNegation_externals +BooleanNegation_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/BooleanNegation_no_ext.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/BooleanNegation_no_ext.mo new file mode 100644 index 0000000..a65a927 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/BooleanNegation_no_ext.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.BooleanNegation_no_ext; +model BooleanNegation_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_not_true; + CRML.ETL.Types.Boolean4 b_not_false; + CRML.ETL.Types.Boolean4 b_not_undecided; + CRML.ETL.Types.Boolean4 b_not_undefined; +equation + b_not_true = CRML.Blocks.Logical4.not4(b_true); + b_not_false = CRML.Blocks.Logical4.not4(b_false); + b_not_undecided = CRML.Blocks.Logical4.not4(b_undecided); + b_not_undefined = CRML.Blocks.Logical4.not4(b_undefined); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanNegation_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/package.mo b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/package.mo new file mode 100644 index 0000000..ce0e2ef --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package BooleanNegation_no_ext +end BooleanNegation_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/package.order b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/package.order new file mode 100644 index 0000000..9657b6f --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/BooleanNegation_no_ext/package.order @@ -0,0 +1 @@ +BooleanNegation_no_ext diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors.mo b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors.mo new file mode 100644 index 0000000..11c9e53 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors.mo @@ -0,0 +1,24 @@ +within CRML_test.Spec_doc.ClockConstructors; +partial model ClockConstructors + Utilities.BooleanConnector b + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.ClockConnector clock + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{-6,14},{6,26}}))); + CRML.Blocks.Events.ShowEvent c + annotation (Placement(transformation(extent={{40,-24},{48,-16}}))); +equation + + connect(b, clockEvent.u) annotation (Line(points={{-110,30},{-58,30},{-58,20}, + {-6.6,20}}, color={0,0,0})); + connect(clockEvent.y, clock) annotation (Line( + points={{6.6,20},{54,20},{54,0},{110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(c.u, b) annotation (Line(points={{39.6,-20},{-32,-20},{-32,30},{-110, + 30}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockConstructors; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors_externals.mo b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors_externals.mo new file mode 100644 index 0000000..22a621f --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors_externals.mo @@ -0,0 +1,12 @@ +within CRML_test.Spec_doc.ClockConstructors; +model ClockConstructors_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1 + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.BooleanOutput b + annotation (Placement(transformation(extent={{100,40},{120,60}}))); +equation + connect(boolean4Constant1.y, b) + annotation (Line(points={{-39,50},{110,50}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockConstructors_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors_verif.mo b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors_verif.mo new file mode 100644 index 0000000..ea9e074 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/ClockConstructors_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.Spec_doc.ClockConstructors; +model ClockConstructors_verif + extends ClockConstructors; + ClockConstructors_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b = externals.b; + 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 ClockConstructors_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/package.mo b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/package.mo new file mode 100644 index 0000000..460362c --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package ClockConstructors +end ClockConstructors; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/package.order b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/package.order new file mode 100644 index 0000000..6b36da6 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors/package.order @@ -0,0 +1,3 @@ +ClockConstructors +ClockConstructors_externals +ClockConstructors_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/ClockConstructors_no_ext.mo b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/ClockConstructors_no_ext.mo new file mode 100644 index 0000000..986d52c --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/ClockConstructors_no_ext.mo @@ -0,0 +1,25 @@ +within CRML_test.Spec_doc.ClockConstructors_no_ext; +model ClockConstructors_no_ext + Utilities.ClockConnector clock + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{-6,14},{6,26}}))); + CRML.Blocks.Events.ShowEvent c + annotation (Placement(transformation(extent={{40,-24},{48,-16}}))); + CRML.Blocks.Logical.BooleanTable boolean4Constant1(option_width=false, + instant={2,3.5}) + annotation (Placement(transformation(extent={{-100,10},{-80,30}}))); +equation + + connect(clockEvent.y, clock) annotation (Line( + points={{6.6,20},{54,20},{54,0},{110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(boolean4Constant1.y, clockEvent.u) + annotation (Line(points={{-79,20},{-6.6,20}}, color={217,67,180})); + connect(c.u, clockEvent.u) annotation (Line(points={{39.6,-20},{-12,-20},{-12, + 20},{-6.6,20}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockConstructors_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/package.mo b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/package.mo new file mode 100644 index 0000000..15a2ccb --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package ClockConstructors_no_ext +end ClockConstructors_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/package.order b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/package.order new file mode 100644 index 0000000..02f42f3 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockConstructors_no_ext/package.order @@ -0,0 +1 @@ +ClockConstructors_no_ext diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick.mo b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick.mo new file mode 100644 index 0000000..06a7315 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.ClockCurrentTick; +partial model ClockCurrentTick + Utilities.ClockConnector c + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); + Utilities.BooleanConnector e_current_tick + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-2,-4},{6,4}}))); +equation + + connect(clockToBoolean.u, c) annotation (Line( + points={{-2.8,0},{-110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean.y, e_current_tick) annotation (Line(points={{6.8,0},{ + 58,0},{58,0},{110,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockCurrentTick; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick_externals.mo b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick_externals.mo new file mode 100644 index 0000000..f0799e9 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick_externals.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.ClockCurrentTick; +model ClockCurrentTick_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1(period=20, startTime= + 2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.ClockOutput c + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{24,44},{36,56}}))); +equation + connect(boolean4Constant1.y, clockEvent.u) + annotation (Line(points={{-39,50},{23.4,50}}, color={217,67,180})); + connect(c, clockEvent.y) annotation (Line( + points={{110,50},{36.6,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockCurrentTick_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick_verif.mo b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick_verif.mo new file mode 100644 index 0000000..0739b60 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/ClockCurrentTick_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.Spec_doc.ClockCurrentTick; +model ClockCurrentTick_verif + extends ClockCurrentTick; + ClockCurrentTick_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + c =externals.c; + 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 ClockCurrentTick_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/package.mo b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/package.mo new file mode 100644 index 0000000..18ca8ef --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package ClockCurrentTick +end ClockCurrentTick; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/package.order b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/package.order new file mode 100644 index 0000000..b37ae93 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick/package.order @@ -0,0 +1,3 @@ +ClockCurrentTick +ClockCurrentTick_externals +ClockCurrentTick_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/ClockCurrentTick_no_ext.mo b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/ClockCurrentTick_no_ext.mo new file mode 100644 index 0000000..414c33b --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/ClockCurrentTick_no_ext.mo @@ -0,0 +1,25 @@ +within CRML_test.Spec_doc.ClockCurrentTick_no_ext; +model ClockCurrentTick_no_ext + Utilities.BooleanConnector e_current_tick + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-2,-4},{6,4}}))); + CRML.Blocks.Logical.BooleanTable boolean4Constant1(option_width=false, + instant={2,3.5,4,5.5}) + annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{-46,-6},{-34,6}}))); +equation + + connect(clockToBoolean.y, e_current_tick) annotation (Line(points={{6.8,0},{ + 58,0},{58,0},{110,0}}, color={217,67,180})); + connect(boolean4Constant1.y, clockEvent.u) + annotation (Line(points={{-79,0},{-46.6,0}}, color={217,67,180})); + connect(clockEvent.y, clockToBoolean.u) annotation (Line( + points={{-33.4,0},{-2.8,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockCurrentTick_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/package.mo b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/package.mo new file mode 100644 index 0000000..b2e60bc --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package ClockCurrentTick_no_ext +end ClockCurrentTick_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/package.order b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/package.order new file mode 100644 index 0000000..0429e45 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockCurrentTick_no_ext/package.order @@ -0,0 +1 @@ +ClockCurrentTick_no_ext diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter.mo b/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter.mo new file mode 100644 index 0000000..eec2252 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.ClockFilter; +partial model ClockFilter + Utilities.ClockConnector c + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); + Utilities.BooleanConnector e_current_tick + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-2,-4},{6,4}}))); +equation + + connect(clockToBoolean.u, c) annotation (Line( + points={{-2.8,0},{-110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean.y, e_current_tick) annotation (Line(points={{6.8,0},{ + 58,0},{58,0},{110,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockFilter; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter_externals.mo b/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter_externals.mo new file mode 100644 index 0000000..d89dd01 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter_externals.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.ClockFilter; +model ClockFilter_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1(period=20, startTime= + 2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.ClockOutput c + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{24,44},{36,56}}))); +equation + connect(boolean4Constant1.y, clockEvent.u) + annotation (Line(points={{-39,50},{23.4,50}}, color={217,67,180})); + connect(c, clockEvent.y) annotation (Line( + points={{110,50},{36.6,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockFilter_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter_verif.mo b/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter_verif.mo new file mode 100644 index 0000000..39e3bf5 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockFilter/ClockFilter_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.Spec_doc.ClockFilter; +model ClockFilter_verif + extends ClockFilter; + ClockFilter_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + c =externals.c; + 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 ClockFilter_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter.mo b/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter.mo new file mode 100644 index 0000000..23c4921 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.ClockFilter_wip; +partial model ClockFilter + Utilities.ClockConnector c + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); + Utilities.BooleanConnector e_current_tick + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-2,-4},{6,4}}))); +equation + + connect(clockToBoolean.u, c) annotation (Line( + points={{-2.8,0},{-110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockToBoolean.y, e_current_tick) annotation (Line(points={{6.8,0},{ + 58,0},{58,0},{110,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockFilter; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter_externals.mo b/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter_externals.mo new file mode 100644 index 0000000..5226b74 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter_externals.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.ClockFilter_wip; +model ClockFilter_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1(period=20, startTime= + 2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.ClockOutput c + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{24,44},{36,56}}))); +equation + connect(boolean4Constant1.y, clockEvent.u) + annotation (Line(points={{-39,50},{23.4,50}}, color={217,67,180})); + connect(c, clockEvent.y) annotation (Line( + points={{110,50},{36.6,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockFilter_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter_verif.mo b/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter_verif.mo new file mode 100644 index 0000000..35c3478 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockFilter_wip/ClockFilter_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.Spec_doc.ClockFilter_wip; +model ClockFilter_verif + extends ClockFilter; + ClockFilter_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + c =externals.c; + 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 ClockFilter_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank.mo b/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank.mo new file mode 100644 index 0000000..4d1169d --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank.mo @@ -0,0 +1,24 @@ +within CRML_test.Spec_doc.ClockRank_wip; +partial model ClockRank + Utilities.ClockConnector c1 + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); + Utilities.IntegerConnector r + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-54,-4},{-46,4}}))); + CRML.Blocks.Events.EventCounter eventCounter + annotation (Placement(transformation(extent={{20,-10},{40,10}}))); +equation + + connect(eventCounter.y, r) annotation (Line(points={{41,0},{74,0},{74,0},{110, + 0}}, color={255,127,0})); + connect(clockToBoolean.y, eventCounter.u) + annotation (Line(points={{-45.2,0},{19,0}}, color={217,67,180})); + connect(clockToBoolean.u, c1) annotation (Line( + points={{-54.8,0},{-110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockRank; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank_externals.mo b/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank_externals.mo new file mode 100644 index 0000000..0a390c8 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank_externals.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.ClockRank_wip; +model ClockRank_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1(period=20, startTime= + 2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.ClockOutput c + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{24,44},{36,56}}))); +equation + connect(boolean4Constant1.y, clockEvent.u) + annotation (Line(points={{-39,50},{23.4,50}}, color={217,67,180})); + connect(c, clockEvent.y) annotation (Line( + points={{110,50},{36.6,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockRank_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank_verif.mo b/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank_verif.mo new file mode 100644 index 0000000..4df0336 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/ClockRank_wip/ClockRank_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.Spec_doc.ClockRank_wip; +model ClockRank_verif + extends ClockRank; + ClockRank_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + c1 = externals.c; + 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 ClockRank_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors.mo b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors.mo new file mode 100644 index 0000000..249177d --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors.mo @@ -0,0 +1,21 @@ +within CRML_test.Spec_doc.EventConstructors; +partial model EventConstructors + Utilities.Boolean4Connector b + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.BooleanConnector e + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.RisingEdge4 rising1 + annotation (Placement(transformation(extent={{-4,-4},{4,4}}))); + CRML.Blocks.Events.ShowEvent showEvent + annotation (Placement(transformation(extent={{40,-24},{48,-16}}))); +equation + + connect(rising1.u, b) annotation (Line(points={{-4.4,0},{-52.2,0},{-52.2,30}, + {-110,30}}, color={162,29,33})); + connect(rising1.y, e) + annotation (Line(points={{4.4,0},{110,0}}, color={217,67,180})); + connect(showEvent.u, e) annotation (Line(points={{39.6,-20},{26,-20},{26,0},{ + 110,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end EventConstructors; diff --git a/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors_externals.mo b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors_externals.mo new file mode 100644 index 0000000..e6bd3c3 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors_externals.mo @@ -0,0 +1,17 @@ +within CRML_test.Spec_doc.EventConstructors; +model EventConstructors_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1(period=20, startTime= + 2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.Boolean4Output b + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{16,46},{24,54}}))); +equation + connect(boolean4Constant1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{15.6,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, b) + annotation (Line(points={{24.4,50},{110,50}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end EventConstructors_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors_verif.mo b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors_verif.mo new file mode 100644 index 0000000..049c965 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/EventConstructors_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.Spec_doc.EventConstructors; +model EventConstructors_verif + extends EventConstructors; + EventConstructors_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b = externals.b; + 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 EventConstructors_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/EventConstructors/package.mo b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/package.mo new file mode 100644 index 0000000..753a19b --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package EventConstructors +end EventConstructors; diff --git a/libraries/modelica/CRML_test/Spec_doc/EventConstructors/package.order b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/package.order new file mode 100644 index 0000000..a709156 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/EventConstructors/package.order @@ -0,0 +1,3 @@ +EventConstructors +EventConstructors_externals +EventConstructors_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2.mo b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2.mo new file mode 100644 index 0000000..613d2fc --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2.mo @@ -0,0 +1,13 @@ +within CRML_test.Spec_doc.OperatorExample2; +partial model OperatorExample2 + Utilities.Boolean4Connector b1 + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.Boolean4Connector b2 + annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); + Utilities.Boolean4Connector b + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); +equation + b = CRML.Blocks.Logical4.or4(b1, b2); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end OperatorExample2; diff --git a/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2_externals.mo b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2_externals.mo new file mode 100644 index 0000000..44bb904 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2_externals.mo @@ -0,0 +1,18 @@ +within CRML_test.Spec_doc.OperatorExample2; +model OperatorExample2_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 OperatorExample2_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2_verif.mo b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2_verif.mo new file mode 100644 index 0000000..82111e5 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/OperatorExample2_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.OperatorExample2; +model OperatorExample2_verif + extends OperatorExample2; + OperatorExample2_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + b2 = externals.b2; + 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 OperatorExample2_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/package.mo b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/package.mo new file mode 100644 index 0000000..3ccd006 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package OperatorExample2 +end OperatorExample2; diff --git a/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/package.order b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/package.order new file mode 100644 index 0000000..5bf730c --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/OperatorExample2/package.order @@ -0,0 +1,3 @@ +OperatorExample2 +OperatorExample2_externals +OperatorExample2_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent.mo new file mode 100644 index 0000000..3343de0 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.PeriodClosingEvent; +partial model PeriodClosingEvent + CRML.ETL.Connectors.TimeLocatorOutput[N] P + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; +public + Utilities.BooleanConnector e + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.TimeLocators.Attributes.PeriodsEnd periodsStart + annotation (Placement(transformation(extent={{-6,-4},{2,4}}))); +equation + + connect(P, periodsStart.tl) annotation (Line(points={{-110,0},{-56,0},{-56,4}, + {-2,4}}, color={0,0,255})); + connect(periodsStart.y, e) + annotation (Line(points={{2.4,0},{110,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PeriodClosingEvent; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent_externals.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent_externals.mo new file mode 100644 index 0000000..c80867c --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent_externals.mo @@ -0,0 +1,39 @@ +within CRML_test.Spec_doc.PeriodClosingEvent; +model PeriodClosingEvent_externals + CRML.Blocks.Events.EventPeriodic eventPeriodic1(period=20, startTime=2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] P + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.Blocks.Events.EventPeriodic eventPeriodic2(period=20, startTime=3.5) + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + CRML.Blocks.Events.ShowEvent showEvent_e1 + annotation (Placement(transformation(extent={{-8,16},{0,24}}))); + CRML.Blocks.Events.ShowEvent showEvent_e2 + annotation (Placement(transformation(extent={{-8,-44},{0,-36}}))); + CRML.ETL.TimeLocators.Periods periods + annotation (Placement(transformation(extent={{40,20},{60,40}}))); +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{10,46},{18,54}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{10,-4},{18,4}}))); +equation + connect(showEvent_e1.u, eventPeriodic1.y) annotation (Line(points={{-8.4,20},{ + -24,20},{-24,50},{-39,50}}, color={217,67,180})); + connect(eventPeriodic2.y, showEvent_e2.u) annotation (Line(points={{-39,0},{-24, + 0},{-24,-40},{-8.4,-40}}, color={217,67,180})); + connect(P, periods.y) + annotation (Line(points={{110,0},{50,0},{50,20}}, color={0,0,255})); + connect(eventPeriodic1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{9.6,50}}, color={217,67,180})); + connect(eventPeriodic2.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,0},{9.6,0}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, periods.u2) annotation (Line(points={{18.4,0}, + {28,0},{28,22},{39,22}}, color={162,29,33})); + connect(booleanToBoolean4_1.y, periods.u1) annotation (Line(points={{18.4,50}, + {30,50},{30,30},{39,30}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PeriodClosingEvent_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent_verif.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent_verif.mo new file mode 100644 index 0000000..05f7826 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/PeriodClosingEvent_verif.mo @@ -0,0 +1,30 @@ +within CRML_test.Spec_doc.PeriodClosingEvent; +model PeriodClosingEvent_verif + extends PeriodClosingEvent; + PeriodClosingEvent_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + CRML.Blocks.Events.ShowEvent showEvent_e + annotation (Placement(transformation(extent={{140,-4},{148,4}}))); +equation + // Bindings + P =externals.P; + connect(showEvent_e.u, e) annotation (Line(points={{139.6,0},{126,0},{126,0}, + {110,0}}, color={217,67,180})); + annotation (Placement(transformation(extent={{0,-20},{60,40}})), + Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-200,-100},{160,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},{160,100}}, + initialScale=0.1)), + experiment(StopTime=14)); +end PeriodClosingEvent_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/package.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/package.mo new file mode 100644 index 0000000..63ac42b --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package PeriodClosingEvent +end PeriodClosingEvent; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/package.order b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/package.order new file mode 100644 index 0000000..09b164b --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodClosingEvent/package.order @@ -0,0 +1,3 @@ +PeriodClosingEvent +PeriodClosingEvent_externals +PeriodClosingEvent_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors.mo new file mode 100644 index 0000000..343f962 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors.mo @@ -0,0 +1,58 @@ +within CRML_test.Spec_doc.PeriodConstructors; +partial model PeriodConstructors + Utilities.Boolean4Connector e1 + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] P1 + annotation (Placement(transformation(extent={{100,40},{120,20}}))); + Utilities.Boolean4Connector e2 + annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); + CRML.ETL.TimeLocators.Periods periods1(leftBoundaryIncluded=true, + rightBoundaryIncluded=true) + annotation (Placement(transformation(extent={{-40,40},{-20,60}}))); + CRML.ETL.TimeLocators.Periods periods2(rightBoundaryIncluded=true, + leftBoundaryIncluded=false) + annotation (Placement(transformation(extent={{-20,0},{0,20}}))); + CRML.ETL.TimeLocators.Periods periods3(leftBoundaryIncluded=true, + rightBoundaryIncluded=false) + annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); + CRML.ETL.TimeLocators.Periods periods4(rightBoundaryIncluded=false, + leftBoundaryIncluded=false) + annotation (Placement(transformation(extent={{20,-80},{40,-60}}))); +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; +public + CRML.ETL.Connectors.TimeLocatorOutput[N] P2 + annotation (Placement(transformation(extent={{100,0},{120,-20}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] P3 + annotation (Placement(transformation(extent={{100,-40},{120,-60}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] P4 + annotation (Placement(transformation(extent={{100,-80},{120,-100}}))); +equation + + connect(periods2.u1, e1) annotation (Line(points={{-21,10},{-36,10},{-36,30},{ + -110,30}}, color={162,29,33})); + connect(periods1.u1, e1) annotation (Line(points={{-41,50},{-72,50},{-72,30},{ + -110,30}}, color={162,29,33})); + connect(periods1.u2, e2) annotation (Line(points={{-41,42},{-76,42},{-76,-30}, + {-110,-30}}, color={162,29,33})); + connect(periods2.u2, e2) annotation (Line(points={{-21,2},{-76,2},{-76,-30},{-110, + -30}}, color={162,29,33})); + connect(periods3.u1, e1) annotation (Line(points={{-1,-30},{-36,-30},{-36,30}, + {-110,30}}, color={162,29,33})); + connect(periods3.u2, e2) annotation (Line(points={{-1,-38},{-76,-38},{-76,-30}, + {-110,-30}}, color={162,29,33})); + connect(periods4.u1, e1) annotation (Line(points={{19,-70},{-36,-70},{-36,-30}, + {-36,-30},{-36,30},{-110,30}}, color={162,29,33})); + connect(periods4.u2, e2) annotation (Line(points={{19,-78},{-76,-78},{-76,-30}, + {-110,-30}}, color={162,29,33})); + connect(P1, periods1.y) + annotation (Line(points={{110,30},{-30,30},{-30,40}}, color={0,0,255})); + connect(P2, periods2.y) annotation (Line(points={{110,-10},{50,-10},{50,0},{ + -10,0}}, color={0,0,255})); + connect(periods3.y, P3) annotation (Line(points={{10,-40},{58,-40},{58,-50},{ + 110,-50}}, color={0,0,255})); + connect(periods4.y, P4) annotation (Line(points={{30,-80},{68,-80},{68,-90},{ + 110,-90}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PeriodConstructors; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors_externals.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors_externals.mo new file mode 100644 index 0000000..9c5dcce --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors_externals.mo @@ -0,0 +1,34 @@ +within CRML_test.Spec_doc.PeriodConstructors; +model PeriodConstructors_externals + CRML.Blocks.Events.EventPeriodic eventPeriodic1(period=20, startTime=2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + Utilities.Boolean4Connector e1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{16,46},{24,54}}))); + CRML.Blocks.Events.EventPeriodic eventPeriodic2(period=20, startTime=3.5) + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{16,-4},{24,4}}))); + Utilities.Boolean4Connector e2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.Blocks.Events.ShowEvent showEvent_e1 + annotation (Placement(transformation(extent={{-8,16},{0,24}}))); + CRML.Blocks.Events.ShowEvent showEvent_e2 + annotation (Placement(transformation(extent={{-8,-44},{0,-36}}))); +equation + connect(eventPeriodic1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{15.6,50}}, color={217,67,180})); + connect(booleanToBoolean4_1.y, e1) + annotation (Line(points={{24.4,50},{110,50}}, color={162,29,33})); + connect(eventPeriodic2.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,0},{15.6,0}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, e2) + annotation (Line(points={{24.4,0},{110,0}}, color={162,29,33})); + connect(showEvent_e1.u, eventPeriodic1.y) annotation (Line(points={{-8.4,20}, + {-24,20},{-24,50},{-39,50}}, color={217,67,180})); + connect(eventPeriodic2.y, showEvent_e2.u) annotation (Line(points={{-39,0},{ + -24,0},{-24,-40},{-8.4,-40}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PeriodConstructors_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors_verif.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors_verif.mo new file mode 100644 index 0000000..acfe396 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/PeriodConstructors_verif.mo @@ -0,0 +1,91 @@ +within CRML_test.Spec_doc.PeriodConstructors; +model PeriodConstructors_verif + extends PeriodConstructors; + PeriodConstructors_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + CRML.TimeLocators.Attributes.PeriodsStart periodsStart_P1 + annotation (Placement(transformation(extent={{144,20},{152,28}}))); + CRML.TimeLocators.Attributes.PeriodsEnd periodsEnd_P1 + annotation (Placement(transformation(extent={{144,2},{152,10}}))); + CRML.Blocks.Events.ShowEvent showEvent_P1_start + annotation (Placement(transformation(extent={{170,20},{178,28}}))); + CRML.Blocks.Events.ShowEvent showEvent_P1_end + annotation (Placement(transformation(extent={{170,2},{178,10}}))); + CRML.TimeLocators.Attributes.PeriodsStart periodsStart_P2 + annotation (Placement(transformation(extent={{144,-22},{152,-14}}))); + CRML.Blocks.Events.ShowEvent showEvent_P2_start + annotation (Placement(transformation(extent={{170,-22},{178,-14}}))); + CRML.TimeLocators.Attributes.PeriodsEnd periodsEnd_P2 + annotation (Placement(transformation(extent={{144,-40},{152,-32}}))); + CRML.Blocks.Events.ShowEvent showEvent_P2_end + annotation (Placement(transformation(extent={{170,-40},{178,-32}}))); + CRML.TimeLocators.Attributes.PeriodsStart periodsStart_P3 + annotation (Placement(transformation(extent={{144,-60},{152,-52}}))); + CRML.Blocks.Events.ShowEvent showEvent_P3_start + annotation (Placement(transformation(extent={{170,-60},{178,-52}}))); + CRML.TimeLocators.Attributes.PeriodsEnd periodsEnd_P3 + annotation (Placement(transformation(extent={{144,-78},{152,-70}}))); + CRML.Blocks.Events.ShowEvent showEvent_P3_end + annotation (Placement(transformation(extent={{170,-78},{178,-70}}))); + CRML.TimeLocators.Attributes.PeriodsStart periodsStart_P4 + annotation (Placement(transformation(extent={{144,-100},{152,-92}}))); + CRML.Blocks.Events.ShowEvent showEvent_P4_start + annotation (Placement(transformation(extent={{170,-100},{178,-92}}))); + CRML.TimeLocators.Attributes.PeriodsEnd periodsEnd_P4 + annotation (Placement(transformation(extent={{144,-118},{152,-110}}))); + CRML.Blocks.Events.ShowEvent showEvent_P4_end + annotation (Placement(transformation(extent={{170,-118},{178,-110}}))); +equation + // Bindings + e1 = externals.e1; + e2 = externals.e2; + connect(periodsStart_P1.y, showEvent_P1_start.u) + annotation (Line(points={{152.4,24},{169.6,24}}, color={217,67,180})); + connect(periodsEnd_P1.y, showEvent_P1_end.u) + annotation (Line(points={{152.4,6},{169.6,6}}, color={217,67,180})); + connect(P1, periodsStart_P1.tl) annotation (Line(points={{110,30},{130,30},{ + 130,28},{148,28}}, color={0,0,255})); + connect(P1, periodsEnd_P1.tl) annotation (Line(points={{110,30},{129,30},{129, + 10},{148,10}}, color={0,0,255})); + connect(periodsStart_P2.y, showEvent_P2_start.u) annotation (Line(points={{ + 152.4,-18},{162.2,-18},{162.2,-18},{169.6,-18}}, color={217,67,180})); + connect(periodsEnd_P2.y, showEvent_P2_end.u) + annotation (Line(points={{152.4,-36},{169.6,-36}}, color={217,67,180})); + connect(P2, periodsStart_P2.tl) annotation (Line(points={{110,-10},{130,-10}, + {130,-14},{148,-14}}, color={0,0,255})); + connect(P2, periodsEnd_P2.tl) annotation (Line(points={{110,-10},{130,-10},{ + 130,-32},{148,-32}}, color={0,0,255})); + connect(periodsStart_P3.y, showEvent_P3_start.u) + annotation (Line(points={{152.4,-56},{169.6,-56}}, color={217,67,180})); + connect(periodsEnd_P3.y, showEvent_P3_end.u) + annotation (Line(points={{152.4,-74},{169.6,-74}}, color={217,67,180})); + connect(periodsStart_P4.y, showEvent_P4_start.u) + annotation (Line(points={{152.4,-96},{169.6,-96}}, color={217,67,180})); + connect(periodsEnd_P4.y, showEvent_P4_end.u) + annotation (Line(points={{152.4,-114},{169.6,-114}}, color={217,67,180})); + connect(P3, periodsStart_P3.tl) annotation (Line(points={{110,-50},{130,-50}, + {130,-52},{148,-52}}, color={0,0,255})); + connect(P3, periodsEnd_P3.tl) annotation (Line(points={{110,-50},{130,-50},{ + 130,-70},{148,-70}}, color={0,0,255})); + connect(P4, periodsStart_P4.tl) annotation (Line(points={{110,-90},{130,-90}, + {130,-92},{148,-92}}, color={0,0,255})); + connect(P4, periodsEnd_P4.tl) annotation (Line(points={{110,-90},{130,-90},{ + 130,-110},{148,-110}}, color={0,0,255})); + annotation (Placement(transformation(extent={{0,-20},{60,40}})), + Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-200,-100},{160,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},{160,100}}, + initialScale=0.1)), + experiment(StopTime=14)); +end PeriodConstructors_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/package.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/package.mo new file mode 100644 index 0000000..2dc3084 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package PeriodConstructors +end PeriodConstructors; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/package.order b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/package.order new file mode 100644 index 0000000..975ff41 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodConstructors/package.order @@ -0,0 +1,3 @@ +PeriodConstructors +PeriodConstructors_externals +PeriodConstructors_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent.mo new file mode 100644 index 0000000..52b7266 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.PeriodOpeningEvent; +partial model PeriodOpeningEvent + CRML.ETL.Connectors.TimeLocatorOutput[N] P + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; +public + Utilities.BooleanConnector e + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.TimeLocators.Attributes.PeriodsStart periodsStart + annotation (Placement(transformation(extent={{-6,-4},{2,4}}))); +equation + + connect(P, periodsStart.tl) annotation (Line(points={{-110,0},{-56,0},{-56,4}, + {-2,4}}, color={0,0,255})); + connect(periodsStart.y, e) + annotation (Line(points={{2.4,0},{110,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PeriodOpeningEvent; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent_externals.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent_externals.mo new file mode 100644 index 0000000..278f458 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent_externals.mo @@ -0,0 +1,39 @@ +within CRML_test.Spec_doc.PeriodOpeningEvent; +model PeriodOpeningEvent_externals + CRML.Blocks.Events.EventPeriodic eventPeriodic1(period=20, startTime=2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.TimeLocatorOutput[N] P + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + CRML.Blocks.Events.EventPeriodic eventPeriodic2(period=20, startTime=3.5) + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + CRML.Blocks.Events.ShowEvent showEvent_e1 + annotation (Placement(transformation(extent={{-8,16},{0,24}}))); + CRML.Blocks.Events.ShowEvent showEvent_e2 + annotation (Placement(transformation(extent={{-8,-44},{0,-36}}))); + CRML.ETL.TimeLocators.Periods periods + annotation (Placement(transformation(extent={{40,20},{60,40}}))); +protected + parameter Integer N=CRML.ETL.Types.nMaxOverlap; +public + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{10,46},{18,54}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{10,-4},{18,4}}))); +equation + connect(showEvent_e1.u, eventPeriodic1.y) annotation (Line(points={{-8.4,20},{ + -24,20},{-24,50},{-39,50}}, color={217,67,180})); + connect(eventPeriodic2.y, showEvent_e2.u) annotation (Line(points={{-39,0},{-24, + 0},{-24,-40},{-8.4,-40}}, color={217,67,180})); + connect(P, periods.y) + annotation (Line(points={{110,0},{50,0},{50,20}}, color={0,0,255})); + connect(eventPeriodic1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{9.6,50}}, color={217,67,180})); + connect(eventPeriodic2.y, booleanToBoolean4_2.u) + annotation (Line(points={{-39,0},{9.6,0}}, color={217,67,180})); + connect(booleanToBoolean4_2.y, periods.u2) annotation (Line(points={{18.4,0}, + {28,0},{28,22},{39,22}}, color={162,29,33})); + connect(booleanToBoolean4_1.y, periods.u1) annotation (Line(points={{18.4,50}, + {30,50},{30,30},{39,30}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PeriodOpeningEvent_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent_verif.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent_verif.mo new file mode 100644 index 0000000..3129075 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/PeriodOpeningEvent_verif.mo @@ -0,0 +1,30 @@ +within CRML_test.Spec_doc.PeriodOpeningEvent; +model PeriodOpeningEvent_verif + extends PeriodOpeningEvent; + PeriodOpeningEvent_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + CRML.Blocks.Events.ShowEvent showEvent_e + annotation (Placement(transformation(extent={{140,-4},{148,4}}))); +equation + // Bindings + P =externals.P; + connect(showEvent_e.u, e) annotation (Line(points={{139.6,0},{126,0},{126,0}, + {110,0}}, color={217,67,180})); + annotation (Placement(transformation(extent={{0,-20},{60,40}})), + Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-200,-100},{160,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},{160,100}}, + initialScale=0.1)), + experiment(StopTime=14)); +end PeriodOpeningEvent_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/package.mo b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/package.mo new file mode 100644 index 0000000..81c27f3 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package PeriodOpeningEvent +end PeriodOpeningEvent; diff --git a/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/package.order b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/package.order new file mode 100644 index 0000000..68613f8 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/PeriodOpeningEvent/package.order @@ -0,0 +1,3 @@ +PeriodOpeningEvent +PeriodOpeningEvent_externals +PeriodOpeningEvent_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1.mo b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1.mo new file mode 100644 index 0000000..2beaac1 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1.mo @@ -0,0 +1,13 @@ +within CRML_test.Spec_doc.TemplateExample1; +partial model TemplateExample1 + 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 TemplateExample1; diff --git a/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1_externals.mo b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1_externals.mo new file mode 100644 index 0000000..285d337 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1_externals.mo @@ -0,0 +1,18 @@ +within CRML_test.Spec_doc.TemplateExample1; +model TemplateExample1_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 TemplateExample1_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1_verif.mo b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1_verif.mo new file mode 100644 index 0000000..ed6d122 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/TemplateExample1_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.TemplateExample1; +model TemplateExample1_verif + extends TemplateExample1; + TemplateExample1_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + b1 = externals.b1; + b2 = externals.b2; + 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 TemplateExample1_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/package.mo b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/package.mo new file mode 100644 index 0000000..65ae357 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package TemplateExample1 +end TemplateExample1; diff --git a/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/package.order b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/package.order new file mode 100644 index 0000000..ec476a0 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1/package.order @@ -0,0 +1,3 @@ +TemplateExample1 +TemplateExample1_externals +TemplateExample1_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/TemplateExample1_no_ext.mo b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/TemplateExample1_no_ext.mo new file mode 100644 index 0000000..13d82f8 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/TemplateExample1_no_ext.mo @@ -0,0 +1,47 @@ +within CRML_test.Spec_doc.TemplateExample1_no_ext; +model TemplateExample1_no_ext + import CRML.ETL.Types.Boolean4; + CRML.ETL.Types.Boolean4 b_true = Boolean4.true4; + CRML.ETL.Types.Boolean4 b_false = Boolean4.false4; + CRML.ETL.Types.Boolean4 b_undecided = Boolean4.undecided; + CRML.ETL.Types.Boolean4 b_undefined = Boolean4.undefined; + CRML.ETL.Types.Boolean4 b_true_or_true; + CRML.ETL.Types.Boolean4 b_true_or_false; + CRML.ETL.Types.Boolean4 b_true_or_undecided; + CRML.ETL.Types.Boolean4 b_true_or_undefined; + CRML.ETL.Types.Boolean4 b_false_or_true; + CRML.ETL.Types.Boolean4 b_false_or_false; + CRML.ETL.Types.Boolean4 b_false_or_undecided; + CRML.ETL.Types.Boolean4 b_false_or_undefined; + CRML.ETL.Types.Boolean4 b_undecided_or_true; + CRML.ETL.Types.Boolean4 b_undecided_or_false; + CRML.ETL.Types.Boolean4 b_undecided_or_undecided; + CRML.ETL.Types.Boolean4 b_undecided_or_undefined; + CRML.ETL.Types.Boolean4 b_undefined_or_true; + CRML.ETL.Types.Boolean4 b_undefined_or_false; + CRML.ETL.Types.Boolean4 b_undefined_or_undecided; + CRML.ETL.Types.Boolean4 b_undefined_or_undefined; +equation + b_true_or_true = CRML.Blocks.Logical4.or4(b_true, b_true); + b_true_or_false = CRML.Blocks.Logical4.or4(b_true, b_false); + b_true_or_undecided = CRML.Blocks.Logical4.or4(b_true, b_undecided); + b_true_or_undefined = CRML.Blocks.Logical4.or4(b_true, b_undefined); + + b_false_or_true = CRML.Blocks.Logical4.or4(b_false, b_true); + b_false_or_false = CRML.Blocks.Logical4.or4(b_false, b_false); + b_false_or_undecided = CRML.Blocks.Logical4.or4(b_false, b_undecided); + b_false_or_undefined = CRML.Blocks.Logical4.or4(b_false, b_undefined); + + b_undecided_or_true = CRML.Blocks.Logical4.or4(b_undecided, b_true); + b_undecided_or_false = CRML.Blocks.Logical4.or4(b_undecided, b_false); + b_undecided_or_undecided = CRML.Blocks.Logical4.or4(b_undecided, b_undecided); + b_undecided_or_undefined = CRML.Blocks.Logical4.or4(b_undecided, b_undefined); + + b_undefined_or_true = CRML.Blocks.Logical4.or4(b_undefined, b_true); + b_undefined_or_false = CRML.Blocks.Logical4.or4(b_undefined, b_false); + b_undefined_or_undecided = CRML.Blocks.Logical4.or4(b_undefined, b_undecided); + b_undefined_or_undefined = CRML.Blocks.Logical4.or4(b_undefined, b_undefined); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TemplateExample1_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/package.mo b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/package.mo new file mode 100644 index 0000000..5a374a0 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package TemplateExample1_no_ext +end TemplateExample1_no_ext; diff --git a/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/package.order b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/package.order new file mode 100644 index 0000000..607fab2 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/TemplateExample1_no_ext/package.order @@ -0,0 +1 @@ +TemplateExample1_no_ext diff --git a/libraries/modelica/CRML_test/Spec_doc/package.mo b/libraries/modelica/CRML_test/Spec_doc/package.mo new file mode 100644 index 0000000..e520434 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/package.mo @@ -0,0 +1,19 @@ +within CRML_test; +package Spec_doc +annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100,-100},{100,100}}, + radius=25.0), Text( + extent={{-42,38},{44,-30}}, + lineColor={0,0,0}, + fontName="Symbol", + textString=""), + Rectangle( + lineColor={128,128,128}, + fillPattern=FillPattern.None, + extent={{-100,-100},{100,100}}, + radius=25.0)})); +end Spec_doc; diff --git a/libraries/modelica/CRML_test/Spec_doc/package.order b/libraries/modelica/CRML_test/Spec_doc/package.order new file mode 100644 index 0000000..42621b0 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/package.order @@ -0,0 +1,21 @@ +BooleanAccumulation +BooleanAccumulation_no_ext +BooleanConjunction +BooleanConjunction_no_ext +BooleanNegation +BooleanNegation_no_ext +ClockConstructors +ClockConstructors_no_ext +ClockCurrentTick +ClockCurrentTick_no_ext +EventConstructors +OperatorExample2 +PeriodClosingEvent +PeriodConstructors +PeriodOpeningEvent +TemplateExample1 +TemplateExample1_no_ext +wip_BooleanAtEvent +wip_BooleanIntegration +wip_ClockFilter +wip_ClockRank diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_BooleanAtEvent.mo b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanAtEvent.mo new file mode 100644 index 0000000..3a1ef96 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanAtEvent.mo @@ -0,0 +1,96 @@ +within CRML_test.Spec_doc; +package wip_BooleanAtEvent + partial model BooleanAtEvent + Utilities.BooleanConnector b1 + annotation (Placement(transformation(extent={{-10,10},{10,-10}}, + rotation=-90, + origin={-110,30}))); + Utilities.ClockConnector c + annotation (Placement(transformation(extent={{-120,-20},{-100,-40}}))); + Utilities.BooleanConnector b_at_event + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Logical.BooleanClockedDelay booleanClockedDelay + annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-80,-34},{-72,-26}}))); + CRML.Blocks.MathInteger.IntegerConstant integerConstant(K=0) + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); + equation + connect(c, clockToBoolean.u) annotation (Line(points={{-110,-30},{-80.8,-30},{ + -80.8,-30}}, color={0,0,0})); + connect(booleanClockedDelay.u, b1) annotation (Line(points={{-9,0},{-60,0}, + {-60,30},{-110,30}}, color={217,67,180})); + connect(booleanClockedDelay.clock, clockToBoolean.y) annotation (Line( + points={{-9,8},{-40,8},{-40,-30},{-71.2,-30}}, color={217,67,180})); + connect(booleanClockedDelay.delay, integerConstant.y) annotation (Line( + points={{-9,-8},{-20,-8},{-20,-60},{-39,-60}}, color={255,127,0})); + connect(booleanClockedDelay.y, b_at_event) + annotation (Line(points={{13,0},{110,0}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); + end BooleanAtEvent; + + model BooleanAtEvent_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1( + startTime=2, + period=1.5, + width=1) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.Blocks.Logical.BooleanPulse boolean4Constant2(period=1.5, startTime= + 1) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + CRML.ETL.Connectors.BooleanOutput b1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.ETL.Connectors.ClockOutput c + annotation (Placement(transformation(extent={{100,-60},{120,-40}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{0,-70},{40,-30}}))); + CRML.Blocks.Events.ShowEvent showEvent_b + annotation (Placement(transformation(extent={{-16,-78},{-8,-70}}))); + CRML.Blocks.Events.ShowEvent showEvent_b1 + annotation (Placement(transformation(extent={{-18,26},{-10,34}}))); + equation + connect(boolean4Constant2.y, clockEvent.u) + annotation (Line(points={{-39,-50},{-2,-50}}, color={217,67,180})); + connect(clockEvent.y, c) annotation (Line( + points={{42,-50},{74,-50},{74,-50},{110,-50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(showEvent_b.u, clockEvent.u) annotation (Line(points={{-16.4,-74},{ + -20,-74},{-20,-50},{-2,-50}}, color={217,67,180})); + connect(boolean4Constant1.y, b1) + annotation (Line(points={{-39,50},{110,50}}, color={217,67,180})); + connect(showEvent_b1.u, b1) annotation (Line(points={{-18.4,30},{-20,30},{-20, + 50},{110,50}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); + end BooleanAtEvent_externals; + + model BooleanAtEvent_verif + extends BooleanAtEvent; + BooleanAtEvent_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); + equation + // Bindings + b1 = externals.b1; + c =externals.c; + 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 BooleanAtEvent_verif; +end wip_BooleanAtEvent; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration.mo b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration.mo new file mode 100644 index 0000000..3cc4da1 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration.mo @@ -0,0 +1,28 @@ +within CRML_test.Spec_doc.wip_BooleanIntegration; +partial model BooleanIntegration + Utilities.Boolean4Connector a + annotation (Placement(transformation(extent={{-120,40},{-100,20}}))); + Utilities.Boolean4Connector b_integration + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + Utilities.TimeLocatorConnector P + annotation (Placement(transformation(extent={{-10,120},{10,100}}))); +// protected +// parameter Integer N=CRML.ETL.Types.nMaxOverlap; +public + CRML.ETL.Evaluator.Integrate boolean4Integrator + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + CRML.Blocks.Logical4.Boolean4Constant boolean4Constant(K=CRML.ETL.Types.Boolean4.true4) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); +equation + b_integration = CRML.Blocks.Logical4.not4(a); + connect(boolean4Integrator.u, a) annotation (Line(points={{-11,0},{-60,0},{-60, + 30},{-110,30}}, color={162,29,33})); + connect(P, boolean4Integrator.tl) + annotation (Line(points={{0,110},{0,10}}, color={0,0,255})); + connect(boolean4Integrator.y, b_integration) annotation (Line(points={{11,0}, + {64,0},{64,0},{110,0}}, color={162,29,33})); + connect(boolean4Integrator.a, boolean4Constant.y) annotation (Line(points={{ + -11,8},{-26,8},{-26,50},{-39,50}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanIntegration; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration_externals.mo b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration_externals.mo new file mode 100644 index 0000000..3b51af3 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration_externals.mo @@ -0,0 +1,66 @@ +within CRML_test.Spec_doc.wip_BooleanIntegration; +model BooleanIntegration_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1 + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + Utilities.Boolean4Connector a + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_1 + annotation (Placement(transformation(extent={{12,46},{20,54}}))); + Utilities.TimeLocatorConnector P + annotation (Placement(transformation(extent={{100,-60},{120,-40}}))); + CRML.Blocks.Events.EventPeriodic eventPeriodic1(period=20, startTime=2) + annotation (Placement(transformation(extent={{-60,0},{-40,20}}))); + CRML.Blocks.Events.EventPeriodic eventPeriodic2(period=20, startTime=3.5) + annotation (Placement(transformation(extent={{-60,-50},{-40,-30}}))); + CRML.Blocks.Events.ShowEvent showEvent_e1 + annotation (Placement(transformation(extent={{-8,-24},{0,-16}}))); + CRML.Blocks.Events.ShowEvent showEvent_e2 + annotation (Placement(transformation(extent={{-8,-84},{0,-76}}))); + CRML.ETL.TimeLocators.Periods periods + annotation (Placement(transformation(extent={{40,-20},{60,0}}))); +public + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_2 + annotation (Placement(transformation(extent={{10,6},{18,14}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 booleanToBoolean4_3 + annotation (Placement(transformation(extent={{10,-44},{18,-36}}))); + inner CRML.TimeLocators.Continuous.Master master + annotation (Placement(transformation(extent={{40,70},{60,90}}))); + CRML.Blocks.Logical.BooleanPulse booleanPulse( + width=6, + period=20, + startTime=2) + annotation (Placement(transformation(extent={{-20,70},{0,90}}))); + CRML.Blocks.Logical4.BooleanToBoolean4 + booleanToBoolean4_7 + annotation (Placement(transformation(extent={{12,76},{20,84}}))); +equation + connect(boolean4Constant1.y, booleanToBoolean4_1.u) + annotation (Line(points={{-39,50},{11.6,50}}, color={217,67,180})); + connect(a, booleanToBoolean4_1.y) + annotation (Line(points={{110,50},{20.4,50}}, color={162,29,33})); + connect(showEvent_e1.u,eventPeriodic1. y) annotation (Line(points={{-8.4,-20}, + {-24,-20},{-24,10},{-39,10}}, + color={217,67,180})); + connect(eventPeriodic2.y,showEvent_e2. u) annotation (Line(points={{-39,-40}, + {-24,-40},{-24,-80},{-8.4,-80}}, + color={217,67,180})); + connect(eventPeriodic1.y,booleanToBoolean4_2. u) + annotation (Line(points={{-39,10},{9.6,10}}, color={217,67,180})); + connect(eventPeriodic2.y,booleanToBoolean4_3. u) + annotation (Line(points={{-39,-40},{9.6,-40}}, + color={217,67,180})); + connect(booleanToBoolean4_3.y,periods. u2) annotation (Line(points={{18.4,-40}, + {28,-40},{28,-18},{39,-18}}, + color={162,29,33})); + connect(booleanToBoolean4_2.y,periods. u1) annotation (Line(points={{18.4,10}, + {30,10},{30,-10},{39,-10}}, + color={162,29,33})); + connect(P, periods.y[1]) + annotation (Line(points={{110,-50},{50,-50},{50,-20}}, color={0,0,255})); + connect(booleanPulse.y, booleanToBoolean4_7.u) + annotation (Line(points={{1,80},{11.6,80}}, color={217,67,180})); + connect(master.u, booleanToBoolean4_7.y) + annotation (Line(points={{39,80},{20.4,80}}, color={162,29,33})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end BooleanIntegration_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration_verif.mo b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration_verif.mo new file mode 100644 index 0000000..c73386a --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/BooleanIntegration_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.wip_BooleanIntegration; +model BooleanIntegration_verif + extends BooleanIntegration; + BooleanIntegration_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings +// a =externals.a; + P =externals.P; + 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 BooleanIntegration_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/package.mo b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/package.mo new file mode 100644 index 0000000..a3cf849 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package wip_BooleanIntegration +end wip_BooleanIntegration; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/package.order b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/package.order new file mode 100644 index 0000000..d0f42be --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_BooleanIntegration/package.order @@ -0,0 +1,3 @@ +BooleanIntegration +BooleanIntegration_externals +BooleanIntegration_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter.mo b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter.mo new file mode 100644 index 0000000..0413f68 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter.mo @@ -0,0 +1,32 @@ +within CRML_test.Spec_doc.wip_ClockFilter; +partial model ClockFilter + Utilities.ClockConnector c1 + annotation (Placement(transformation(extent={{-120,60},{-100,40}}))); + Utilities.BooleanConnector c_filter + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean_c1 + annotation (Placement(transformation(extent={{-2,46},{6,54}}))); + CRML.Blocks.Events.EventFilter eventFilter + annotation (Placement(transformation(extent={{50,-10},{70,10}}))); + Utilities.ClockConnector c2 + annotation (Placement(transformation(extent={{-120,-40},{-100,-60}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean_c2 + annotation (Placement(transformation(extent={{-4,-54},{4,-46}}))); +equation + + connect(clockToBoolean_c1.u, c1) annotation (Line( + points={{-2.8,50},{-110,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(c2, clockToBoolean_c2.u) + annotation (Line(points={{-110,-50},{-4.8,-50}}, color={0,0,0})); + connect(eventFilter.y, c_filter) annotation (Line(points={{71,0},{90,0},{90,0}, + {110,0}}, color={217,67,180})); + connect(clockToBoolean_c1.y, eventFilter.u) annotation (Line(points={{6.8,50}, + {28,50},{28,0},{49,0}}, color={217,67,180})); + connect(clockToBoolean_c2.y, eventFilter.cond) annotation (Line(points={{4.8, + -50},{26,-50},{26,8},{49,8}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockFilter; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter_externals.mo b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter_externals.mo new file mode 100644 index 0000000..c9aa865 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter_externals.mo @@ -0,0 +1,34 @@ +within CRML_test.Spec_doc.wip_ClockFilter; +model ClockFilter_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1(period=20, startTime= + 2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.ClockOutput c1 + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{24,44},{36,56}}))); + CRML.Blocks.Logical.BooleanPulse boolean4Constant2( startTime= + 2, period=40) + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + CRML.Blocks.Events.ClockEvent clockEvent1 + annotation (Placement(transformation(extent={{24,-6},{36,6}}))); + CRML.ETL.Connectors.ClockOutput c2 + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +equation + connect(boolean4Constant1.y, clockEvent.u) + annotation (Line(points={{-39,50},{23.4,50}}, color={217,67,180})); + connect(c1, clockEvent.y) annotation (Line( + points={{110,50},{36.6,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(clockEvent1.u, boolean4Constant2.y) + annotation (Line(points={{23.4,0},{-39,0}}, color={217,67,180})); + connect(c2, clockEvent1.y) annotation (Line( + points={{110,0},{36.6,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockFilter_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter_verif.mo b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter_verif.mo new file mode 100644 index 0000000..6841ad1 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/ClockFilter_verif.mo @@ -0,0 +1,27 @@ +within CRML_test.Spec_doc.wip_ClockFilter; +model ClockFilter_verif + extends ClockFilter; + ClockFilter_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + c1 =externals.c1; + c2 =externals.c2; + 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 ClockFilter_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/package.mo b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/package.mo new file mode 100644 index 0000000..7af6078 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package wip_ClockFilter +end wip_ClockFilter; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/package.order b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/package.order new file mode 100644 index 0000000..eb6e7e3 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockFilter/package.order @@ -0,0 +1,3 @@ +ClockFilter +ClockFilter_externals +ClockFilter_verif diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank.mo b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank.mo new file mode 100644 index 0000000..e28f220 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank.mo @@ -0,0 +1,28 @@ +within CRML_test.Spec_doc.wip_ClockRank; +partial model ClockRank + Utilities.ClockConnector c1 + annotation (Placement(transformation(extent={{-120,10},{-100,-10}}))); + Utilities.IntegerConnector r + annotation (Placement(transformation(extent={{100,10},{120,-10}}))); + CRML.Blocks.Events.ClockToBoolean clockToBoolean + annotation (Placement(transformation(extent={{-54,-4},{-46,4}}))); + CRML.Blocks.Events.EventCounter eventCounter + annotation (Placement(transformation(extent={{20,-10},{40,10}}))); + CRML.Blocks.Logical.BooleanConstant booleanConstant(K=false) + annotation (Placement(transformation(extent={{-20,-40},{0,-20}}))); +equation + + connect(eventCounter.y, r) annotation (Line(points={{41,0},{74,0},{74,0},{110, + 0}}, color={255,127,0})); + connect(clockToBoolean.y, eventCounter.u) + annotation (Line(points={{-45.2,0},{19,0}}, color={217,67,180})); + connect(clockToBoolean.u, c1) annotation (Line( + points={{-54.8,0},{-110,0}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + connect(booleanConstant.y, eventCounter.reset) + annotation (Line(points={{1,-30},{30,-30},{30,-11}}, color={217,67,180})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockRank; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank_externals.mo b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank_externals.mo new file mode 100644 index 0000000..4f94ede --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank_externals.mo @@ -0,0 +1,20 @@ +within CRML_test.Spec_doc.wip_ClockRank; +model ClockRank_externals + CRML.Blocks.Logical.BooleanPulse boolean4Constant1(period=20, startTime= + 2) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + CRML.ETL.Connectors.ClockOutput c + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + CRML.Blocks.Events.ClockEvent clockEvent + annotation (Placement(transformation(extent={{24,44},{36,56}}))); +equation + connect(boolean4Constant1.y, clockEvent.u) + annotation (Line(points={{-39,50},{23.4,50}}, color={217,67,180})); + connect(c, clockEvent.y) annotation (Line( + points={{110,50},{36.6,50}}, + color={175,175,175}, + pattern=LinePattern.Dot, + thickness=0.5)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ClockRank_externals; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank_verif.mo b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank_verif.mo new file mode 100644 index 0000000..f0c6b3d --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/ClockRank_verif.mo @@ -0,0 +1,26 @@ +within CRML_test.Spec_doc.wip_ClockRank; +model ClockRank_verif + extends ClockRank; + ClockRank_externals externals + annotation (Placement(transformation(extent={{-200,0},{-140,60}}))); +equation + // Bindings + c1 = externals.c; + 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 ClockRank_verif; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/package.mo b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/package.mo new file mode 100644 index 0000000..48cef2e --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/package.mo @@ -0,0 +1,3 @@ +within CRML_test.Spec_doc; +package wip_ClockRank +end wip_ClockRank; diff --git a/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/package.order b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/package.order new file mode 100644 index 0000000..1647ac1 --- /dev/null +++ b/libraries/modelica/CRML_test/Spec_doc/wip_ClockRank/package.order @@ -0,0 +1,3 @@ +ClockRank +ClockRank_externals +ClockRank_verif diff --git a/libraries/modelica/CRML_test/Utilities/Boolean4Connector.mo b/libraries/modelica/CRML_test/Utilities/Boolean4Connector.mo new file mode 100644 index 0000000..1f71c74 --- /dev/null +++ b/libraries/modelica/CRML_test/Utilities/Boolean4Connector.mo @@ -0,0 +1,15 @@ +within CRML_test.Utilities; +connector Boolean4Connector = + CRML.ETL.Types.Boolean4 + "'Boolean4' as acausal connector" annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}), graphics={Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={162,29,33}, + fillPattern=FillPattern.Forward)}), Diagram(graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={162,29,33}, + fillPattern=FillPattern.Forward)})); diff --git a/libraries/modelica/CRML_test/Utilities/BooleanConnector.mo b/libraries/modelica/CRML_test/Utilities/BooleanConnector.mo new file mode 100644 index 0000000..223764e --- /dev/null +++ b/libraries/modelica/CRML_test/Utilities/BooleanConnector.mo @@ -0,0 +1,14 @@ +within CRML_test.Utilities; +connector BooleanConnector=Boolean + "'Boolean' as acausal connector" annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}), graphics={Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={217,67,180}, + fillPattern=FillPattern.Forward)}), Diagram(graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={217,67,180}, + fillPattern=FillPattern.Forward)})); diff --git a/libraries/modelica/CRML_test/Utilities/ClockConnector.mo b/libraries/modelica/CRML_test/Utilities/ClockConnector.mo new file mode 100644 index 0000000..3f7e0b7 --- /dev/null +++ b/libraries/modelica/CRML_test/Utilities/ClockConnector.mo @@ -0,0 +1,14 @@ +within CRML_test.Utilities; +connector ClockConnector = Clock + "'Clock' as acausal connector" annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}), graphics={Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={0,140,72}, + fillPattern=FillPattern.Forward)}), Diagram(graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={0,140,72}, + fillPattern=FillPattern.Forward)})); diff --git a/libraries/modelica/CRML_test/Utilities/IntegerConnector.mo b/libraries/modelica/CRML_test/Utilities/IntegerConnector.mo new file mode 100644 index 0000000..73765b8 --- /dev/null +++ b/libraries/modelica/CRML_test/Utilities/IntegerConnector.mo @@ -0,0 +1,14 @@ +within CRML_test.Utilities; +connector IntegerConnector=Integer + "'Integer' as acausal connector" annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}), graphics={Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={244,125,35}, + fillPattern=FillPattern.Forward)}), Diagram(graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={244,125,35}, + fillPattern=FillPattern.Forward)})); diff --git a/libraries/modelica/CRML_test/Utilities/TimeLocatorConnector.mo b/libraries/modelica/CRML_test/Utilities/TimeLocatorConnector.mo new file mode 100644 index 0000000..ad41894 --- /dev/null +++ b/libraries/modelica/CRML_test/Utilities/TimeLocatorConnector.mo @@ -0,0 +1,15 @@ +within CRML_test.Utilities; +connector TimeLocatorConnector = + CRML.ETL.Types.TimeLocator + "'Time locator' as acausal connector" annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}), graphics={Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={28,108,200}, + fillPattern=FillPattern.Forward)}), Diagram(graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={28,108,200}, + fillPattern=FillPattern.Forward)})); diff --git a/libraries/modelica/CRML_test/Utilities/package.mo b/libraries/modelica/CRML_test/Utilities/package.mo new file mode 100644 index 0000000..94bd1aa --- /dev/null +++ b/libraries/modelica/CRML_test/Utilities/package.mo @@ -0,0 +1,29 @@ +within CRML_test; +package Utilities + +annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100,-100},{100,100}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + fillPattern=FillPattern.None, + extent={{-100,-100},{100,100}}, + radius=25.0), + Polygon( + origin={1.3835,-4.1418}, + rotation=45.0, + fillColor={64,64,64}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-15.0,93.333},{-15.0,68.333},{0.0,58.333},{15.0,68.333},{15.0,93.333},{20.0,93.333},{25.0,83.333},{25.0,58.333},{10.0,43.333},{10.0,-41.667},{25.0,-56.667},{25.0,-76.667},{10.0,-91.667},{0.0,-91.667},{0.0,-81.667},{5.0,-81.667},{15.0,-71.667},{15.0,-61.667},{5.0,-51.667},{-5.0,-51.667},{-15.0,-61.667},{-15.0,-71.667},{-5.0,-81.667},{0.0,-81.667},{0.0,-91.667},{-10.0,-91.667},{-25.0,-76.667},{-25.0,-56.667},{-10.0,-41.667},{-10.0,43.333},{-25.0,58.333},{-25.0,83.333},{-20.0,93.333}}), + Polygon( + origin={10.1018,5.218}, + rotation=-45.0, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + points={{-15.0,87.273},{15.0,87.273},{20.0,82.273},{20.0,27.273},{10.0,17.273},{10.0,7.273},{20.0,2.273},{20.0,-2.727},{5.0,-2.727},{5.0,-77.727},{10.0,-87.727},{5.0,-112.727},{-5.0,-112.727},{-10.0,-87.727},{-5.0,-77.727},{-5.0,-2.727},{-20.0,-2.727},{-20.0,2.273},{-10.0,7.273},{-10.0,17.273},{-20.0,27.273},{-20.0,82.273}})})); +end Utilities; diff --git a/libraries/modelica/CRML_test/Utilities/package.order b/libraries/modelica/CRML_test/Utilities/package.order new file mode 100644 index 0000000..fab8880 --- /dev/null +++ b/libraries/modelica/CRML_test/Utilities/package.order @@ -0,0 +1,5 @@ +Boolean4Connector +BooleanConnector +ClockConnector +IntegerConnector +TimeLocatorConnector diff --git a/libraries/modelica/CRML_test/package.mo b/libraries/modelica/CRML_test/package.mo new file mode 100644 index 0000000..31a6a9b --- /dev/null +++ b/libraries/modelica/CRML_test/package.mo @@ -0,0 +1,18 @@ +package CRML_test +annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100,-100},{100,100}}, + radius=25.0), Text( + extent={{-42,38},{44,-30}}, + lineColor={0,0,0}, + fontName="Symbol", + textString=""), + Rectangle( + lineColor={128,128,128}, + fillPattern=FillPattern.None, + extent={{-100,-100},{100,100}}, + radius=25.0)}), uses(Modelica(version="4.0.0"))); +end CRML_test; diff --git a/libraries/modelica/CRML_test/package.order b/libraries/modelica/CRML_test/package.order new file mode 100644 index 0000000..b3f309d --- /dev/null +++ b/libraries/modelica/CRML_test/package.order @@ -0,0 +1,5 @@ +ETL +FORML +Spec_doc +Utilities +Examples