Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mustBeConnected annotation (introduced in Modelica 3.6) #4204

Merged
merged 8 commits into from
Jan 12, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ partial model PartialElementaryOneFlangeAndSupport2
extent={{90,-10},{110,10}})));
Support support(phi=phi_support, tau=-flange.tau) if useSupport
"Support/housing of component"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})),
mustBeConnected="An enabled support connector should be connected");
protected
SI.Angle phi_support "Absolute angle of support flange";
equation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ partial model PartialElementaryRotationalToTranslational
extent={{90,10},{110,-10}})));
Rotational.Interfaces.Support supportR if useSupportR
"Rotational support/housing of component" annotation (Placement(
transformation(extent={{-110,-110},{-90,-90}})));
transformation(extent={{-110,-110},{-90,-90}})),
mustBeConnected="An enabled support connector should be connected");
Translational.Interfaces.Support supportT if useSupportT
"Translational support/housing of component"
annotation (Placement(transformation(extent={{110,-110},{90,-90}})));
annotation (Placement(transformation(extent={{110,-110},{90,-90}})),
mustBeConnected="An enabled support connector should be connected");

protected
Rotational.Interfaces.InternalSupport internalSupportR(tau=-flangeR.tau)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ partial model PartialElementaryTwoFlangesAndSupport2
transformation(extent={{90,-10},{110,10}})));
Support support(phi=phi_support, tau=-flange_a.tau - flange_b.tau) if
useSupport "Support/housing of component"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})),
mustBeConnected="An enabled support connector should be connected");
protected
SI.Angle phi_support "Absolute angle of support flange";
equation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ partial model PartialOneFlangeAndSupport
Flange_b flange "Flange of shaft" annotation (Placement(transformation(
extent={{90,-10},{110,10}})));
Support support if useSupport "Support/housing of component"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})),
mustBeConnected="An enabled support connector should be connected");
protected
Support internalSupport
"Internal support/housing of component (either connected to support, if useSupport=true, or connected to fixed, if useSupport=false)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ partial model PartialTwoFlangesAndSupport
Flange_b flange_b "Flange of right shaft" annotation (Placement(
transformation(extent={{90,-10},{110,10}})));
Support support if useSupport "Support/housing of component"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})),
mustBeConnected="An enabled support connector should be connected");
protected
Support internalSupport
"Internal support/housing of component (either connected to support, if useSupport=true, or connected to fixed, if useSupport=false)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ partial model PartialElementaryOneFlangeAndSupport2
transformation(extent={{90,-10},{110,10}})));
Support support(s=s_support, f=-flange.f) if useSupport
"Support/housing of component"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})),
mustBeConnected="An enabled support connector should be connected");
protected
SI.Length s_support "Absolute position of support flange";
equation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ partial model PartialElementaryTwoFlangesAndSupport2
extends Translational.Interfaces.PartialTwoFlanges;
Support support(s=s_support, f=-flange_a.f - flange_b.f) if useSupport
"Support/housing of component"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})),
mustBeConnected="An enabled support connector should be connected");
SI.Length s_a "Distance between left flange and support";
SI.Length s_b "Distance between right flange and support";
protected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ partial model PartialOneFlangeAndSupport
Flange_b flange "Flange of component" annotation (Placement(
transformation(extent={{90,-10},{110,10}})));
Support support if useSupport "Support/housing of component"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})),
mustBeConnected="An enabled support connector should be connected");
protected
Support internalSupport
"Internal support/housing of component (either connected to support, if useSupport=true, or connected to fixed, if useSupport=false)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ partial model PartialTwoFlangesAndSupport
choices(checkBox=true));
extends Translational.Interfaces.PartialTwoFlanges;
Support support if useSupport "Support/housing of component"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})),
mustBeConnected="An enabled support connector should be connected");
protected
Support internalSupport
"Internal support/housing of component (either connected to support, if useSupport=true, or connected to fixed, if useSupport=false)"
Expand Down