Update README.rst
[PyCIM.git] / CIM14 / CDPSM / Balanced / IEC61968 / WiresExt / WindingPiImpedance.py
blobd8db444704bde26e1a366d4ed70413620d58168e
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.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject
23 class WindingPiImpedance(IdentifiedObject):
24 """Transformer Pi-model impedance that accurately reflects impedance for transformers with 2 or 3 windings. For transformers with 4 or more windings, you must use TransformerInfo.
25 """
27 def __init__(self, x=0.0, g=0.0, r0=0.0, r=0.0, b=0.0, g0=0.0, x0=0.0, b0=0.0, Windings=None, *args, **kw_args):
28 """Initialises a new 'WindingPiImpedance' instance.
30 @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.
31 @param g: Magnetizing branch conductance (G mag).
32 @param r0: Zero sequence series resistance of the winding.
33 @param r: DC resistance of the winding.
34 @param b: Magnetizing branch susceptance (B mag). The value can be positive or negative.
35 @param g0: Zero sequence magnetizing branch conductance.
36 @param x0: Zero sequence series reactance of the winding.
37 @param b0: Zero sequence magnetizing branch susceptance.
38 @param Windings: All windings having this Pi impedance.
39 """
40 #: 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.
41 self.x = x
43 #: Magnetizing branch conductance (G mag).
44 self.g = g
46 #: Zero sequence series resistance of the winding.
47 self.r0 = r0
49 #: DC resistance of the winding.
50 self.r = r
52 #: Magnetizing branch susceptance (B mag). The value can be positive or negative.
53 self.b = b
55 #: Zero sequence magnetizing branch conductance.
56 self.g0 = g0
58 #: Zero sequence series reactance of the winding.
59 self.x0 = x0
61 #: Zero sequence magnetizing branch susceptance.
62 self.b0 = b0
64 self._Windings = []
65 self.Windings = [] if Windings is None else Windings
67 super(WindingPiImpedance, self).__init__(*args, **kw_args)
69 _attrs = ["x", "g", "r0", "r", "b", "g0", "x0", "b0"]
70 _attr_types = {"x": float, "g": float, "r0": float, "r": float, "b": float, "g0": float, "x0": float, "b0": float}
71 _defaults = {"x": 0.0, "g": 0.0, "r0": 0.0, "r": 0.0, "b": 0.0, "g0": 0.0, "x0": 0.0, "b0": 0.0}
72 _enums = {}
73 _refs = ["Windings"]
74 _many_refs = ["Windings"]
76 def getWindings(self):
77 """All windings having this Pi impedance.
78 """
79 return self._Windings
81 def setWindings(self, value):
82 for x in self._Windings:
83 x.PiImpedance = None
84 for y in value:
85 y._PiImpedance = self
86 self._Windings = value
88 Windings = property(getWindings, setWindings)
90 def addWindings(self, *Windings):
91 for obj in Windings:
92 obj.PiImpedance = self
94 def removeWindings(self, *Windings):
95 for obj in Windings:
96 obj.PiImpedance = None