Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / LoadModel / PowerCutZone.py
blobc53d739e4c6fd7306f209428a6bab5998543ca7c
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
19 # IN THE SOFTWARE.
21 from CIM14.IEC61970.Core.PowerSystemResource import PowerSystemResource
23 class PowerCutZone(PowerSystemResource):
24 """An area or zone of the power system which is used for load shedding purposes.
25 """
27 def __init__(self, cutLevel1=0.0, cutLevel2=0.0, EnergyConsumers=None, *args, **kw_args):
28 """Initialises a new 'PowerCutZone' instance.
30 @param cutLevel1: First level (amount) of load to cut as a percentage of total zone load
31 @param cutLevel2: Second level (amount) of load to cut as a percentage of total zone load
32 @param EnergyConsumers: An energy consumer is assigned to a power cut zone
33 """
34 #: First level (amount) of load to cut as a percentage of total zone load
35 self.cutLevel1 = cutLevel1
37 #: Second level (amount) of load to cut as a percentage of total zone load
38 self.cutLevel2 = cutLevel2
40 self._EnergyConsumers = []
41 self.EnergyConsumers = [] if EnergyConsumers is None else EnergyConsumers
43 super(PowerCutZone, self).__init__(*args, **kw_args)
45 _attrs = ["cutLevel1", "cutLevel2"]
46 _attr_types = {"cutLevel1": float, "cutLevel2": float}
47 _defaults = {"cutLevel1": 0.0, "cutLevel2": 0.0}
48 _enums = {}
49 _refs = ["EnergyConsumers"]
50 _many_refs = ["EnergyConsumers"]
52 def getEnergyConsumers(self):
53 """An energy consumer is assigned to a power cut zone
54 """
55 return self._EnergyConsumers
57 def setEnergyConsumers(self, value):
58 for x in self._EnergyConsumers:
59 x.PowerCutZone = None
60 for y in value:
61 y._PowerCutZone = self
62 self._EnergyConsumers = value
64 EnergyConsumers = property(getEnergyConsumers, setEnergyConsumers)
66 def addEnergyConsumers(self, *EnergyConsumers):
67 for obj in EnergyConsumers:
68 obj.PowerCutZone = self
70 def removeEnergyConsumers(self, *EnergyConsumers):
71 for obj in EnergyConsumers:
72 obj.PowerCutZone = None