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
.IEC61970
.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
, phases
="A", ClearanceTags
=None, SvStatus
=None, Terminals
=None, BaseVoltage
=None, ProtectionEquipments
=None, *args
, **kw_args
):
28 """Initialises a new 'ConductingEquipment' instance.
30 @param phases: Describes the phases carried by a conducting equipment. Values are: "A", "AC", "AN", "ABCN", "B", "C", "BN", "CN", "splitSecondary12N", "ABC", "splitSecondary2N", "N", "ABN", "BC", "BCN", "AB", "splitSecondary1N", "ACN"
31 @param ClearanceTags: Conducting equipment may have multiple clearance tags for authorized field work
32 @param SvStatus: The status state associated with the conducting equipment.
33 @param Terminals: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
34 @param BaseVoltage: Use association to ConductingEquipment only when there is no VoltageLevel container used.
35 @param ProtectionEquipments: Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment.
37 #: Describes the phases carried by a conducting equipment. Values are: "A", "AC", "AN", "ABCN", "B", "C", "BN", "CN", "splitSecondary12N", "ABC", "splitSecondary2N", "N", "ABN", "BC", "BCN", "AB", "splitSecondary1N", "ACN"
40 self
._ClearanceTags
= []
41 self
.ClearanceTags
= [] if ClearanceTags
is None else ClearanceTags
44 self
.SvStatus
= SvStatus
47 self
.Terminals
= [] if Terminals
is None else Terminals
49 self
._BaseVoltage
= None
50 self
.BaseVoltage
= BaseVoltage
52 self
._ProtectionEquipments
= []
53 self
.ProtectionEquipments
= [] if ProtectionEquipments
is None else ProtectionEquipments
55 super(ConductingEquipment
, self
).__init
__(*args
, **kw_args
)
58 _attr_types
= {"phases": str}
59 _defaults
= {"phases": "A"}
60 _enums
= {"phases": "PhaseCode"}
61 _refs
= ["ClearanceTags", "SvStatus", "Terminals", "BaseVoltage", "ProtectionEquipments"]
62 _many_refs
= ["ClearanceTags", "Terminals", "ProtectionEquipments"]
64 def getClearanceTags(self
):
65 """Conducting equipment may have multiple clearance tags for authorized field work
67 return self
._ClearanceTags
69 def setClearanceTags(self
, value
):
70 for x
in self
._ClearanceTags
:
71 x
.ConductingEquipment
= None
73 y
._ConductingEquipment
= self
74 self
._ClearanceTags
= value
76 ClearanceTags
= property(getClearanceTags
, setClearanceTags
)
78 def addClearanceTags(self
, *ClearanceTags
):
79 for obj
in ClearanceTags
:
80 obj
.ConductingEquipment
= self
82 def removeClearanceTags(self
, *ClearanceTags
):
83 for obj
in ClearanceTags
:
84 obj
.ConductingEquipment
= None
86 def getSvStatus(self
):
87 """The status state associated with the conducting equipment.
91 def setSvStatus(self
, value
):
92 if self
._SvStatus
is not None:
93 self
._SvStatus
._ConductingEquipment
= None
95 self
._SvStatus
= value
96 if self
._SvStatus
is not None:
97 self
._SvStatus
.ConductingEquipment
= None
98 self
._SvStatus
._ConductingEquipment
= self
100 SvStatus
= property(getSvStatus
, setSvStatus
)
102 def getTerminals(self
):
103 """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
105 return self
._Terminals
107 def setTerminals(self
, value
):
108 for x
in self
._Terminals
:
109 x
.ConductingEquipment
= None
111 y
._ConductingEquipment
= self
112 self
._Terminals
= value
114 Terminals
= property(getTerminals
, setTerminals
)
116 def addTerminals(self
, *Terminals
):
117 for obj
in Terminals
:
118 obj
.ConductingEquipment
= self
120 def removeTerminals(self
, *Terminals
):
121 for obj
in Terminals
:
122 obj
.ConductingEquipment
= None
124 def getBaseVoltage(self
):
125 """Use association to ConductingEquipment only when there is no VoltageLevel container used.
127 return self
._BaseVoltage
129 def setBaseVoltage(self
, value
):
130 if self
._BaseVoltage
is not None:
131 filtered
= [x
for x
in self
.BaseVoltage
.ConductingEquipment
if x
!= self
]
132 self
._BaseVoltage
._ConductingEquipment
= filtered
134 self
._BaseVoltage
= value
135 if self
._BaseVoltage
is not None:
136 if self
not in self
._BaseVoltage
._ConductingEquipment
:
137 self
._BaseVoltage
._ConductingEquipment
.append(self
)
139 BaseVoltage
= property(getBaseVoltage
, setBaseVoltage
)
141 def getProtectionEquipments(self
):
142 """Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment.
144 return self
._ProtectionEquipments
146 def setProtectionEquipments(self
, value
):
147 for p
in self
._ProtectionEquipments
:
148 filtered
= [q
for q
in p
.ConductingEquipments
if q
!= self
]
149 self
._ProtectionEquipments
._ConductingEquipments
= filtered
151 if self
not in r
._ConductingEquipments
:
152 r
._ConductingEquipments
.append(self
)
153 self
._ProtectionEquipments
= value
155 ProtectionEquipments
= property(getProtectionEquipments
, setProtectionEquipments
)
157 def addProtectionEquipments(self
, *ProtectionEquipments
):
158 for obj
in ProtectionEquipments
:
159 if self
not in obj
._ConductingEquipments
:
160 obj
._ConductingEquipments
.append(self
)
161 self
._ProtectionEquipments
.append(obj
)
163 def removeProtectionEquipments(self
, *ProtectionEquipments
):
164 for obj
in ProtectionEquipments
:
165 if self
in obj
._ConductingEquipments
:
166 obj
._ConductingEquipments
.remove(self
)
167 self
._ProtectionEquipments
.remove(obj
)