Update README.rst
[PyCIM.git] / CIM14 / IEC61970 / Wires / TransformerWinding.py
blobed41b0f0d63024a710b140025d674fd00bfcb4d5
1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 # IN THE SOFTWARE.
21 from CIM14.IEC61970.Core.ConductingEquipment import ConductingEquipment
23 class TransformerWinding(ConductingEquipment):
24 """A winding is associated with each defined terminal of a transformer (or phase shifter).
25 """
27 def __init__(self, connectionType="Yn", windingType="primary", x=0.0, grounded=False, g=0.0, r=0.0, x0=0.0, ratedU=0.0, ratedS=0.0, emergencyS=0.0, rground=0.0, shortTermS=0.0, r0=0.0, g0=0.0, insulationU=0.0, b=0.0, b0=0.0, xground=0.0, From_WindingTest=None, To_WindingTest=None, RatioTapChanger=None, PowerTransformer=None, PhaseTapChanger=None, *args, **kw_args):
28 """Initialises a new 'TransformerWinding' instance.
30 @param connectionType: The type of connection of the winding. Values are: "Yn", "Y", "D", "I", "Z", "A", "Zn"
31 @param windingType: The type of winding. Values are: "primary", "quaternary", "secondary", "tertiary"
32 @param x: Positive sequence series reactance of the winding. For a two winding transformer, the full reactance of the transformer should be entered on the primary (high voltage) winding.
33 @param grounded: Set if the winding is grounded.
34 @param g: Magnetizing branch conductance (G mag).
35 @param r: Positive sequence series resistance of the winding. For a two winding transformer, the full resistance of the transformer should be entered on the primary (high voltage) winding.
36 @param x0: Zero sequence series reactance of the winding.
37 @param ratedU: The rated voltage (phase-to-phase) of the winding, usually the same as the neutral voltage.
38 @param ratedS: The normal apparent power rating for the winding
39 @param emergencyS: The apparent power that the winding can carry under emergency conditions.
40 @param rground: Ground resistance path through connected grounding transformer.
41 @param shortTermS: Apparent power that the winding can carry for a short period of time.
42 @param r0: Zero sequence series resistance of the winding.
43 @param g0: Zero sequence magnetizing branch conductance.
44 @param insulationU: Basic insulation level voltage rating
45 @param b: Magnetizing branch susceptance (B mag). The value can be positive or negative.
46 @param b0: Zero sequence magnetizing branch susceptance.
47 @param xground: Ground reactance path through connected grounding transformer.
48 @param From_WindingTest: The transformer winding tests for which the transformer winding (terminal) participates as the 'from' part of the test.
49 @param To_WindingTest: The winding winding tests for which the transformer winding (terminal) participates as the 'to' end of the test.
50 @param RatioTapChanger: The ratio tap changer associated with the transformer winding.
51 @param PowerTransformer: A transformer has windings
52 @param PhaseTapChanger: The phase tap changer associated with the transformer winding.
53 """
54 #: The type of connection of the winding. Values are: "Yn", "Y", "D", "I", "Z", "A", "Zn"
55 self.connectionType = connectionType
57 #: The type of winding. Values are: "primary", "quaternary", "secondary", "tertiary"
58 self.windingType = windingType
60 #: Positive sequence series reactance of the winding. For a two winding transformer, the full reactance of the transformer should be entered on the primary (high voltage) winding.
61 self.x = x
63 #: Set if the winding is grounded.
64 self.grounded = grounded
66 #: Magnetizing branch conductance (G mag).
67 self.g = g
69 #: Positive sequence series resistance of the winding. For a two winding transformer, the full resistance of the transformer should be entered on the primary (high voltage) winding.
70 self.r = r
72 #: Zero sequence series reactance of the winding.
73 self.x0 = x0
75 #: The rated voltage (phase-to-phase) of the winding, usually the same as the neutral voltage.
76 self.ratedU = ratedU
78 #: The normal apparent power rating for the winding
79 self.ratedS = ratedS
81 #: The apparent power that the winding can carry under emergency conditions.
82 self.emergencyS = emergencyS
84 #: Ground resistance path through connected grounding transformer.
85 self.rground = rground
87 #: Apparent power that the winding can carry for a short period of time.
88 self.shortTermS = shortTermS
90 #: Zero sequence series resistance of the winding.
91 self.r0 = r0
93 #: Zero sequence magnetizing branch conductance.
94 self.g0 = g0
96 #: Basic insulation level voltage rating
97 self.insulationU = insulationU
99 #: Magnetizing branch susceptance (B mag). The value can be positive or negative.
100 self.b = b
102 #: Zero sequence magnetizing branch susceptance.
103 self.b0 = b0
105 #: Ground reactance path through connected grounding transformer.
106 self.xground = xground
108 self._From_WindingTest = []
109 self.From_WindingTest = [] if From_WindingTest is None else From_WindingTest
111 self._To_WindingTest = []
112 self.To_WindingTest = [] if To_WindingTest is None else To_WindingTest
114 self._RatioTapChanger = None
115 self.RatioTapChanger = RatioTapChanger
117 self._PowerTransformer = None
118 self.PowerTransformer = PowerTransformer
120 self._PhaseTapChanger = None
121 self.PhaseTapChanger = PhaseTapChanger
123 super(TransformerWinding, self).__init__(*args, **kw_args)
125 _attrs = ["connectionType", "windingType", "x", "grounded", "g", "r", "x0", "ratedU", "ratedS", "emergencyS", "rground", "shortTermS", "r0", "g0", "insulationU", "b", "b0", "xground"]
126 _attr_types = {"connectionType": str, "windingType": str, "x": float, "grounded": bool, "g": float, "r": float, "x0": float, "ratedU": float, "ratedS": float, "emergencyS": float, "rground": float, "shortTermS": float, "r0": float, "g0": float, "insulationU": float, "b": float, "b0": float, "xground": float}
127 _defaults = {"connectionType": "Yn", "windingType": "primary", "x": 0.0, "grounded": False, "g": 0.0, "r": 0.0, "x0": 0.0, "ratedU": 0.0, "ratedS": 0.0, "emergencyS": 0.0, "rground": 0.0, "shortTermS": 0.0, "r0": 0.0, "g0": 0.0, "insulationU": 0.0, "b": 0.0, "b0": 0.0, "xground": 0.0}
128 _enums = {"connectionType": "WindingConnection", "windingType": "WindingType"}
129 _refs = ["From_WindingTest", "To_WindingTest", "RatioTapChanger", "PowerTransformer", "PhaseTapChanger"]
130 _many_refs = ["From_WindingTest", "To_WindingTest"]
132 def getFrom_WindingTest(self):
133 """The transformer winding tests for which the transformer winding (terminal) participates as the 'from' part of the test.
135 return self._From_WindingTest
137 def setFrom_WindingTest(self, value):
138 for x in self._From_WindingTest:
139 x.From_TransformerWinding = None
140 for y in value:
141 y._From_TransformerWinding = self
142 self._From_WindingTest = value
144 From_WindingTest = property(getFrom_WindingTest, setFrom_WindingTest)
146 def addFrom_WindingTest(self, *From_WindingTest):
147 for obj in From_WindingTest:
148 obj.From_TransformerWinding = self
150 def removeFrom_WindingTest(self, *From_WindingTest):
151 for obj in From_WindingTest:
152 obj.From_TransformerWinding = None
154 def getTo_WindingTest(self):
155 """The winding winding tests for which the transformer winding (terminal) participates as the 'to' end of the test.
157 return self._To_WindingTest
159 def setTo_WindingTest(self, value):
160 for x in self._To_WindingTest:
161 x.To_TransformerWinding = None
162 for y in value:
163 y._To_TransformerWinding = self
164 self._To_WindingTest = value
166 To_WindingTest = property(getTo_WindingTest, setTo_WindingTest)
168 def addTo_WindingTest(self, *To_WindingTest):
169 for obj in To_WindingTest:
170 obj.To_TransformerWinding = self
172 def removeTo_WindingTest(self, *To_WindingTest):
173 for obj in To_WindingTest:
174 obj.To_TransformerWinding = None
176 def getRatioTapChanger(self):
177 """The ratio tap changer associated with the transformer winding.
179 return self._RatioTapChanger
181 def setRatioTapChanger(self, value):
182 if self._RatioTapChanger is not None:
183 self._RatioTapChanger._TransformerWinding = None
185 self._RatioTapChanger = value
186 if self._RatioTapChanger is not None:
187 self._RatioTapChanger.TransformerWinding = None
188 self._RatioTapChanger._TransformerWinding = self
190 RatioTapChanger = property(getRatioTapChanger, setRatioTapChanger)
192 def getPowerTransformer(self):
193 """A transformer has windings
195 return self._PowerTransformer
197 def setPowerTransformer(self, value):
198 if self._PowerTransformer is not None:
199 filtered = [x for x in self.PowerTransformer.TransformerWindings if x != self]
200 self._PowerTransformer._TransformerWindings = filtered
202 self._PowerTransformer = value
203 if self._PowerTransformer is not None:
204 if self not in self._PowerTransformer._TransformerWindings:
205 self._PowerTransformer._TransformerWindings.append(self)
207 PowerTransformer = property(getPowerTransformer, setPowerTransformer)
209 def getPhaseTapChanger(self):
210 """The phase tap changer associated with the transformer winding.
212 return self._PhaseTapChanger
214 def setPhaseTapChanger(self, value):
215 if self._PhaseTapChanger is not None:
216 self._PhaseTapChanger._TransformerWinding = None
218 self._PhaseTapChanger = value
219 if self._PhaseTapChanger is not None:
220 self._PhaseTapChanger.TransformerWinding = None
221 self._PhaseTapChanger._TransformerWinding = self
223 PhaseTapChanger = property(getPhaseTapChanger, setPhaseTapChanger)