forked from modelica/ModelicaStandardLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PartialTwoFlangesAndSupport.mo
65 lines (64 loc) · 2.93 KB
/
PartialTwoFlangesAndSupport.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
within Modelica.Mechanics.Rotational.Interfaces;
partial model PartialTwoFlangesAndSupport
"Partial model for a component with two rotational 1-dim. shaft flanges and a support used for graphical modeling, i.e., the model is build up by drag-and-drop from elementary components"
parameter Boolean useSupport=false
"= true, if support flange enabled, otherwise implicitly grounded"
annotation (
Evaluate=true,
HideResult=true,
choices(checkBox=true));
Flange_a flange_a "Flange of left shaft" annotation (Placement(
transformation(extent={{-110,-10},{-90,10}})));
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}})),
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)"
annotation (Placement(transformation(extent={{-3,-83},{3,-77}})));
Components.Fixed fixed if not useSupport
"Fixed support/housing, if not useSupport"
annotation (Placement(transformation(extent={{10,-94},{30,-74}})));
equation
connect(support, internalSupport) annotation (Line(
points={{0,-100},{0,-80}}));
connect(internalSupport, fixed.flange) annotation (Line(
points={{0,-80},{20,-80},{20,-84}}));
annotation (
Documentation(info="<html>
<p>
This is a 1-dim. rotational component with two flanges and a support/housing.
It is used e.g., to build up parts of a drive train graphically consisting
of several components.
</p>
<p>
If <em>useSupport=true</em>, the support connector is conditionally enabled
and needs to be connected.<br>
If <em>useSupport=false</em>, the support connector is conditionally disabled
and instead the component is internally fixed to ground.
</p>
</html>"),
Diagram(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}}), graphics={Text(
extent={{-38,-98},{-6,-96}},
textColor={95,95,95},
textString="(if useSupport)"),Text(
extent={{24,-97},{64,-98}},
textColor={95,95,95},
textString="(if not useSupport)")}),
Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{
100,100}}), graphics={Line(
visible=not useSupport,
points={{-50,-120},{-30,-100}}),Line(
visible=not useSupport,
points={{-30,-120},{-10,-100}}),Line(
visible=not useSupport,
points={{-10,-120},{10,-100}}),Line(
visible=not useSupport,
points={{10,-120},{30,-100}}),Line(
visible=not useSupport,
points={{-30,-100},{30,-100}})}));
end PartialTwoFlangesAndSupport;