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
.Element
import Element
19 class OperatingShare(Element
):
20 """Specifies the contract relationship between a PowerSystemResource and a contract participant.
23 def __init__(self
, percentage
=0.0, PowerSystemResource
=None, OperatingParticipant
=None, *args
, **kw_args
):
24 """Initialises a new 'OperatingShare' instance.
26 @param percentage: Percentage ownership for this device. The percentage indicates the percentage ownership of the PSROwner for the PowerSystemResource. The total percentage ownership for a PowerSystemResource should add to 100%.
27 @param PowerSystemResource: The PowerSystemResource to which the attribues apply. The percentage ownership of all owners of a PowerSystemResource should add to 100%.
28 @param OperatingParticipant: The linkage to a owners and its linkage attributes like percentage ownership. The ownership percentage should add to 100% for all owners of a PowerSystemResource, but a PSROwner may own any percentage of any number of PowerSystemResource objects.
30 #: Percentage ownership for this device. The percentage indicates the percentage ownership of the PSROwner for the PowerSystemResource. The total percentage ownership for a PowerSystemResource should add to 100%.
31 self
.percentage
= percentage
33 self
._PowerSystemResource
= None
34 self
.PowerSystemResource
= PowerSystemResource
36 self
._OperatingParticipant
= None
37 self
.OperatingParticipant
= OperatingParticipant
39 super(OperatingShare
, self
).__init
__(*args
, **kw_args
)
41 _attrs
= ["percentage"]
42 _attr_types
= {"percentage": float}
43 _defaults
= {"percentage": 0.0}
45 _refs
= ["PowerSystemResource", "OperatingParticipant"]
48 def getPowerSystemResource(self
):
49 """The PowerSystemResource to which the attribues apply. The percentage ownership of all owners of a PowerSystemResource should add to 100%.
51 return self
._PowerSystemResource
53 def setPowerSystemResource(self
, value
):
54 if self
._PowerSystemResource
is not None:
55 filtered
= [x
for x
in self
.PowerSystemResource
.OperatingShare
if x
!= self
]
56 self
._PowerSystemResource
._OperatingShare
= filtered
58 self
._PowerSystemResource
= value
59 if self
._PowerSystemResource
is not None:
60 self
._PowerSystemResource
._OperatingShare
.append(self
)
62 PowerSystemResource
= property(getPowerSystemResource
, setPowerSystemResource
)
64 def getOperatingParticipant(self
):
65 """The linkage to a owners and its linkage attributes like percentage ownership. The ownership percentage should add to 100% for all owners of a PowerSystemResource, but a PSROwner may own any percentage of any number of PowerSystemResource objects.
67 return self
._OperatingParticipant
69 def setOperatingParticipant(self
, value
):
70 if self
._OperatingParticipant
is not None:
71 filtered
= [x
for x
in self
.OperatingParticipant
.OperatingShare
if x
!= self
]
72 self
._OperatingParticipant
._OperatingShare
= filtered
74 self
._OperatingParticipant
= value
75 if self
._OperatingParticipant
is not None:
76 self
._OperatingParticipant
._OperatingShare
.append(self
)
78 OperatingParticipant
= property(getOperatingParticipant
, setOperatingParticipant
)