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 self
._Transformer
._Windings
.append(self
)
82 Transformer
= property(getTransformer
, setTransformer
)
84 def getWindingInfo(self
):
85 """Data for this winding.
87 return self
._WindingInfo
89 def setWindingInfo(self
, value
):
90 if self
._WindingInfo
is not None:
91 filtered
= [x
for x
in self
.WindingInfo
.Windings
if x
!= self
]
92 self
._WindingInfo
._Windings
= filtered
94 self
._WindingInfo
= value
95 if self
._WindingInfo
is not None:
96 self
._WindingInfo
._Windings
.append(self
)
98 WindingInfo
= property(getWindingInfo
, setWindingInfo
)
100 def getRatioTapChanger(self
):
101 """Ratio tap changer associated with this winding.
103 return self
._RatioTapChanger
105 def setRatioTapChanger(self
, value
):
106 if self
._RatioTapChanger
is not None:
107 self
._RatioTapChanger
._Winding
= None
109 self
._RatioTapChanger
= value
110 if self
._RatioTapChanger
is not None:
111 self
._RatioTapChanger
._Winding
= self
113 RatioTapChanger
= property(getRatioTapChanger
, setRatioTapChanger
)
115 def getPiImpedance(self
):
116 """(accurate for 2- or 3-winding transformers only) Pi-model impedances of this winding.
118 return self
._PiImpedance
120 def setPiImpedance(self
, value
):
121 if self
._PiImpedance
is not None:
122 filtered
= [x
for x
in self
.PiImpedance
.Windings
if x
!= self
]
123 self
._PiImpedance
._Windings
= filtered
125 self
._PiImpedance
= value
126 if self
._PiImpedance
is not None:
127 self
._PiImpedance
._Windings
.append(self
)
129 PiImpedance
= property(getPiImpedance
, setPiImpedance
)
131 def getPhaseTapChanger(self
):
132 """Phase tap changer associated with this winding.
134 return self
._PhaseTapChanger
136 def setPhaseTapChanger(self
, value
):
137 if self
._PhaseTapChanger
is not None:
138 self
._PhaseTapChanger
._Winding
= None
140 self
._PhaseTapChanger
= value
141 if self
._PhaseTapChanger
is not None:
142 self
._PhaseTapChanger
._Winding
= self
144 PhaseTapChanger
= property(getPhaseTapChanger
, setPhaseTapChanger
)