Skip to content

Commit c7b6cda

Browse files
committed
Make use of inheritance for the connectors.
1 parent d55ec26 commit c7b6cda

2 files changed

Lines changed: 9 additions & 30 deletions

File tree

OpenIPSL/Interfaces/PwPin_n.mo

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
within OpenIPSL.Interfaces;
22
connector PwPin_n
3-
"Connector for electrical blocks treating voltage and current as complex variables"
4-
Types.PerUnit vr "Real part of the voltage";
5-
Types.PerUnit vi "Imaginary part of the voltage";
6-
flow Types.PerUnit ir(start=Modelica.Constants.eps) "Real part of the current";
7-
flow Types.PerUnit ii(start=Modelica.Constants.eps) "Imaginary part of the current";
8-
annotation (
3+
"Negative connector for electrical blocks treating voltage and current as complex variables"
4+
extends PwPin;
5+
6+
annotation (defaultComponentName="n",
97
Icon(graphics={Rectangle(
108
extent={{-100,100},{100,-100}},
119
lineColor={0,0,255},
1210
fillColor={255,255,255},
1311
fillPattern=FillPattern.Solid)}),
14-
Diagram(graphics={Text(
15-
extent={{-100,160},{100,120}},
16-
lineColor={0,0,255},
17-
textString="%name"),Rectangle(
12+
Diagram(graphics={Rectangle(
1813
extent={{-100,100},{100,-100}},
1914
lineColor={0,0,255},
20-
fillColor={0,0,255},
15+
fillColor={255,255,255},
2116
fillPattern=FillPattern.Solid)}));
2217
end PwPin_n;

OpenIPSL/Interfaces/PwPin_p.mo

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
within OpenIPSL.Interfaces;
22
connector PwPin_p
3-
"Connector for electrical blocks treating voltage and current as complex variables"
4-
Types.PerUnit vr "Real part of the voltage";
5-
Types.PerUnit vi "Imaginary part of the voltage";
6-
flow Types.PerUnit ir(start=Modelica.Constants.eps) "Real part of the current";
7-
flow Types.PerUnit ii(start=Modelica.Constants.eps) "Imaginary part of the current";
8-
annotation (
9-
Icon(graphics={Rectangle(
10-
extent={{-100,100},{100,-100}},
11-
lineColor={0,0,255},
12-
fillColor={0,0,255},
13-
fillPattern=FillPattern.Solid)}),
14-
Diagram(graphics={Text(
15-
extent={{-100,160},{100,120}},
16-
lineColor={0,0,255},
17-
textString="%name"),Rectangle(
18-
extent={{-100,100},{100,-100}},
19-
lineColor={0,0,255},
20-
fillColor={0,0,255},
21-
fillPattern=FillPattern.Solid)}));
3+
"Positive connector for electrical blocks treating voltage and current as complex variables"
4+
extends PwPin;
5+
annotation (defaultComponentName="p");
226
end PwPin_p;

0 commit comments

Comments
 (0)