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
.LoadModel
.LoadGroup
import LoadGroup
19 class ConformLoadGroup(LoadGroup
):
20 """A group of loads conforming to an allocation pattern.
23 def __init__(self
, ConformLoadSchedules
=None, EnergyConsumers
=None, *args
, **kw_args
):
24 """Initialises a new 'ConformLoadGroup' instance.
26 @param ConformLoadSchedules: The ConformLoadSchedules in the ConformLoadGroup.
27 @param EnergyConsumers: Conform loads assigned to this ConformLoadGroup.
29 self
._ConformLoadSchedules
= []
30 self
.ConformLoadSchedules
= [] if ConformLoadSchedules
is None else ConformLoadSchedules
32 self
._EnergyConsumers
= []
33 self
.EnergyConsumers
= [] if EnergyConsumers
is None else EnergyConsumers
35 super(ConformLoadGroup
, self
).__init
__(*args
, **kw_args
)
41 _refs
= ["ConformLoadSchedules", "EnergyConsumers"]
42 _many_refs
= ["ConformLoadSchedules", "EnergyConsumers"]
44 def getConformLoadSchedules(self
):
45 """The ConformLoadSchedules in the ConformLoadGroup.
47 return self
._ConformLoadSchedules
49 def setConformLoadSchedules(self
, value
):
50 for x
in self
._ConformLoadSchedules
:
51 x
._ConformLoadGroup
= None
53 y
._ConformLoadGroup
= self
54 self
._ConformLoadSchedules
= value
56 ConformLoadSchedules
= property(getConformLoadSchedules
, setConformLoadSchedules
)
58 def addConformLoadSchedules(self
, *ConformLoadSchedules
):
59 for obj
in ConformLoadSchedules
:
60 obj
._ConformLoadGroup
= self
61 self
._ConformLoadSchedules
.append(obj
)
63 def removeConformLoadSchedules(self
, *ConformLoadSchedules
):
64 for obj
in ConformLoadSchedules
:
65 obj
._ConformLoadGroup
= None
66 self
._ConformLoadSchedules
.remove(obj
)
68 def getEnergyConsumers(self
):
69 """Conform loads assigned to this ConformLoadGroup.
71 return self
._EnergyConsumers
73 def setEnergyConsumers(self
, value
):
74 for x
in self
._EnergyConsumers
:
78 self
._EnergyConsumers
= value
80 EnergyConsumers
= property(getEnergyConsumers
, setEnergyConsumers
)
82 def addEnergyConsumers(self
, *EnergyConsumers
):
83 for obj
in EnergyConsumers
:
85 self
._EnergyConsumers
.append(obj
)
87 def removeEnergyConsumers(self
, *EnergyConsumers
):
88 for obj
in EnergyConsumers
:
90 self
._EnergyConsumers
.remove(obj
)