Adding class meta-data attributes.
[PyCIM.git] / schemata / CIM14 / IEC61968 / AssetModels / WindingInfo.py
blob04f63302306ab1d8eae4502e3ea4b4adea0e7ac0
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.IdentifiedObject import IdentifiedObject
19 class WindingInfo(IdentifiedObject):
20 """Winding data.
21 """
23 def __init__(self, connectionKind="Yn", r=0.0, phaseAngle=0, emergencyS=0.0, ratedU=0.0, insulationU=0.0, ratedS=0.0, sequenceNumber=0, shortTermS=0.0, Windings=None, WindingTests=None, TransformerInfo=None, ToWindingSpecs=None, *args, **kw_args):
24 """Initialises a new 'WindingInfo' instance.
26 @param connectionKind: Kind of connection of this winding. Values are: "Yn", "Y", "D", "I", "Z", "A", "Zn"
27 @param r: DC resistance of this winding.
28 @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.
29 @param emergencyS: Apparent power that the winding can carry under emergency conditions.
30 @param ratedU: Rated voltage of this winding: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings.
31 @param insulationU: Basic insulation level voltage rating.
32 @param ratedS: Normal apparent power rating of this winding.
33 @param sequenceNumber: Sequence number for this winding, corresponding to the winding's order in the TransformerBank.vectorGroup attribute. Highest voltage winding should be '1'.
34 @param shortTermS: Apparent power that this winding can carry for a short period of time.
35 @param Windings: All windings described by this winding data.
36 @param WindingTests: All winding tests during which voltage or current was applied to this winding.
37 @param TransformerInfo: Transformer data that this winding description is part of.
38 @param ToWindingSpecs: Tap steps and induced voltage/angle measurements for tests in which this winding was not excited.
39 """
40 #: Kind of connection of this winding. Values are: "Yn", "Y", "D", "I", "Z", "A", "Zn"
41 self.connectionKind = connectionKind
43 #: DC resistance of this winding.
44 self.r = r
46 #: 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.
47 self.phaseAngle = phaseAngle
49 #: Apparent power that the winding can carry under emergency conditions.
50 self.emergencyS = emergencyS
52 #: Rated voltage of this winding: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings.
53 self.ratedU = ratedU
55 #: Basic insulation level voltage rating.
56 self.insulationU = insulationU
58 #: Normal apparent power rating of this winding.
59 self.ratedS = ratedS
61 #: Sequence number for this winding, corresponding to the winding's order in the TransformerBank.vectorGroup attribute. Highest voltage winding should be '1'.
62 self.sequenceNumber = sequenceNumber
64 #: Apparent power that this winding can carry for a short period of time.
65 self.shortTermS = shortTermS
67 self._Windings = []
68 self.Windings = [] if Windings is None else Windings
70 self._WindingTests = []
71 self.WindingTests = [] if WindingTests is None else WindingTests
73 self._TransformerInfo = None
74 self.TransformerInfo = TransformerInfo
76 self._ToWindingSpecs = []
77 self.ToWindingSpecs = [] if ToWindingSpecs is None else ToWindingSpecs
79 super(WindingInfo, self).__init__(*args, **kw_args)
81 _attrs = ["connectionKind", "r", "phaseAngle", "emergencyS", "ratedU", "insulationU", "ratedS", "sequenceNumber", "shortTermS"]
82 _attr_types = {"connectionKind": str, "r": float, "phaseAngle": int, "emergencyS": float, "ratedU": float, "insulationU": float, "ratedS": float, "sequenceNumber": int, "shortTermS": float}
83 _defaults = {"connectionKind": "Yn", "r": 0.0, "phaseAngle": 0, "emergencyS": 0.0, "ratedU": 0.0, "insulationU": 0.0, "ratedS": 0.0, "sequenceNumber": 0, "shortTermS": 0.0}
84 _enums = {"connectionKind": "WindingConnection"}
85 _refs = ["Windings", "WindingTests", "TransformerInfo", "ToWindingSpecs"]
86 _many_refs = ["Windings", "WindingTests", "ToWindingSpecs"]
88 def getWindings(self):
89 """All windings described by this winding data.
90 """
91 return self._Windings
93 def setWindings(self, value):
94 for x in self._Windings:
95 x._WindingInfo = None
96 for y in value:
97 y._WindingInfo = self
98 self._Windings = value
100 Windings = property(getWindings, setWindings)
102 def addWindings(self, *Windings):
103 for obj in Windings:
104 obj._WindingInfo = self
105 self._Windings.append(obj)
107 def removeWindings(self, *Windings):
108 for obj in Windings:
109 obj._WindingInfo = None
110 self._Windings.remove(obj)
112 def getWindingTests(self):
113 """All winding tests during which voltage or current was applied to this winding.
115 return self._WindingTests
117 def setWindingTests(self, value):
118 for x in self._WindingTests:
119 x._FromWinding = None
120 for y in value:
121 y._FromWinding = self
122 self._WindingTests = value
124 WindingTests = property(getWindingTests, setWindingTests)
126 def addWindingTests(self, *WindingTests):
127 for obj in WindingTests:
128 obj._FromWinding = self
129 self._WindingTests.append(obj)
131 def removeWindingTests(self, *WindingTests):
132 for obj in WindingTests:
133 obj._FromWinding = None
134 self._WindingTests.remove(obj)
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 self._TransformerInfo._WindingInfos.append(self)
150 TransformerInfo = property(getTransformerInfo, setTransformerInfo)
152 def getToWindingSpecs(self):
153 """Tap steps and induced voltage/angle measurements for tests in which this winding was not excited.
155 return self._ToWindingSpecs
157 def setToWindingSpecs(self, value):
158 for x in self._ToWindingSpecs:
159 x._ToWinding = None
160 for y in value:
161 y._ToWinding = self
162 self._ToWindingSpecs = value
164 ToWindingSpecs = property(getToWindingSpecs, setToWindingSpecs)
166 def addToWindingSpecs(self, *ToWindingSpecs):
167 for obj in ToWindingSpecs:
168 obj._ToWinding = self
169 self._ToWindingSpecs.append(obj)
171 def removeToWindingSpecs(self, *ToWindingSpecs):
172 for obj in ToWindingSpecs:
173 obj._ToWinding = None
174 self._ToWindingSpecs.remove(obj)