Adding CDPSM package.
[PyCIM.git] / CIM14 / IEC61970 / Generation / Production / TailbayLossCurve.py
blob8cbdef805fbcc33496b6c09d53c175f9db3c7fc7
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.Core.Curve import Curve
19 class TailbayLossCurve(Curve):
20 """Relationship between tailbay head loss hight (y-axis) and the total discharge into the power station's tailbay volume per time unit (x-axis) . There could be more than one curve depending on the level of the tailbay reservoir or river level
21 """
23 def __init__(self, HydroGeneratingUnit=None, *args, **kw_args):
24 """Initialises a new 'TailbayLossCurve' instance.
26 @param HydroGeneratingUnit: A hydro generating unit has a tailbay loss curve
27 """
28 self._HydroGeneratingUnit = None
29 self.HydroGeneratingUnit = HydroGeneratingUnit
31 super(TailbayLossCurve, self).__init__(*args, **kw_args)
33 _attrs = []
34 _attr_types = {}
35 _defaults = {}
36 _enums = {}
37 _refs = ["HydroGeneratingUnit"]
38 _many_refs = []
40 def getHydroGeneratingUnit(self):
41 """A hydro generating unit has a tailbay loss curve
42 """
43 return self._HydroGeneratingUnit
45 def setHydroGeneratingUnit(self, value):
46 if self._HydroGeneratingUnit is not None:
47 filtered = [x for x in self.HydroGeneratingUnit.TailbayLossCurve if x != self]
48 self._HydroGeneratingUnit._TailbayLossCurve = filtered
50 self._HydroGeneratingUnit = value
51 if self._HydroGeneratingUnit is not None:
52 if self not in self._HydroGeneratingUnit._TailbayLossCurve:
53 self._HydroGeneratingUnit._TailbayLossCurve.append(self)
55 HydroGeneratingUnit = property(getHydroGeneratingUnit, setHydroGeneratingUnit)