Fixing website and API documentation links
[PyCIM.git] / CIM14 / ENTSOE / Equipment / Core / ConductingEquipment.py
blob5b9068a0f565236c10740909b1dfd34bf6672bc6
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 CIM14.ENTSOE.Equipment.Core.Equipment import Equipment
23 class ConductingEquipment(Equipment):
24 """The parts of the power system that are designed to carry current or that are conductively connected therewith. ConductingEquipment is contained within an EquipmentContainer that may be a Substation, or a VoltageLevel or a Bay within a Substation.
25 """
27 def __init__(self, Terminals=None, BaseVoltage=None, *args, **kw_args):
28 """Initialises a new 'ConductingEquipment' instance.
30 @param Terminals: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
31 @param BaseVoltage: Use association to ConductingEquipment only when there is no VoltageLevel container used.For the 2010 ENTSOE IOP, the BaseVoltage association for SeriesCompensator and TransformerWinding is required.
32 """
33 self._Terminals = []
34 self.Terminals = [] if Terminals is None else Terminals
36 self._BaseVoltage = None
37 self.BaseVoltage = BaseVoltage
39 super(ConductingEquipment, self).__init__(*args, **kw_args)
41 _attrs = []
42 _attr_types = {}
43 _defaults = {}
44 _enums = {}
45 _refs = ["Terminals", "BaseVoltage"]
46 _many_refs = ["Terminals"]
48 def getTerminals(self):
49 """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
50 """
51 return self._Terminals
53 def setTerminals(self, value):
54 for x in self._Terminals:
55 x.ConductingEquipment = None
56 for y in value:
57 y._ConductingEquipment = self
58 self._Terminals = value
60 Terminals = property(getTerminals, setTerminals)
62 def addTerminals(self, *Terminals):
63 for obj in Terminals:
64 obj.ConductingEquipment = self
66 def removeTerminals(self, *Terminals):
67 for obj in Terminals:
68 obj.ConductingEquipment = None
70 def getBaseVoltage(self):
71 """Use association to ConductingEquipment only when there is no VoltageLevel container used.For the 2010 ENTSOE IOP, the BaseVoltage association for SeriesCompensator and TransformerWinding is required.
72 """
73 return self._BaseVoltage
75 def setBaseVoltage(self, value):
76 if self._BaseVoltage is not None:
77 filtered = [x for x in self.BaseVoltage.ConductingEquipment if x != self]
78 self._BaseVoltage._ConductingEquipment = filtered
80 self._BaseVoltage = value
81 if self._BaseVoltage is not None:
82 if self not in self._BaseVoltage._ConductingEquipment:
83 self._BaseVoltage._ConductingEquipment.append(self)
85 BaseVoltage = property(getBaseVoltage, setBaseVoltage)