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
.PowerSystemResource
import PowerSystemResource
23 class Equipment(PowerSystemResource
):
24 """The parts of a power system that are physical devices, electronic or mechanical
27 def __init__(self
, normaIlyInService
=False, aggregate
=False, OperationalLimitSet
=None, ContingencyEquipment
=None, EquipmentContainer
=None, CustomerAgreements
=None, *args
, **kw_args
):
28 """Initialises a new 'Equipment' instance.
30 @param normaIlyInService: The equipment is normally in service.
31 @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.
32 @param OperationalLimitSet: The equipment limit sets associated with the equipment.
33 @param ContingencyEquipment: The contingency element associated with the equipment.
34 @param EquipmentContainer: The association is used in the naming hierarchy.
35 @param CustomerAgreements:
37 #: The equipment is normally in service.
38 self
.normaIlyInService
= normaIlyInService
40 #: 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.
41 self
.aggregate
= aggregate
43 self
._OperationalLimitSet
= []
44 self
.OperationalLimitSet
= [] if OperationalLimitSet
is None else OperationalLimitSet
46 self
._ContingencyEquipment
= []
47 self
.ContingencyEquipment
= [] if ContingencyEquipment
is None else ContingencyEquipment
49 self
._EquipmentContainer
= None
50 self
.EquipmentContainer
= EquipmentContainer
52 self
._CustomerAgreements
= []
53 self
.CustomerAgreements
= [] if CustomerAgreements
is None else CustomerAgreements
55 super(Equipment
, self
).__init
__(*args
, **kw_args
)
57 _attrs
= ["normaIlyInService", "aggregate"]
58 _attr_types
= {"normaIlyInService": bool, "aggregate": bool}
59 _defaults
= {"normaIlyInService": False, "aggregate": False}
61 _refs
= ["OperationalLimitSet", "ContingencyEquipment", "EquipmentContainer", "CustomerAgreements"]
62 _many_refs
= ["OperationalLimitSet", "ContingencyEquipment", "CustomerAgreements"]
64 def getOperationalLimitSet(self
):
65 """The equipment limit sets associated with the equipment.
67 return self
._OperationalLimitSet
69 def setOperationalLimitSet(self
, value
):
70 for x
in self
._OperationalLimitSet
:
74 self
._OperationalLimitSet
= value
76 OperationalLimitSet
= property(getOperationalLimitSet
, setOperationalLimitSet
)
78 def addOperationalLimitSet(self
, *OperationalLimitSet
):
79 for obj
in OperationalLimitSet
:
82 def removeOperationalLimitSet(self
, *OperationalLimitSet
):
83 for obj
in OperationalLimitSet
:
86 def getContingencyEquipment(self
):
87 """The contingency element associated with the equipment.
89 return self
._ContingencyEquipment
91 def setContingencyEquipment(self
, value
):
92 for x
in self
._ContingencyEquipment
:
96 self
._ContingencyEquipment
= value
98 ContingencyEquipment
= property(getContingencyEquipment
, setContingencyEquipment
)
100 def addContingencyEquipment(self
, *ContingencyEquipment
):
101 for obj
in ContingencyEquipment
:
104 def removeContingencyEquipment(self
, *ContingencyEquipment
):
105 for obj
in ContingencyEquipment
:
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 if self
not in self
._EquipmentContainer
._Equipments
:
121 self
._EquipmentContainer
._Equipments
.append(self
)
123 EquipmentContainer
= property(getEquipmentContainer
, setEquipmentContainer
)
125 def getCustomerAgreements(self
):
127 return self
._CustomerAgreements
129 def setCustomerAgreements(self
, value
):
130 for p
in self
._CustomerAgreements
:
131 filtered
= [q
for q
in p
.Equipments
if q
!= self
]
132 self
._CustomerAgreements
._Equipments
= filtered
134 if self
not in r
._Equipments
:
135 r
._Equipments
.append(self
)
136 self
._CustomerAgreements
= value
138 CustomerAgreements
= property(getCustomerAgreements
, setCustomerAgreements
)
140 def addCustomerAgreements(self
, *CustomerAgreements
):
141 for obj
in CustomerAgreements
:
142 if self
not in obj
._Equipments
:
143 obj
._Equipments
.append(self
)
144 self
._CustomerAgreements
.append(obj
)
146 def removeCustomerAgreements(self
, *CustomerAgreements
):
147 for obj
in CustomerAgreements
:
148 if self
in obj
._Equipments
:
149 obj
._Equipments
.remove(self
)
150 self
._CustomerAgreements
.remove(obj
)