Skip to content

Commit d55ec26

Browse files
committed
Add n and p variant of the PwPin
Before this commit, pins at two ends of several components, such as transmission lines, had the same visual aspect. But they are different in meaning, since voltages and currents at them assume different values. Therefore, much better is to visually differentiate the two pins, in compliance with what is done in the whole Modelica Standard Library (MSL). With this commit, the positive pin is blue-filled while the negative is white filled, again in compliance with the general approach of MSL.
1 parent cab86e5 commit d55ec26

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

OpenIPSL/Interfaces/PwPin_n.mo

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
within OpenIPSL.Interfaces;
2+
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 (
9+
Icon(graphics={Rectangle(
10+
extent={{-100,100},{100,-100}},
11+
lineColor={0,0,255},
12+
fillColor={255,255,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)}));
22+
end PwPin_n;

OpenIPSL/Interfaces/PwPin_p.mo

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
within OpenIPSL.Interfaces;
2+
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)}));
22+
end PwPin_p;

OpenIPSL/Interfaces/package.order

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
PwPin
2+
PwPin_p
3+
PwPin_n
24
Generator

0 commit comments

Comments
 (0)