Removing package directories.
[PyCIM.git] / CIM14 / IEC61970 / Core / Equipment.py
blob3cc41a73107c704307213e2d3eb449586989c3c7
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.PowerSystemResource import PowerSystemResource
19 class Equipment(PowerSystemResource):
20 """The parts of a power system that are physical devices, electronic or mechanical
21 """
23 def __init__(self, normaIlyInService=False, aggregate=False, OperationalLimitSet=None, ContingencyEquipment=None, EquipmentContainer=None, CustomerAgreements=None, *args, **kw_args):
24 """Initialises a new 'Equipment' instance.
26 @param normaIlyInService: The equipment is normally in service.
27 @param aggregate: The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be PowerTransformers or SychronousMachines operating in parallel modeled as a single aggregate PowerTransformer or aggregate SynchronousMachine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program.
28 @param OperationalLimitSet: The equipment limit sets associated with the equipment.
29 @param ContingencyEquipment: The contingency element associated with the equipment.
30 @param EquipmentContainer: The association is used in the naming hierarchy.
31 @param CustomerAgreements:
32 """
33 #: The equipment is normally in service.
34 self.normaIlyInService = normaIlyInService
36 #: The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be PowerTransformers or SychronousMachines operating in parallel modeled as a single aggregate PowerTransformer or aggregate SynchronousMachine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program.
37 self.aggregate = aggregate
39 self._OperationalLimitSet = []
40 self.OperationalLimitSet = [] if OperationalLimitSet is None else OperationalLimitSet
42 self._ContingencyEquipment = []
43 self.ContingencyEquipment = [] if ContingencyEquipment is None else ContingencyEquipment
45 self._EquipmentContainer = None
46 self.EquipmentContainer = EquipmentContainer
48 self._CustomerAgreements = []
49 self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements
51 super(Equipment, self).__init__(*args, **kw_args)
53 _attrs = ["normaIlyInService", "aggregate"]
54 _attr_types = {"normaIlyInService": bool, "aggregate": bool}
55 _defaults = {"normaIlyInService": False, "aggregate": False}
56 _enums = {}
57 _refs = ["OperationalLimitSet", "ContingencyEquipment", "EquipmentContainer", "CustomerAgreements"]
58 _many_refs = ["OperationalLimitSet", "ContingencyEquipment", "CustomerAgreements"]
60 def getOperationalLimitSet(self):
61 """The equipment limit sets associated with the equipment.
62 """
63 return self._OperationalLimitSet
65 def setOperationalLimitSet(self, value):
66 for x in self._OperationalLimitSet:
67 x._Equipment = None
68 for y in value:
69 y._Equipment = self
70 self._OperationalLimitSet = value
72 OperationalLimitSet = property(getOperationalLimitSet, setOperationalLimitSet)
74 def addOperationalLimitSet(self, *OperationalLimitSet):
75 for obj in OperationalLimitSet:
76 obj._Equipment = self
77 self._OperationalLimitSet.append(obj)
79 def removeOperationalLimitSet(self, *OperationalLimitSet):
80 for obj in OperationalLimitSet:
81 obj._Equipment = None
82 self._OperationalLimitSet.remove(obj)
84 def getContingencyEquipment(self):
85 """The contingency element associated with the equipment.
86 """
87 return self._ContingencyEquipment
89 def setContingencyEquipment(self, value):
90 for x in self._ContingencyEquipment:
91 x._Equipment = None
92 for y in value:
93 y._Equipment = self
94 self._ContingencyEquipment = value
96 ContingencyEquipment = property(getContingencyEquipment, setContingencyEquipment)
98 def addContingencyEquipment(self, *ContingencyEquipment):
99 for obj in ContingencyEquipment:
100 obj._Equipment = self
101 self._ContingencyEquipment.append(obj)
103 def removeContingencyEquipment(self, *ContingencyEquipment):
104 for obj in ContingencyEquipment:
105 obj._Equipment = None
106 self._ContingencyEquipment.remove(obj)
108 def getEquipmentContainer(self):
109 """The association is used in the naming hierarchy.
111 return self._EquipmentContainer
113 def setEquipmentContainer(self, value):
114 if self._EquipmentContainer is not None:
115 filtered = [x for x in self.EquipmentContainer.Equipments if x != self]
116 self._EquipmentContainer._Equipments = filtered
118 self._EquipmentContainer = value
119 if self._EquipmentContainer is not None:
120 self._EquipmentContainer._Equipments.append(self)
122 EquipmentContainer = property(getEquipmentContainer, setEquipmentContainer)
124 def getCustomerAgreements(self):
126 return self._CustomerAgreements
128 def setCustomerAgreements(self, value):
129 for p in self._CustomerAgreements:
130 filtered = [q for q in p.Equipments if q != self]
131 self._CustomerAgreements._Equipments = filtered
132 for r in value:
133 if self not in r._Equipments:
134 r._Equipments.append(self)
135 self._CustomerAgreements = value
137 CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements)
139 def addCustomerAgreements(self, *CustomerAgreements):
140 for obj in CustomerAgreements:
141 if self not in obj._Equipments:
142 obj._Equipments.append(self)
143 self._CustomerAgreements.append(obj)
145 def removeCustomerAgreements(self, *CustomerAgreements):
146 for obj in CustomerAgreements:
147 if self in obj._Equipments:
148 obj._Equipments.remove(self)
149 self._CustomerAgreements.remove(obj)