Skip to content

Commit

Permalink
Use mustBeConnected annotation (introduced in Modelica 3.6) for all c…
Browse files Browse the repository at this point in the history
…onditional support connectors.
  • Loading branch information
HansOlsson committed Oct 17, 2023
1 parent 07a1839 commit 017cb92
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 10 deletions.
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 enabled");
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 enabled");
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 enabled");

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 enabled");
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 enabled");
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 enabled");
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 enabled");
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 enabled");
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 enabled");
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 enabled");
protected
Support internalSupport
"Internal support/housing of component (either connected to support, if useSupport=true, or connected to fixed, if useSupport=false)"
Expand Down

0 comments on commit 017cb92

Please sign in to comment.