Adding CIM15 package.
[PyCIM.git] / CIM15 / IEC61970 / Informative / InfLoadControl / LoadMgmtRecord.py
blob264a80cb6692b6e21890a704614c5909eed67145
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 CIM15.IEC61968.Common.ActivityRecord import ActivityRecord
23 class LoadMgmtRecord(ActivityRecord):
24 """A log of actual measured load reductions as a result of load shed operations.A log of actual measured load reductions as a result of load shed operations.
25 """
27 def __init__(self, loadReduction=0.0, LoadMgmtFunction=None, *args, **kw_args):
28 """Initialises a new 'LoadMgmtRecord' instance.
30 @param loadReduction: The measured reduction of the total load power as a result of the load shed activation. Thus it is the difference in power before and after the load shed operation.
31 @param LoadMgmtFunction:
32 """
33 #: The measured reduction of the total load power as a result of the load shed activation. Thus it is the difference in power before and after the load shed operation.
34 self.loadReduction = loadReduction
36 self._LoadMgmtFunction = None
37 self.LoadMgmtFunction = LoadMgmtFunction
39 super(LoadMgmtRecord, self).__init__(*args, **kw_args)
41 _attrs = ["loadReduction"]
42 _attr_types = {"loadReduction": float}
43 _defaults = {"loadReduction": 0.0}
44 _enums = {}
45 _refs = ["LoadMgmtFunction"]
46 _many_refs = []
48 def getLoadMgmtFunction(self):
50 return self._LoadMgmtFunction
52 def setLoadMgmtFunction(self, value):
53 if self._LoadMgmtFunction is not None:
54 filtered = [x for x in self.LoadMgmtFunction.LoadMgmtRecords if x != self]
55 self._LoadMgmtFunction._LoadMgmtRecords = filtered
57 self._LoadMgmtFunction = value
58 if self._LoadMgmtFunction is not None:
59 if self not in self._LoadMgmtFunction._LoadMgmtRecords:
60 self._LoadMgmtFunction._LoadMgmtRecords.append(self)
62 LoadMgmtFunction = property(getLoadMgmtFunction, setLoadMgmtFunction)