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
.CoreIdentifiedObject
import CoreIdentifiedObject
23 class CorePowerSystemResource(CoreIdentifiedObject
):
25 def __init__(self
, Block
=None, Location
=None, ReportingGroup
=None, PsrLists
=None, OperatingShare
=None, OutageSchedule
=None, Measurements
=None, Assets
=None, PSRType
=None, *args
, **kw_args
):
26 """Initialises a new 'CorePowerSystemResource' instance.
30 @param ReportingGroup:
32 @param OperatingShare:
33 @param OutageSchedule:
39 self
.Block
= [] if Block
is None else Block
42 self
.Location
= Location
44 self
._ReportingGroup
= []
45 self
.ReportingGroup
= [] if ReportingGroup
is None else ReportingGroup
48 self
.PsrLists
= [] if PsrLists
is None else PsrLists
50 self
._OperatingShare
= []
51 self
.OperatingShare
= [] if OperatingShare
is None else OperatingShare
53 self
._OutageSchedule
= None
54 self
.OutageSchedule
= OutageSchedule
56 self
._Measurements
= []
57 self
.Measurements
= [] if Measurements
is None else Measurements
60 self
.Assets
= [] if Assets
is None else Assets
63 self
.PSRType
= PSRType
65 super(CorePowerSystemResource
, self
).__init
__(*args
, **kw_args
)
71 _refs
= ["Block", "Location", "ReportingGroup", "PsrLists", "OperatingShare", "OutageSchedule", "Measurements", "Assets", "PSRType"]
72 _many_refs
= ["Block", "ReportingGroup", "PsrLists", "OperatingShare", "Measurements", "Assets"]
78 def setBlock(self
, value
):
80 x
.PowerSystemResource
= None
82 y
._PowerSystemResource
= self
85 Block
= property(getBlock
, setBlock
)
87 def addBlock(self
, *Block
):
89 obj
.PowerSystemResource
= self
91 def removeBlock(self
, *Block
):
93 obj
.PowerSystemResource
= None
95 def getLocation(self
):
99 def setLocation(self
, value
):
100 if self
._Location
is not None:
101 filtered
= [x
for x
in self
.Location
.PowerSystemResources
if x
!= self
]
102 self
._Location
._PowerSystemResources
= filtered
104 self
._Location
= value
105 if self
._Location
is not None:
106 if self
not in self
._Location
._PowerSystemResources
:
107 self
._Location
._PowerSystemResources
.append(self
)
109 Location
= property(getLocation
, setLocation
)
111 def getReportingGroup(self
):
113 return self
._ReportingGroup
115 def setReportingGroup(self
, value
):
116 for p
in self
._ReportingGroup
:
117 filtered
= [q
for q
in p
.PowerSystemResource
if q
!= self
]
118 self
._ReportingGroup
._PowerSystemResource
= filtered
120 if self
not in r
._PowerSystemResource
:
121 r
._PowerSystemResource
.append(self
)
122 self
._ReportingGroup
= value
124 ReportingGroup
= property(getReportingGroup
, setReportingGroup
)
126 def addReportingGroup(self
, *ReportingGroup
):
127 for obj
in ReportingGroup
:
128 if self
not in obj
._PowerSystemResource
:
129 obj
._PowerSystemResource
.append(self
)
130 self
._ReportingGroup
.append(obj
)
132 def removeReportingGroup(self
, *ReportingGroup
):
133 for obj
in ReportingGroup
:
134 if self
in obj
._PowerSystemResource
:
135 obj
._PowerSystemResource
.remove(self
)
136 self
._ReportingGroup
.remove(obj
)
138 def getPsrLists(self
):
140 return self
._PsrLists
142 def setPsrLists(self
, value
):
143 for p
in self
._PsrLists
:
144 filtered
= [q
for q
in p
.PowerSystemResources
if q
!= self
]
145 self
._PsrLists
._PowerSystemResources
= filtered
147 if self
not in r
._PowerSystemResources
:
148 r
._PowerSystemResources
.append(self
)
149 self
._PsrLists
= value
151 PsrLists
= property(getPsrLists
, setPsrLists
)
153 def addPsrLists(self
, *PsrLists
):
155 if self
not in obj
._PowerSystemResources
:
156 obj
._PowerSystemResources
.append(self
)
157 self
._PsrLists
.append(obj
)
159 def removePsrLists(self
, *PsrLists
):
161 if self
in obj
._PowerSystemResources
:
162 obj
._PowerSystemResources
.remove(self
)
163 self
._PsrLists
.remove(obj
)
165 def getOperatingShare(self
):
167 return self
._OperatingShare
169 def setOperatingShare(self
, value
):
170 for x
in self
._OperatingShare
:
171 x
.PowerSystemResource
= None
173 y
._PowerSystemResource
= self
174 self
._OperatingShare
= value
176 OperatingShare
= property(getOperatingShare
, setOperatingShare
)
178 def addOperatingShare(self
, *OperatingShare
):
179 for obj
in OperatingShare
:
180 obj
.PowerSystemResource
= self
182 def removeOperatingShare(self
, *OperatingShare
):
183 for obj
in OperatingShare
:
184 obj
.PowerSystemResource
= None
186 def getOutageSchedule(self
):
188 return self
._OutageSchedule
190 def setOutageSchedule(self
, value
):
191 if self
._OutageSchedule
is not None:
192 self
._OutageSchedule
._PowerSystemResource
= None
194 self
._OutageSchedule
= value
195 if self
._OutageSchedule
is not None:
196 self
._OutageSchedule
.PowerSystemResource
= None
197 self
._OutageSchedule
._PowerSystemResource
= self
199 OutageSchedule
= property(getOutageSchedule
, setOutageSchedule
)
201 def getMeasurements(self
):
203 return self
._Measurements
205 def setMeasurements(self
, value
):
206 for x
in self
._Measurements
:
207 x
.PowerSystemResource
= None
209 y
._PowerSystemResource
= self
210 self
._Measurements
= value
212 Measurements
= property(getMeasurements
, setMeasurements
)
214 def addMeasurements(self
, *Measurements
):
215 for obj
in Measurements
:
216 obj
.PowerSystemResource
= self
218 def removeMeasurements(self
, *Measurements
):
219 for obj
in Measurements
:
220 obj
.PowerSystemResource
= None
226 def setAssets(self
, value
):
227 for p
in self
._Assets
:
228 filtered
= [q
for q
in p
.PowerSystemResources
if q
!= self
]
229 self
._Assets
._PowerSystemResources
= filtered
231 if self
not in r
._PowerSystemResources
:
232 r
._PowerSystemResources
.append(self
)
235 Assets
= property(getAssets
, setAssets
)
237 def addAssets(self
, *Assets
):
239 if self
not in obj
._PowerSystemResources
:
240 obj
._PowerSystemResources
.append(self
)
241 self
._Assets
.append(obj
)
243 def removeAssets(self
, *Assets
):
245 if self
in obj
._PowerSystemResources
:
246 obj
._PowerSystemResources
.remove(self
)
247 self
._Assets
.remove(obj
)
249 def getPSRType(self
):
253 def setPSRType(self
, value
):
254 if self
._PSRType
is not None:
255 filtered
= [x
for x
in self
.PSRType
.PowerSystemResources
if x
!= self
]
256 self
._PSRType
._PowerSystemResources
= filtered
258 self
._PSRType
= value
259 if self
._PSRType
is not None:
260 if self
not in self
._PSRType
._PowerSystemResources
:
261 self
._PSRType
._PowerSystemResources
.append(self
)
263 PSRType
= property(getPSRType
, setPSRType
)