1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14
.IEC61970
.Core
.ConductingEquipment
import ConductingEquipment
19 class DistributionTransformerWinding(ConductingEquipment
):
20 """Conducting connection point of a distribution / unbalanced transformer winding instance. This class differs from Wires::TransformerWinding as follows: - the eight Pi model attributes are moved into separate class, that can be optionally referred to from several winding instances. - the three grounding attributes can differ per winding instance, even for windings that use the same TransformerInfo, so they are kept on DistributionTransformerWinding. - 'windingType' attribute is replaced by 'sequenceNumber' attribute on WindingInfo class. - all the other attributes come from the WindingInfo (and its relationships). TransformerInfo is associated to the DistributionTransformer as referenceable data, so it can be defined once and referred to from instances, instead of being specified with each instance.
23 def __init__(self
, grounded
=False, xground
=0.0, rground
=0.0, Transformer
=None, WindingInfo
=None, RatioTapChanger
=None, PiImpedance
=None, PhaseTapChanger
=None, *args
, **kw_args
):
24 """Initialises a new 'DistributionTransformerWinding' instance.
26 @param grounded: (for Yn and Zn connections) True if the neutral is solidly grounded.
27 @param xground: (for Yn and Zn connections) Reactive part of neutral impedance where 'grounded' is true.
28 @param rground: (for Yn and Zn connections) Resistance part of neutral impedance where 'grounded' is true.
29 @param Transformer: Transformer this winding belongs to.
30 @param WindingInfo: Data for this winding.
31 @param RatioTapChanger: Ratio tap changer associated with this winding.
32 @param PiImpedance: (accurate for 2- or 3-winding transformers only) Pi-model impedances of this winding.
33 @param PhaseTapChanger: Phase tap changer associated with this winding.
35 #: (for Yn and Zn connections) True if the neutral is solidly grounded.
36 self
.grounded
= grounded
38 #: (for Yn and Zn connections) Reactive part of neutral impedance where 'grounded' is true.
39 self
.xground
= xground
41 #: (for Yn and Zn connections) Resistance part of neutral impedance where 'grounded' is true.
42 self
.rground
= rground
44 self
._Transformer
= None
45 self
.Transformer
= Transformer
47 self
._WindingInfo
= None
48 self
.WindingInfo
= WindingInfo
50 self
._RatioTapChanger
= None
51 self
.RatioTapChanger
= RatioTapChanger
53 self
._PiImpedance
= None
54 self
.PiImpedance
= PiImpedance
56 self
._PhaseTapChanger
= None
57 self
.PhaseTapChanger
= PhaseTapChanger
59 super(DistributionTransformerWinding
, self
).__init
__(*args
, **kw_args
)
61 _attrs
= ["grounded", "xground", "rground"]
62 _attr_types
= {"grounded": bool, "xground": float, "rground": float}
63 _defaults
= {"grounded": False, "xground": 0.0, "rground": 0.0}
65 _refs
= ["Transformer", "WindingInfo", "RatioTapChanger", "PiImpedance", "PhaseTapChanger"]
68 def getTransformer(self
):
69 """Transformer this winding belongs to.
71 return self
._Transformer
73 def setTransformer(self
, value
):
74 if self
._Transformer
is not None:
75 filtered
= [x
for x
in self
.Transformer
.Windings
if x
!= self
]
76 self
._Transformer
._Windings
= filtered
78 self
._Transformer
= value
79 if self
._Transformer
is not None:
80 if self
not in self
._Transformer
._Windings
:
81 self
._Transformer
._Windings
.append(self
)
83 Transformer
= property(getTransformer
, setTransformer
)
85 def getWindingInfo(self
):
86 """Data for this winding.
88 return self
._WindingInfo
90 def setWindingInfo(self
, value
):
91 if self
._WindingInfo
is not None:
92 filtered
= [x
for x
in self
.WindingInfo
.Windings
if x
!= self
]
93 self
._WindingInfo
._Windings
= filtered
95 self
._WindingInfo
= value
96 if self
._WindingInfo
is not None:
97 if self
not in self
._WindingInfo
._Windings
:
98 self
._WindingInfo
._Windings
.append(self
)
100 WindingInfo
= property(getWindingInfo
, setWindingInfo
)
102 def getRatioTapChanger(self
):
103 """Ratio tap changer associated with this winding.
105 return self
._RatioTapChanger
107 def setRatioTapChanger(self
, value
):
108 if self
._RatioTapChanger
is not None:
109 self
._RatioTapChanger
._Winding
= None
111 self
._RatioTapChanger
= value
112 if self
._RatioTapChanger
is not None:
113 self
._RatioTapChanger
.Winding
= None
114 self
._RatioTapChanger
._Winding
= self
116 RatioTapChanger
= property(getRatioTapChanger
, setRatioTapChanger
)
118 def getPiImpedance(self
):
119 """(accurate for 2- or 3-winding transformers only) Pi-model impedances of this winding.
121 return self
._PiImpedance
123 def setPiImpedance(self
, value
):
124 if self
._PiImpedance
is not None:
125 filtered
= [x
for x
in self
.PiImpedance
.Windings
if x
!= self
]
126 self
._PiImpedance
._Windings
= filtered
128 self
._PiImpedance
= value
129 if self
._PiImpedance
is not None:
130 if self
not in self
._PiImpedance
._Windings
:
131 self
._PiImpedance
._Windings
.append(self
)
133 PiImpedance
= property(getPiImpedance
, setPiImpedance
)
135 def getPhaseTapChanger(self
):
136 """Phase tap changer associated with this winding.
138 return self
._PhaseTapChanger
140 def setPhaseTapChanger(self
, value
):
141 if self
._PhaseTapChanger
is not None:
142 self
._PhaseTapChanger
._Winding
= None
144 self
._PhaseTapChanger
= value
145 if self
._PhaseTapChanger
is not None:
146 self
._PhaseTapChanger
.Winding
= None
147 self
._PhaseTapChanger
._Winding
= self
149 PhaseTapChanger
= property(getPhaseTapChanger
, setPhaseTapChanger
)