Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Protection / ProtectionEquipment.py
blob48e903250671e9a5185631c4819efe2d9c77be1d
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.IEC61970.Core.Equipment import Equipment
23 class ProtectionEquipment(Equipment):
24 """An electrical device designed to respond to input conditions in a prescribed manner and after specified conditions are met to cause contact operation or similar abrupt change in associated electric control circuits, or simply to display the detected condition. Protection equipment are associated with conducting equipment and usually operate circuit breakers.
25 """
27 def __init__(self, lowLimit=0.0, powerDirectionFlag=False, highLimit=0.0, relayDelayTime=0.0, ProtectedSwitches=None, Unit=None, ConductingEquipments=None, *args, **kw_args):
28 """Initialises a new 'ProtectionEquipment' instance.
30 @param lowLimit: The minimum allowable value.
31 @param powerDirectionFlag: Direction same as positive active power flow value.
32 @param highLimit: The maximum allowable value.
33 @param relayDelayTime: The time delay from detection of abnormal conditions to relay operation.
34 @param ProtectedSwitches: Protected switches operated by this ProtectionEquipment.
35 @param Unit: The Unit for the Protection Equipment.
36 @param ConductingEquipments: Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment.
37 """
38 #: The minimum allowable value.
39 self.lowLimit = lowLimit
41 #: Direction same as positive active power flow value.
42 self.powerDirectionFlag = powerDirectionFlag
44 #: The maximum allowable value.
45 self.highLimit = highLimit
47 #: The time delay from detection of abnormal conditions to relay operation.
48 self.relayDelayTime = relayDelayTime
50 self.ProtectedSwitches = [] if ProtectedSwitches is None else ProtectedSwitches
52 self._Unit = None
53 self.Unit = Unit
55 self._ConductingEquipments = []
56 self.ConductingEquipments = [] if ConductingEquipments is None else ConductingEquipments
58 super(ProtectionEquipment, self).__init__(*args, **kw_args)
60 _attrs = ["lowLimit", "powerDirectionFlag", "highLimit", "relayDelayTime"]
61 _attr_types = {"lowLimit": float, "powerDirectionFlag": bool, "highLimit": float, "relayDelayTime": float}
62 _defaults = {"lowLimit": 0.0, "powerDirectionFlag": False, "highLimit": 0.0, "relayDelayTime": 0.0}
63 _enums = {}
64 _refs = ["ProtectedSwitches", "Unit", "ConductingEquipments"]
65 _many_refs = ["ProtectedSwitches", "ConductingEquipments"]
67 def add_ProtectedSwitches(self, *ProtectedSwitches):
68 for obj in ProtectedSwitches:
69 self.ProtectedSwitches.append(obj)
71 def remove_ProtectedSwitches(self, *ProtectedSwitches):
72 for obj in ProtectedSwitches:
73 self.ProtectedSwitches.remove(obj)
75 def getUnit(self):
76 """The Unit for the Protection Equipment.
77 """
78 return self._Unit
80 def setUnit(self, value):
81 if self._Unit is not None:
82 filtered = [x for x in self.Unit.ProtectionEquipments if x != self]
83 self._Unit._ProtectionEquipments = filtered
85 self._Unit = value
86 if self._Unit is not None:
87 if self not in self._Unit._ProtectionEquipments:
88 self._Unit._ProtectionEquipments.append(self)
90 Unit = property(getUnit, setUnit)
92 def getConductingEquipments(self):
93 """Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment.
94 """
95 return self._ConductingEquipments
97 def setConductingEquipments(self, value):
98 for p in self._ConductingEquipments:
99 filtered = [q for q in p.ProtectionEquipments if q != self]
100 self._ConductingEquipments._ProtectionEquipments = filtered
101 for r in value:
102 if self not in r._ProtectionEquipments:
103 r._ProtectionEquipments.append(self)
104 self._ConductingEquipments = value
106 ConductingEquipments = property(getConductingEquipments, setConductingEquipments)
108 def addConductingEquipments(self, *ConductingEquipments):
109 for obj in ConductingEquipments:
110 if self not in obj._ProtectionEquipments:
111 obj._ProtectionEquipments.append(self)
112 self._ConductingEquipments.append(obj)
114 def removeConductingEquipments(self, *ConductingEquipments):
115 for obj in ConductingEquipments:
116 if self in obj._ProtectionEquipments:
117 obj._ProtectionEquipments.remove(self)
118 self._ConductingEquipments.remove(obj)