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
.Equipment
import Equipment
23 class TransformerBank(Equipment
):
24 """An assembly of transformers that are connected together. For three-phase transformers, there would be one transformer per bank. For banks of single-phase transformers, there will be more than one transformer per bank, and they need not be identical.
27 def __init__(self
, vectorGroup
='', Transformers
=None, *args
, **kw_args
):
28 """Initialises a new 'TransformerBank' instance.
30 @param vectorGroup: Vector group of the bank for protective relaying, e.g., Dyn1. For unbalanced transformers, this may not be simply determined from the constituent winding connections.
31 @param Transformers: All transformers that belong to this bank.
33 #: Vector group of the bank for protective relaying, e.g., Dyn1. For unbalanced transformers, this may not be simply determined from the constituent winding connections.
34 self
.vectorGroup
= vectorGroup
36 self
._Transformers
= []
37 self
.Transformers
= [] if Transformers
is None else Transformers
39 super(TransformerBank
, self
).__init
__(*args
, **kw_args
)
41 _attrs
= ["vectorGroup"]
42 _attr_types
= {"vectorGroup": str}
43 _defaults
= {"vectorGroup": ''}
45 _refs
= ["Transformers"]
46 _many_refs
= ["Transformers"]
48 def getTransformers(self
):
49 """All transformers that belong to this bank.
51 return self
._Transformers
53 def setTransformers(self
, value
):
54 for x
in self
._Transformers
:
55 x
.TransformerBank
= None
57 y
._TransformerBank
= self
58 self
._Transformers
= value
60 Transformers
= property(getTransformers
, setTransformers
)
62 def addTransformers(self
, *Transformers
):
63 for obj
in Transformers
:
64 obj
.TransformerBank
= self
66 def removeTransformers(self
, *Transformers
):
67 for obj
in Transformers
:
68 obj
.TransformerBank
= None