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
.ENTSOE
.Dynamics
.IEC61970
.Core
.CorePowerSystemResource
import CorePowerSystemResource
23 class CoreEquipment(CorePowerSystemResource
):
25 def __init__(self
, normaIlyInService
=False, aggregate
=False, ContingencyEquipment
=None, EquipmentContainer
=None, CustomerAgreements
=None, OperationalLimitSet
=None, *args
, **kw_args
):
26 """Initialises a new 'CoreEquipment' instance.
28 @param normaIlyInService:
30 @param ContingencyEquipment:
31 @param EquipmentContainer:
32 @param CustomerAgreements:
33 @param OperationalLimitSet:
36 self
.normaIlyInService
= normaIlyInService
39 self
.aggregate
= aggregate
41 self
._ContingencyEquipment
= []
42 self
.ContingencyEquipment
= [] if ContingencyEquipment
is None else ContingencyEquipment
44 self
._EquipmentContainer
= None
45 self
.EquipmentContainer
= EquipmentContainer
47 self
._CustomerAgreements
= []
48 self
.CustomerAgreements
= [] if CustomerAgreements
is None else CustomerAgreements
50 self
._OperationalLimitSet
= []
51 self
.OperationalLimitSet
= [] if OperationalLimitSet
is None else OperationalLimitSet
53 super(CoreEquipment
, self
).__init
__(*args
, **kw_args
)
55 _attrs
= ["normaIlyInService", "aggregate"]
56 _attr_types
= {"normaIlyInService": bool, "aggregate": bool}
57 _defaults
= {"normaIlyInService": False, "aggregate": False}
59 _refs
= ["ContingencyEquipment", "EquipmentContainer", "CustomerAgreements", "OperationalLimitSet"]
60 _many_refs
= ["ContingencyEquipment", "CustomerAgreements", "OperationalLimitSet"]
62 def getContingencyEquipment(self
):
64 return self
._ContingencyEquipment
66 def setContingencyEquipment(self
, value
):
67 for x
in self
._ContingencyEquipment
:
71 self
._ContingencyEquipment
= value
73 ContingencyEquipment
= property(getContingencyEquipment
, setContingencyEquipment
)
75 def addContingencyEquipment(self
, *ContingencyEquipment
):
76 for obj
in ContingencyEquipment
:
79 def removeContingencyEquipment(self
, *ContingencyEquipment
):
80 for obj
in ContingencyEquipment
:
83 def getEquipmentContainer(self
):
85 return self
._EquipmentContainer
87 def setEquipmentContainer(self
, value
):
88 if self
._EquipmentContainer
is not None:
89 filtered
= [x
for x
in self
.EquipmentContainer
.Equipments
if x
!= self
]
90 self
._EquipmentContainer
._Equipments
= filtered
92 self
._EquipmentContainer
= value
93 if self
._EquipmentContainer
is not None:
94 if self
not in self
._EquipmentContainer
._Equipments
:
95 self
._EquipmentContainer
._Equipments
.append(self
)
97 EquipmentContainer
= property(getEquipmentContainer
, setEquipmentContainer
)
99 def getCustomerAgreements(self
):
101 return self
._CustomerAgreements
103 def setCustomerAgreements(self
, value
):
104 for p
in self
._CustomerAgreements
:
105 filtered
= [q
for q
in p
.Equipments
if q
!= self
]
106 self
._CustomerAgreements
._Equipments
= filtered
108 if self
not in r
._Equipments
:
109 r
._Equipments
.append(self
)
110 self
._CustomerAgreements
= value
112 CustomerAgreements
= property(getCustomerAgreements
, setCustomerAgreements
)
114 def addCustomerAgreements(self
, *CustomerAgreements
):
115 for obj
in CustomerAgreements
:
116 if self
not in obj
._Equipments
:
117 obj
._Equipments
.append(self
)
118 self
._CustomerAgreements
.append(obj
)
120 def removeCustomerAgreements(self
, *CustomerAgreements
):
121 for obj
in CustomerAgreements
:
122 if self
in obj
._Equipments
:
123 obj
._Equipments
.remove(self
)
124 self
._CustomerAgreements
.remove(obj
)
126 def getOperationalLimitSet(self
):
128 return self
._OperationalLimitSet
130 def setOperationalLimitSet(self
, value
):
131 for x
in self
._OperationalLimitSet
:
135 self
._OperationalLimitSet
= value
137 OperationalLimitSet
= property(getOperationalLimitSet
, setOperationalLimitSet
)
139 def addOperationalLimitSet(self
, *OperationalLimitSet
):
140 for obj
in OperationalLimitSet
:
143 def removeOperationalLimitSet(self
, *OperationalLimitSet
):
144 for obj
in OperationalLimitSet
: