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
.Meas
.Control
import Control
23 class SetPoint(Control
):
24 """A SetPoint is an analog control used for supervisory control.
27 def __init__(self
, minValue
=0.0, value
=0.0, maxValue
=0.0, normalValue
=0.0, Analog
=None, *args
, **kw_args
):
28 """Initialises a new 'SetPoint' instance.
30 @param minValue: Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs.
31 @param value: The value representing the actuator output
32 @param maxValue: Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs.
33 @param normalValue: Normal value for Control.value e.g. used for percentage scaling
34 @param Analog: The Measurement variable used for control
36 #: Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs.
37 self
.minValue
= minValue
39 #: The value representing the actuator output
42 #: Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs.
43 self
.maxValue
= maxValue
45 #: Normal value for Control.value e.g. used for percentage scaling
46 self
.normalValue
= normalValue
51 super(SetPoint
, self
).__init
__(*args
, **kw_args
)
53 _attrs
= ["minValue", "value", "maxValue", "normalValue"]
54 _attr_types
= {"minValue": float, "value": float, "maxValue": float, "normalValue": float}
55 _defaults
= {"minValue": 0.0, "value": 0.0, "maxValue": 0.0, "normalValue": 0.0}
61 """The Measurement variable used for control
65 def setAnalog(self
, value
):
66 if self
._Analog
is not None:
67 self
._Analog
._SetPoint
= None
70 if self
._Analog
is not None:
71 self
._Analog
.SetPoint
= None
72 self
._Analog
._SetPoint
= self
74 Analog
= property(getAnalog
, setAnalog
)