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
.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.
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.
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
)
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
51 return self
._Terminals
53 def setTerminals(self
, value
):
54 for x
in self
._Terminals
:
55 x
.ConductingEquipment
= None
57 y
._ConductingEquipment
= self
58 self
._Terminals
= value
60 Terminals
= property(getTerminals
, setTerminals
)
62 def addTerminals(self
, *Terminals
):
64 obj
.ConductingEquipment
= self
66 def removeTerminals(self
, *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.
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
)