Update README.rst
[PyCIM.git] / CIM14 / CPSM / Equipment / Meas / Analog.py
blob5d8edd583df72b17da0edcf4c91a41e6aca4944a
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.CPSM.Equipment.Meas.Measurement import Measurement
23 class Analog(Measurement):
24 """Analog represents an analog Measurement.- The positiveFlowIn attribute is only required if the Measurement measures a directional flow of power. - The association to Terminal may not be required depending on how the Measurement is being used. See section Use of Measurement Class for details. - The MeasurementType class is used to define the quantity being measured (Voltage, ThreePhaseActivePower, etc.) by a Measurement. A Measurement must be associated with one and only one measurementType. The valid values for MeasurementType.name are defined in Normative String Tables.
25 """
27 def __init__(self, positiveFlowIn=False, AnalogValues=None, *args, **kw_args):
28 """Initialises a new 'Analog' instance.
30 @param positiveFlowIn: If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource.
31 @param AnalogValues: The values connected to this measurement.
32 """
33 #: If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource.
34 self.positiveFlowIn = positiveFlowIn
36 self._AnalogValues = []
37 self.AnalogValues = [] if AnalogValues is None else AnalogValues
39 super(Analog, self).__init__(*args, **kw_args)
41 _attrs = ["positiveFlowIn"]
42 _attr_types = {"positiveFlowIn": bool}
43 _defaults = {"positiveFlowIn": False}
44 _enums = {}
45 _refs = ["AnalogValues"]
46 _many_refs = ["AnalogValues"]
48 def getAnalogValues(self):
49 """The values connected to this measurement.
50 """
51 return self._AnalogValues
53 def setAnalogValues(self, value):
54 for x in self._AnalogValues:
55 x.Analog = None
56 for y in value:
57 y._Analog = self
58 self._AnalogValues = value
60 AnalogValues = property(getAnalogValues, setAnalogValues)
62 def addAnalogValues(self, *AnalogValues):
63 for obj in AnalogValues:
64 obj.Analog = self
66 def removeAnalogValues(self, *AnalogValues):
67 for obj in AnalogValues:
68 obj.Analog = None