Adding class meta-data attributes.
[PyCIM.git] / schemata / CIM14 / IEC61970 / Core / ConductingEquipment.py
blob25e7e6b3f8ded0c51ad895835772bb1c747060aa
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 ConductingEquipment(Equipment):
20 """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.
21 """
23 def __init__(self, phases="A", ClearanceTags=None, SvStatus=None, Terminals=None, BaseVoltage=None, ProtectionEquipments=None, *args, **kw_args):
24 """Initialises a new 'ConductingEquipment' instance.
26 @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"
27 @param ClearanceTags: Conducting equipment may have multiple clearance tags for authorized field work
28 @param SvStatus: The status state associated with the conducting equipment.
29 @param Terminals: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
30 @param BaseVoltage: Use association to ConductingEquipment only when there is no VoltageLevel container used.
31 @param ProtectionEquipments: Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment.
32 """
33 #: 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"
34 self.phases = phases
36 self._ClearanceTags = []
37 self.ClearanceTags = [] if ClearanceTags is None else ClearanceTags
39 self._SvStatus = None
40 self.SvStatus = SvStatus
42 self._Terminals = []
43 self.Terminals = [] if Terminals is None else Terminals
45 self._BaseVoltage = None
46 self.BaseVoltage = BaseVoltage
48 self._ProtectionEquipments = []
49 self.ProtectionEquipments = [] if ProtectionEquipments is None else ProtectionEquipments
51 super(ConductingEquipment, self).__init__(*args, **kw_args)
53 _attrs = ["phases"]
54 _attr_types = {"phases": str}
55 _defaults = {"phases": "A"}
56 _enums = {"phases": "PhaseCode"}
57 _refs = ["ClearanceTags", "SvStatus", "Terminals", "BaseVoltage", "ProtectionEquipments"]
58 _many_refs = ["ClearanceTags", "Terminals", "ProtectionEquipments"]
60 def getClearanceTags(self):
61 """Conducting equipment may have multiple clearance tags for authorized field work
62 """
63 return self._ClearanceTags
65 def setClearanceTags(self, value):
66 for x in self._ClearanceTags:
67 x._ConductingEquipment = None
68 for y in value:
69 y._ConductingEquipment = self
70 self._ClearanceTags = value
72 ClearanceTags = property(getClearanceTags, setClearanceTags)
74 def addClearanceTags(self, *ClearanceTags):
75 for obj in ClearanceTags:
76 obj._ConductingEquipment = self
77 self._ClearanceTags.append(obj)
79 def removeClearanceTags(self, *ClearanceTags):
80 for obj in ClearanceTags:
81 obj._ConductingEquipment = None
82 self._ClearanceTags.remove(obj)
84 def getSvStatus(self):
85 """The status state associated with the conducting equipment.
86 """
87 return self._SvStatus
89 def setSvStatus(self, value):
90 if self._SvStatus is not None:
91 self._SvStatus._ConductingEquipment = None
93 self._SvStatus = value
94 if self._SvStatus is not None:
95 self._SvStatus._ConductingEquipment = self
97 SvStatus = property(getSvStatus, setSvStatus)
99 def getTerminals(self):
100 """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
102 return self._Terminals
104 def setTerminals(self, value):
105 for x in self._Terminals:
106 x._ConductingEquipment = None
107 for y in value:
108 y._ConductingEquipment = self
109 self._Terminals = value
111 Terminals = property(getTerminals, setTerminals)
113 def addTerminals(self, *Terminals):
114 for obj in Terminals:
115 obj._ConductingEquipment = self
116 self._Terminals.append(obj)
118 def removeTerminals(self, *Terminals):
119 for obj in Terminals:
120 obj._ConductingEquipment = None
121 self._Terminals.remove(obj)
123 def getBaseVoltage(self):
124 """Use association to ConductingEquipment only when there is no VoltageLevel container used.
126 return self._BaseVoltage
128 def setBaseVoltage(self, value):
129 if self._BaseVoltage is not None:
130 filtered = [x for x in self.BaseVoltage.ConductingEquipment if x != self]
131 self._BaseVoltage._ConductingEquipment = filtered
133 self._BaseVoltage = value
134 if self._BaseVoltage is not None:
135 self._BaseVoltage._ConductingEquipment.append(self)
137 BaseVoltage = property(getBaseVoltage, setBaseVoltage)
139 def getProtectionEquipments(self):
140 """Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment.
142 return self._ProtectionEquipments
144 def setProtectionEquipments(self, value):
145 for p in self._ProtectionEquipments:
146 filtered = [q for q in p.ConductingEquipments if q != self]
147 self._ProtectionEquipments._ConductingEquipments = filtered
148 for r in value:
149 if self not in r._ConductingEquipments:
150 r._ConductingEquipments.append(self)
151 self._ProtectionEquipments = value
153 ProtectionEquipments = property(getProtectionEquipments, setProtectionEquipments)
155 def addProtectionEquipments(self, *ProtectionEquipments):
156 for obj in ProtectionEquipments:
157 if self not in obj._ConductingEquipments:
158 obj._ConductingEquipments.append(self)
159 self._ProtectionEquipments.append(obj)
161 def removeProtectionEquipments(self, *ProtectionEquipments):
162 for obj in ProtectionEquipments:
163 if self in obj._ConductingEquipments:
164 obj._ConductingEquipments.remove(self)
165 self._ProtectionEquipments.remove(obj)