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
21 from CIM14
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class Curve(IdentifiedObject
):
24 """A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) variables.
27 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
):
28 """Initialises a new 'Curve' instance.
30 @param y2Multiplier: Multiplier for Y2-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
31 @param y3Multiplier: Multiplier for Y3-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
32 @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"
33 @param xMultiplier: Multiplier for X-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
34 @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"
35 @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"
36 @param y1Multiplier: Multiplier for Y1-axis Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
37 @param curveStyle: The style or shape of the curve. Values are: "rampYValue", "straightLineYValues", "formula", "constantYValue"
38 @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"
39 @param CurveDatas: The point data values that define a curve
41 #: Multiplier for Y2-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
42 self
.y2Multiplier
= y2Multiplier
44 #: Multiplier for Y3-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
45 self
.y3Multiplier
= y3Multiplier
47 #: 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"
50 #: Multiplier for X-axis. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
51 self
.xMultiplier
= xMultiplier
53 #: 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"
56 #: 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"
59 #: Multiplier for Y1-axis Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
60 self
.y1Multiplier
= y1Multiplier
62 #: The style or shape of the curve. Values are: "rampYValue", "straightLineYValues", "formula", "constantYValue"
63 self
.curveStyle
= curveStyle
65 #: 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"
69 self
.CurveDatas
= [] if CurveDatas
is None else CurveDatas
71 super(Curve
, self
).__init
__(*args
, **kw_args
)
73 _attrs
= ["y2Multiplier", "y3Multiplier", "y1Unit", "xMultiplier", "y3Unit", "xUnit", "y1Multiplier", "curveStyle", "y2Unit"]
74 _attr_types
= {"y2Multiplier": str, "y3Multiplier": str, "y1Unit": str, "xMultiplier": str, "y3Unit": str, "xUnit": str, "y1Multiplier": str, "curveStyle": str, "y2Unit": str}
75 _defaults
= {"y2Multiplier": "k", "y3Multiplier": "k", "y1Unit": "N", "xMultiplier": "k", "y3Unit": "N", "xUnit": "N", "y1Multiplier": "k", "curveStyle": "rampYValue", "y2Unit": "N"}
76 _enums
= {"y2Multiplier": "UnitMultiplier", "y3Multiplier": "UnitMultiplier", "y1Unit": "UnitSymbol", "xMultiplier": "UnitMultiplier", "y3Unit": "UnitSymbol", "xUnit": "UnitSymbol", "y1Multiplier": "UnitMultiplier", "curveStyle": "CurveStyle", "y2Unit": "UnitSymbol"}
77 _refs
= ["CurveDatas"]
78 _many_refs
= ["CurveDatas"]
80 def getCurveDatas(self
):
81 """The point data values that define a curve
83 return self
._CurveDatas
85 def setCurveDatas(self
, value
):
86 for x
in self
._CurveDatas
:
90 self
._CurveDatas
= value
92 CurveDatas
= property(getCurveDatas
, setCurveDatas
)
94 def addCurveDatas(self
, *CurveDatas
):
95 for obj
in CurveDatas
:
98 def removeCurveDatas(self
, *CurveDatas
):
99 for obj
in CurveDatas
: