Bumping version for release.
[PyCIM.git] / CIM14 / IEC61968 / WiresExt / TransformerBank.py
blob923470ca2348d861cb82671395f111f5a5e8975e
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.Equipment import Equipment
19 class TransformerBank(Equipment):
20 """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.
21 """
23 def __init__(self, vectorGroup='', Transformers=None, *args, **kw_args):
24 """Initialises a new 'TransformerBank' instance.
26 @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.
27 @param Transformers: All transformers that belong to this bank.
28 """
29 #: 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.
30 self.vectorGroup = vectorGroup
32 self._Transformers = []
33 self.Transformers = [] if Transformers is None else Transformers
35 super(TransformerBank, self).__init__(*args, **kw_args)
37 _attrs = ["vectorGroup"]
38 _attr_types = {"vectorGroup": str}
39 _defaults = {"vectorGroup": ''}
40 _enums = {}
41 _refs = ["Transformers"]
42 _many_refs = ["Transformers"]
44 def getTransformers(self):
45 """All transformers that belong to this bank.
46 """
47 return self._Transformers
49 def setTransformers(self, value):
50 for x in self._Transformers:
51 x.TransformerBank = None
52 for y in value:
53 y._TransformerBank = self
54 self._Transformers = value
56 Transformers = property(getTransformers, setTransformers)
58 def addTransformers(self, *Transformers):
59 for obj in Transformers:
60 obj.TransformerBank = self
62 def removeTransformers(self, *Transformers):
63 for obj in Transformers:
64 obj.TransformerBank = None