Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Meas / SetPoint.py
blob277edd71f4157521b3cffb5c121a0ce48160d6fd
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
19 # IN THE SOFTWARE.
21 from CIM14.IEC61970.Meas.Control import Control
23 class SetPoint(Control):
24 """A SetPoint is an analog control used for supervisory control.
25 """
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
35 """
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
40 self.value = value
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
48 self._Analog = None
49 self.Analog = Analog
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}
56 _enums = {}
57 _refs = ["Analog"]
58 _many_refs = []
60 def getAnalog(self):
61 """The Measurement variable used for control
62 """
63 return self._Analog
65 def setAnalog(self, value):
66 if self._Analog is not None:
67 self._Analog._SetPoint = None
69 self._Analog = value
70 if self._Analog is not None:
71 self._Analog.SetPoint = None
72 self._Analog._SetPoint = self
74 Analog = property(getAnalog, setAnalog)