Adding CIM15 package.
[PyCIM.git] / CIM15 / IEC61968 / AssetModels / ShortCircuitTest.py
blobffe0e4b6ab596efca9baf12c81d9bb10ca190dd5
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 CIM15.IEC61968.AssetModels.TransformerTest import TransformerTest
23 class ShortCircuitTest(TransformerTest):
24 """Short-circuit test results determine mesh impedance parameters. They include load losses and leakage impedances. For three-phase windings, the excitation can be positive sequence (the default) or zero sequence. There must be at least one grounded winding.Short-circuit test results determine mesh impedance parameters. They include load losses and leakage impedances. For three-phase windings, the excitation can be positive sequence (the default) or zero sequence. There must be at least one grounded winding.
25 """
27 def __init__(self, lossZero=0.0, leakageImpedance=0.0, loss=0.0, groundedEndStep=0, leakageImpedanceZero=0.0, energisedEndStep=0, GroundedEnds=None, EnergisedEnd=None, *args, **kw_args):
28 """Initialises a new 'ShortCircuitTest' instance.
30 @param lossZero: Load losses from a zero-sequence short-circuit test.
31 @param leakageImpedance: Leakage impedance measured from a positive-sequence or single-phase short-circuit test.
32 @param loss: Load losses from a positive-sequence or single-phase short-circuit test.
33 @param groundedEndStep: Tap step number for the grounded end of the test pair.
34 @param leakageImpedanceZero: Leakage impedance measured from a zero-sequence short-circuit test.
35 @param energisedEndStep: Tap step number for the energised end of the test pair.
36 @param GroundedEnds: All ends short-circuited in this short-circuit test.
37 @param EnergisedEnd: Transformer end that voltage is applied to in this short-circuit test. The test voltage is chosen to induce rated current in the energised end.
38 """
39 #: Load losses from a zero-sequence short-circuit test.
40 self.lossZero = lossZero
42 #: Leakage impedance measured from a positive-sequence or single-phase short-circuit test.
43 self.leakageImpedance = leakageImpedance
45 #: Load losses from a positive-sequence or single-phase short-circuit test.
46 self.loss = loss
48 #: Tap step number for the grounded end of the test pair.
49 self.groundedEndStep = groundedEndStep
51 #: Leakage impedance measured from a zero-sequence short-circuit test.
52 self.leakageImpedanceZero = leakageImpedanceZero
54 #: Tap step number for the energised end of the test pair.
55 self.energisedEndStep = energisedEndStep
57 self._GroundedEnds = []
58 self.GroundedEnds = [] if GroundedEnds is None else GroundedEnds
60 self._EnergisedEnd = None
61 self.EnergisedEnd = EnergisedEnd
63 super(ShortCircuitTest, self).__init__(*args, **kw_args)
65 _attrs = ["lossZero", "leakageImpedance", "loss", "groundedEndStep", "leakageImpedanceZero", "energisedEndStep"]
66 _attr_types = {"lossZero": float, "leakageImpedance": float, "loss": float, "groundedEndStep": int, "leakageImpedanceZero": float, "energisedEndStep": int}
67 _defaults = {"lossZero": 0.0, "leakageImpedance": 0.0, "loss": 0.0, "groundedEndStep": 0, "leakageImpedanceZero": 0.0, "energisedEndStep": 0}
68 _enums = {}
69 _refs = ["GroundedEnds", "EnergisedEnd"]
70 _many_refs = ["GroundedEnds"]
72 def getGroundedEnds(self):
73 """All ends short-circuited in this short-circuit test.
74 """
75 return self._GroundedEnds
77 def setGroundedEnds(self, value):
78 for p in self._GroundedEnds:
79 filtered = [q for q in p.GroundedEndShortCircuitTests if q != self]
80 self._GroundedEnds._GroundedEndShortCircuitTests = filtered
81 for r in value:
82 if self not in r._GroundedEndShortCircuitTests:
83 r._GroundedEndShortCircuitTests.append(self)
84 self._GroundedEnds = value
86 GroundedEnds = property(getGroundedEnds, setGroundedEnds)
88 def addGroundedEnds(self, *GroundedEnds):
89 for obj in GroundedEnds:
90 if self not in obj._GroundedEndShortCircuitTests:
91 obj._GroundedEndShortCircuitTests.append(self)
92 self._GroundedEnds.append(obj)
94 def removeGroundedEnds(self, *GroundedEnds):
95 for obj in GroundedEnds:
96 if self in obj._GroundedEndShortCircuitTests:
97 obj._GroundedEndShortCircuitTests.remove(self)
98 self._GroundedEnds.remove(obj)
100 def getEnergisedEnd(self):
101 """Transformer end that voltage is applied to in this short-circuit test. The test voltage is chosen to induce rated current in the energised end.
103 return self._EnergisedEnd
105 def setEnergisedEnd(self, value):
106 if self._EnergisedEnd is not None:
107 filtered = [x for x in self.EnergisedEnd.EnergisedEndShortCircuitTests if x != self]
108 self._EnergisedEnd._EnergisedEndShortCircuitTests = filtered
110 self._EnergisedEnd = value
111 if self._EnergisedEnd is not None:
112 if self not in self._EnergisedEnd._EnergisedEndShortCircuitTests:
113 self._EnergisedEnd._EnergisedEndShortCircuitTests.append(self)
115 EnergisedEnd = property(getEnergisedEnd, setEnergisedEnd)