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
21 from CIM14
.CDPSM
.Balanced
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class WindingInfo(IdentifiedObject
):
27 def __init__(self
, sequenceNumber
=0, ratedS
=0.0, ratedU
=0.0, connectionKind
="I", emergencyS
=0.0, r
=0.0, phaseAngle
=0, insulationU
=0.0, shortTermS
=0.0, WindingTests
=None, ToWindingSpecs
=None, TransformerInfo
=None, Windings
=None, *args
, **kw_args
):
28 """Initialises a new 'WindingInfo' instance.
30 @param sequenceNumber: Sequence number for this winding, corresponding to the winding's order in the TransformerBank.vectorGroup attribute. Highest voltage winding should be '1'.
31 @param ratedS: Normal apparent power rating of this winding.
32 @param ratedU: Rated voltage of this winding: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings.
33 @param connectionKind: Kind of connection of this winding. Values are: "I", "Z", "Yn", "Y", "A", "D", "Zn"
34 @param emergencyS: Apparent power that the winding can carry under emergency conditions.
35 @param r: DC resistance of this winding.
36 @param phaseAngle: Winding phase angle where 360 degrees are represented with clock hours, so the valid values are {0, ..., 11}. For example, to express winding code 'Dyn11', set attributes as follows: 'connectionKind' = Yn and 'phaseAngle' = 11.
37 @param insulationU: Basic insulation level voltage rating.
38 @param shortTermS: Apparent power that this winding can carry for a short period of time.
39 @param WindingTests: All winding tests during which voltage or current was applied to this winding.
40 @param ToWindingSpecs: Tap steps and induced voltage/angle measurements for tests in which this winding was not excited.
41 @param TransformerInfo: Transformer data that this winding description is part of.
42 @param Windings: All windings described by this winding data.
44 #: Sequence number for this winding, corresponding to the winding's order in the TransformerBank.vectorGroup attribute. Highest voltage winding should be '1'.
45 self
.sequenceNumber
= sequenceNumber
47 #: Normal apparent power rating of this winding.
50 #: Rated voltage of this winding: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings.
53 #: Kind of connection of this winding. Values are: "I", "Z", "Yn", "Y", "A", "D", "Zn"
54 self
.connectionKind
= connectionKind
56 #: Apparent power that the winding can carry under emergency conditions.
57 self
.emergencyS
= emergencyS
59 #: DC resistance of this winding.
62 #: Winding phase angle where 360 degrees are represented with clock hours, so the valid values are {0, ..., 11}. For example, to express winding code 'Dyn11', set attributes as follows: 'connectionKind' = Yn and 'phaseAngle' = 11.
63 self
.phaseAngle
= phaseAngle
65 #: Basic insulation level voltage rating.
66 self
.insulationU
= insulationU
68 #: Apparent power that this winding can carry for a short period of time.
69 self
.shortTermS
= shortTermS
71 self
._WindingTests
= []
72 self
.WindingTests
= [] if WindingTests
is None else WindingTests
74 self
._ToWindingSpecs
= []
75 self
.ToWindingSpecs
= [] if ToWindingSpecs
is None else ToWindingSpecs
77 self
._TransformerInfo
= None
78 self
.TransformerInfo
= TransformerInfo
81 self
.Windings
= [] if Windings
is None else Windings
83 super(WindingInfo
, self
).__init
__(*args
, **kw_args
)
85 _attrs
= ["sequenceNumber", "ratedS", "ratedU", "connectionKind", "emergencyS", "r", "phaseAngle", "insulationU", "shortTermS"]
86 _attr_types
= {"sequenceNumber": int, "ratedS": float, "ratedU": float, "connectionKind": str, "emergencyS": float, "r": float, "phaseAngle": int, "insulationU": float, "shortTermS": float}
87 _defaults
= {"sequenceNumber": 0, "ratedS": 0.0, "ratedU": 0.0, "connectionKind": "I", "emergencyS": 0.0, "r": 0.0, "phaseAngle": 0, "insulationU": 0.0, "shortTermS": 0.0}
88 _enums
= {"connectionKind": "WindingConnection"}
89 _refs
= ["WindingTests", "ToWindingSpecs", "TransformerInfo", "Windings"]
90 _many_refs
= ["WindingTests", "ToWindingSpecs", "Windings"]
92 def getWindingTests(self
):
93 """All winding tests during which voltage or current was applied to this winding.
95 return self
._WindingTests
97 def setWindingTests(self
, value
):
98 for x
in self
._WindingTests
:
101 y
._FromWinding
= self
102 self
._WindingTests
= value
104 WindingTests
= property(getWindingTests
, setWindingTests
)
106 def addWindingTests(self
, *WindingTests
):
107 for obj
in WindingTests
:
108 obj
.FromWinding
= self
110 def removeWindingTests(self
, *WindingTests
):
111 for obj
in WindingTests
:
112 obj
.FromWinding
= None
114 def getToWindingSpecs(self
):
115 """Tap steps and induced voltage/angle measurements for tests in which this winding was not excited.
117 return self
._ToWindingSpecs
119 def setToWindingSpecs(self
, value
):
120 for x
in self
._ToWindingSpecs
:
124 self
._ToWindingSpecs
= value
126 ToWindingSpecs
= property(getToWindingSpecs
, setToWindingSpecs
)
128 def addToWindingSpecs(self
, *ToWindingSpecs
):
129 for obj
in ToWindingSpecs
:
132 def removeToWindingSpecs(self
, *ToWindingSpecs
):
133 for obj
in ToWindingSpecs
:
136 def getTransformerInfo(self
):
137 """Transformer data that this winding description is part of.
139 return self
._TransformerInfo
141 def setTransformerInfo(self
, value
):
142 if self
._TransformerInfo
is not None:
143 filtered
= [x
for x
in self
.TransformerInfo
.WindingInfos
if x
!= self
]
144 self
._TransformerInfo
._WindingInfos
= filtered
146 self
._TransformerInfo
= value
147 if self
._TransformerInfo
is not None:
148 if self
not in self
._TransformerInfo
._WindingInfos
:
149 self
._TransformerInfo
._WindingInfos
.append(self
)
151 TransformerInfo
= property(getTransformerInfo
, setTransformerInfo
)
153 def getWindings(self
):
154 """All windings described by this winding data.
156 return self
._Windings
158 def setWindings(self
, value
):
159 for x
in self
._Windings
:
162 y
._WindingInfo
= self
163 self
._Windings
= value
165 Windings
= property(getWindings
, setWindings
)
167 def addWindings(self
, *Windings
):
169 obj
.WindingInfo
= self
171 def removeWindings(self
, *Windings
):
173 obj
.WindingInfo
= None