Changing license to MIT.
[PyCIM.git] / CDPSM / Asset / IEC61968 / AssetModels / TransformerEndInfo.py
blob9aefae6d26d11ee39aa22f54d10fae00d06decc7
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 CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo
23 class TransformerEndInfo(AssetInfo):
24 """Transformer end data.
25 """
27 def __init__(self, ratedU=0.0, endNumber=0, phaseAngleClock=0, emergencyS=0.0, ratedS=0.0, shortTermS=0.0, r=0.0, insulationU=0.0, connectionKind="Z", TransformerTankInfo=None, TransformerEnd=None, *args, **kw_args):
28 """Initialises a new 'TransformerEndInfo' instance.
30 @param ratedU: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings.
31 @param endNumber: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1.
32 @param phaseAngleClock: 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 'phaseAngleClock' = 11.
33 @param emergencyS: Apparent power that the winding can carry under emergency conditions (also called long-term emergency power).
34 @param ratedS: Normal apparent power rating.
35 @param shortTermS: Apparent power that this winding can carry for a short period of time (in emergency).
36 @param r: DC resistance.
37 @param insulationU: Basic insulation level voltage rating.
38 @param connectionKind: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I"
39 @param TransformerTankInfo: Transformer tank data that this end description is part of.
40 @param TransformerEnd: All transformer ends described by this end data.
41 """
42 #: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings.
43 self.ratedU = ratedU
45 #: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1.
46 self.endNumber = endNumber
48 #: 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 'phaseAngleClock' = 11.
49 self.phaseAngleClock = phaseAngleClock
51 #: Apparent power that the winding can carry under emergency conditions (also called long-term emergency power).
52 self.emergencyS = emergencyS
54 #: Normal apparent power rating.
55 self.ratedS = ratedS
57 #: Apparent power that this winding can carry for a short period of time (in emergency).
58 self.shortTermS = shortTermS
60 #: DC resistance.
61 self.r = r
63 #: Basic insulation level voltage rating.
64 self.insulationU = insulationU
66 #: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I"
67 self.connectionKind = connectionKind
69 self._TransformerTankInfo = None
70 self.TransformerTankInfo = TransformerTankInfo
72 self._TransformerEnd = []
73 self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd
75 super(TransformerEndInfo, self).__init__(*args, **kw_args)
77 _attrs = ["ratedU", "endNumber", "phaseAngleClock", "emergencyS", "ratedS", "shortTermS", "r", "insulationU", "connectionKind"]
78 _attr_types = {"ratedU": float, "endNumber": int, "phaseAngleClock": int, "emergencyS": float, "ratedS": float, "shortTermS": float, "r": float, "insulationU": float, "connectionKind": str}
79 _defaults = {"ratedU": 0.0, "endNumber": 0, "phaseAngleClock": 0, "emergencyS": 0.0, "ratedS": 0.0, "shortTermS": 0.0, "r": 0.0, "insulationU": 0.0, "connectionKind": "Z"}
80 _enums = {"connectionKind": "WindingConnection"}
81 _refs = ["TransformerTankInfo", "TransformerEnd"]
82 _many_refs = ["TransformerEnd"]
84 def getTransformerTankInfo(self):
85 """Transformer tank data that this end description is part of.
86 """
87 return self._TransformerTankInfo
89 def setTransformerTankInfo(self, value):
90 if self._TransformerTankInfo is not None:
91 filtered = [x for x in self.TransformerTankInfo.TransformerEndInfos if x != self]
92 self._TransformerTankInfo._TransformerEndInfos = filtered
94 self._TransformerTankInfo = value
95 if self._TransformerTankInfo is not None:
96 if self not in self._TransformerTankInfo._TransformerEndInfos:
97 self._TransformerTankInfo._TransformerEndInfos.append(self)
99 TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo)
101 def getTransformerEnd(self):
102 """All transformer ends described by this end data.
104 return self._TransformerEnd
106 def setTransformerEnd(self, value):
107 for x in self._TransformerEnd:
108 x.TransformerEndInfo = None
109 for y in value:
110 y._TransformerEndInfo = self
111 self._TransformerEnd = value
113 TransformerEnd = property(getTransformerEnd, setTransformerEnd)
115 def addTransformerEnd(self, *TransformerEnd):
116 for obj in TransformerEnd:
117 obj.TransformerEndInfo = self
119 def removeTransformerEnd(self, *TransformerEnd):
120 for obj in TransformerEnd:
121 obj.TransformerEndInfo = None