Implementing RDF/XML serialisation using meta-data attributes.
[PyCIM.git] / schemata / CIM14 / IEC61970 / Generation / Production / EmissionAccount.py
blobbc52a7e5d291170a9f0eea6a2d412cf85c86276a
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 EmissionAccount(Curve):
20 """Accounts for tracking emissions usage and credits for thermal generating units. A unit may have zero or more emission accounts, and will typically have one for tracking usage and one for tracking credits.
21 """
23 def __init__(self, emissionType="chlorine", emissionValueSource="measured", ThermalGeneratingUnit=None, *args, **kw_args):
24 """Initialises a new 'EmissionAccount' instance.
26 @param emissionType: The type of emission, for example sulfur dioxide (SO2). The y1AxisUnits of the curve contains the unit of measure (e.g. kg) and the emissionType is the type of emission (e.g. sulfer dioxide). Values are: "chlorine", "carbonDioxide", "hydrogenSulfide", "nitrogenOxide", "sulfurDioxide", "carbonDisulfide"
27 @param emissionValueSource: The source of the emission value. Values are: "measured", "calculated"
28 @param ThermalGeneratingUnit: A thermal generating unit may have one or more emission allowance accounts
29 """
30 #: The type of emission, for example sulfur dioxide (SO2). The y1AxisUnits of the curve contains the unit of measure (e.g. kg) and the emissionType is the type of emission (e.g. sulfer dioxide). Values are: "chlorine", "carbonDioxide", "hydrogenSulfide", "nitrogenOxide", "sulfurDioxide", "carbonDisulfide"
31 self.emissionType = emissionType
33 #: The source of the emission value. Values are: "measured", "calculated"
34 self.emissionValueSource = emissionValueSource
36 self._ThermalGeneratingUnit = None
37 self.ThermalGeneratingUnit = ThermalGeneratingUnit
39 super(EmissionAccount, self).__init__(*args, **kw_args)
41 _attrs = ["emissionType", "emissionValueSource"]
42 _attr_types = {"emissionType": str, "emissionValueSource": str}
43 _defaults = {"emissionType": "chlorine", "emissionValueSource": "measured"}
44 _enums = {"emissionType": "EmissionType", "emissionValueSource": "EmissionValueSource"}
45 _refs = ["ThermalGeneratingUnit"]
46 _many_refs = []
48 def getThermalGeneratingUnit(self):
49 """A thermal generating unit may have one or more emission allowance accounts
50 """
51 return self._ThermalGeneratingUnit
53 def setThermalGeneratingUnit(self, value):
54 if self._ThermalGeneratingUnit is not None:
55 filtered = [x for x in self.ThermalGeneratingUnit.EmmissionAccounts if x != self]
56 self._ThermalGeneratingUnit._EmmissionAccounts = filtered
58 self._ThermalGeneratingUnit = value
59 if self._ThermalGeneratingUnit is not None:
60 self._ThermalGeneratingUnit._EmmissionAccounts.append(self)
62 ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit)