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
.SCADA
.RemotePoint
import RemotePoint
19 class RemoteSource(RemotePoint
):
20 """Remote sources are state variables that are telemetered or calculated within the remote unit.
23 def __init__(self
, scanInterval
=0.0, sensorMaximum
=0.0, deadband
=0.0, sensorMinimum
=0.0, MeasurementValue
=None, *args
, **kw_args
):
24 """Initialises a new 'RemoteSource' instance.
26 @param scanInterval: The time interval between scans.
27 @param sensorMaximum: The maximum value the telemetry item can return.
28 @param deadband: The smallest change in value to be reported.
29 @param sensorMinimum: The minimum value the telemetry item can return.
30 @param MeasurementValue: Link to the physical telemetered point associated with this measurement.
32 #: The time interval between scans.
33 self
.scanInterval
= scanInterval
35 #: The maximum value the telemetry item can return.
36 self
.sensorMaximum
= sensorMaximum
38 #: The smallest change in value to be reported.
39 self
.deadband
= deadband
41 #: The minimum value the telemetry item can return.
42 self
.sensorMinimum
= sensorMinimum
44 self
._MeasurementValue
= None
45 self
.MeasurementValue
= MeasurementValue
47 super(RemoteSource
, self
).__init
__(*args
, **kw_args
)
49 _attrs
= ["scanInterval", "sensorMaximum", "deadband", "sensorMinimum"]
50 _attr_types
= {"scanInterval": float, "sensorMaximum": float, "deadband": float, "sensorMinimum": float}
51 _defaults
= {"scanInterval": 0.0, "sensorMaximum": 0.0, "deadband": 0.0, "sensorMinimum": 0.0}
53 _refs
= ["MeasurementValue"]
56 def getMeasurementValue(self
):
57 """Link to the physical telemetered point associated with this measurement.
59 return self
._MeasurementValue
61 def setMeasurementValue(self
, value
):
62 if self
._MeasurementValue
is not None:
63 self
._MeasurementValue
._RemoteSource
= None
65 self
._MeasurementValue
= value
66 if self
._MeasurementValue
is not None:
67 self
._MeasurementValue
._RemoteSource
= self
69 MeasurementValue
= property(getMeasurementValue
, setMeasurementValue
)