Adding class meta-data attributes.
[PyCIM.git] / schemata / CIM14 / IEC61970 / Core / Curve.py
blob7d1cac9eee526f53988a2c534a28ced2fee8107c
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.IdentifiedObject import IdentifiedObject
19 class Curve(IdentifiedObject):
20 """A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) variables.
21 """
23 def __init__(self, y2Multiplier="k", y3Multiplier="k", y1Unit="N", xMultiplier="k", y3Unit="N", xUnit="N", y1Multiplier="k", curveStyle="rampYValue", y2Unit="N", CurveDatas=None, *args, **kw_args):
24 """Initialises a new 'Curve' instance.
26 @param y2Multiplier: Multiplier for Y2-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
27 @param y3Multiplier: Multiplier for Y3-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
28 @param y1Unit: The Y1-axis units of measure. Values are: "N", "VArh", "VA", "none", "m3", "kg/J", "deg", "W/Hz", "g", "Wh", "W/s", "Pa", "V/VAr", "ohm", "h", "F", "H", "m2", "VAr", "A", "rad", "s", "S", "VAh", "Hz", "oC", "s-1", "min", "J", "Hz-1", "J/s", "m", "W", "V"
29 @param xMultiplier: Multiplier for X-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
30 @param y3Unit: The Y3-axis units of measure. Values are: "N", "VArh", "VA", "none", "m3", "kg/J", "deg", "W/Hz", "g", "Wh", "W/s", "Pa", "V/VAr", "ohm", "h", "F", "H", "m2", "VAr", "A", "rad", "s", "S", "VAh", "Hz", "oC", "s-1", "min", "J", "Hz-1", "J/s", "m", "W", "V"
31 @param xUnit: The X-axis units of measure. Values are: "N", "VArh", "VA", "none", "m3", "kg/J", "deg", "W/Hz", "g", "Wh", "W/s", "Pa", "V/VAr", "ohm", "h", "F", "H", "m2", "VAr", "A", "rad", "s", "S", "VAh", "Hz", "oC", "s-1", "min", "J", "Hz-1", "J/s", "m", "W", "V"
32 @param y1Multiplier: Multiplier for Y1-axis Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
33 @param curveStyle: The style or shape of the curve. Values are: "rampYValue", "straightLineYValues", "formula", "constantYValue"
34 @param y2Unit: The Y2-axis units of measure. Values are: "N", "VArh", "VA", "none", "m3", "kg/J", "deg", "W/Hz", "g", "Wh", "W/s", "Pa", "V/VAr", "ohm", "h", "F", "H", "m2", "VAr", "A", "rad", "s", "S", "VAh", "Hz", "oC", "s-1", "min", "J", "Hz-1", "J/s", "m", "W", "V"
35 @param CurveDatas: The point data values that define a curve
36 """
37 #: Multiplier for Y2-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
38 self.y2Multiplier = y2Multiplier
40 #: Multiplier for Y3-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
41 self.y3Multiplier = y3Multiplier
43 #: The Y1-axis units of measure. Values are: "N", "VArh", "VA", "none", "m3", "kg/J", "deg", "W/Hz", "g", "Wh", "W/s", "Pa", "V/VAr", "ohm", "h", "F", "H", "m2", "VAr", "A", "rad", "s", "S", "VAh", "Hz", "oC", "s-1", "min", "J", "Hz-1", "J/s", "m", "W", "V"
44 self.y1Unit = y1Unit
46 #: Multiplier for X-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
47 self.xMultiplier = xMultiplier
49 #: The Y3-axis units of measure. Values are: "N", "VArh", "VA", "none", "m3", "kg/J", "deg", "W/Hz", "g", "Wh", "W/s", "Pa", "V/VAr", "ohm", "h", "F", "H", "m2", "VAr", "A", "rad", "s", "S", "VAh", "Hz", "oC", "s-1", "min", "J", "Hz-1", "J/s", "m", "W", "V"
50 self.y3Unit = y3Unit
52 #: The X-axis units of measure. Values are: "N", "VArh", "VA", "none", "m3", "kg/J", "deg", "W/Hz", "g", "Wh", "W/s", "Pa", "V/VAr", "ohm", "h", "F", "H", "m2", "VAr", "A", "rad", "s", "S", "VAh", "Hz", "oC", "s-1", "min", "J", "Hz-1", "J/s", "m", "W", "V"
53 self.xUnit = xUnit
55 #: Multiplier for Y1-axis Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
56 self.y1Multiplier = y1Multiplier
58 #: The style or shape of the curve. Values are: "rampYValue", "straightLineYValues", "formula", "constantYValue"
59 self.curveStyle = curveStyle
61 #: The Y2-axis units of measure. Values are: "N", "VArh", "VA", "none", "m3", "kg/J", "deg", "W/Hz", "g", "Wh", "W/s", "Pa", "V/VAr", "ohm", "h", "F", "H", "m2", "VAr", "A", "rad", "s", "S", "VAh", "Hz", "oC", "s-1", "min", "J", "Hz-1", "J/s", "m", "W", "V"
62 self.y2Unit = y2Unit
64 self._CurveDatas = []
65 self.CurveDatas = [] if CurveDatas is None else CurveDatas
67 super(Curve, self).__init__(*args, **kw_args)
69 _attrs = ["y2Multiplier", "y3Multiplier", "y1Unit", "xMultiplier", "y3Unit", "xUnit", "y1Multiplier", "curveStyle", "y2Unit"]
70 _attr_types = {"y2Multiplier": str, "y3Multiplier": str, "y1Unit": str, "xMultiplier": str, "y3Unit": str, "xUnit": str, "y1Multiplier": str, "curveStyle": str, "y2Unit": str}
71 _defaults = {"y2Multiplier": "k", "y3Multiplier": "k", "y1Unit": "N", "xMultiplier": "k", "y3Unit": "N", "xUnit": "N", "y1Multiplier": "k", "curveStyle": "rampYValue", "y2Unit": "N"}
72 _enums = {"y2Multiplier": "UnitMultiplier", "y3Multiplier": "UnitMultiplier", "y1Unit": "UnitSymbol", "xMultiplier": "UnitMultiplier", "y3Unit": "UnitSymbol", "xUnit": "UnitSymbol", "y1Multiplier": "UnitMultiplier", "curveStyle": "CurveStyle", "y2Unit": "UnitSymbol"}
73 _refs = ["CurveDatas"]
74 _many_refs = ["CurveDatas"]
76 def getCurveDatas(self):
77 """The point data values that define a curve
78 """
79 return self._CurveDatas
81 def setCurveDatas(self, value):
82 for x in self._CurveDatas:
83 x._Curve = None
84 for y in value:
85 y._Curve = self
86 self._CurveDatas = value
88 CurveDatas = property(getCurveDatas, setCurveDatas)
90 def addCurveDatas(self, *CurveDatas):
91 for obj in CurveDatas:
92 obj._Curve = self
93 self._CurveDatas.append(obj)
95 def removeCurveDatas(self, *CurveDatas):
96 for obj in CurveDatas:
97 obj._Curve = None
98 self._CurveDatas.remove(obj)