Adding CDPSM package.
[PyCIM.git] / CIM14 / Dynamics / TieToMeasurement.py
blob44dbdea6a2c49580cea36840a4e3dc84c68e29db
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.Core.IdentifiedObject import IdentifiedObject
19 class TieToMeasurement(IdentifiedObject):
20 """Ties a block input to a specific state variable measurment. Thus giving a unit type, a location in the network (typically a terminal). A specific value is not given, just enough information to obtain the value from the model during a solution. This has nothing to do with SCADA.
21 """
23 def __init__(self, measurement0=None, block0=None, metaBlockInput0=None, *args, **kw_args):
24 """Initialises a new 'TieToMeasurement' instance.
26 @param measurement0:
27 @param block0:
28 @param metaBlockInput0: The identified block input to which this measurement applies. Note this applies only to the external interface of blocks.
29 """
30 self._measurement0 = None
31 self.measurement0 = measurement0
33 self._block0 = None
34 self.block0 = block0
36 self._metaBlockInput0 = None
37 self.metaBlockInput0 = metaBlockInput0
39 super(TieToMeasurement, self).__init__(*args, **kw_args)
41 _attrs = []
42 _attr_types = {}
43 _defaults = {}
44 _enums = {}
45 _refs = ["measurement0", "block0", "metaBlockInput0"]
46 _many_refs = []
48 def getmeasurement0(self):
50 return self._measurement0
52 def setmeasurement0(self, value):
53 if self._measurement0 is not None:
54 filtered = [x for x in self.measurement0.tieToMeasurement0 if x != self]
55 self._measurement0._tieToMeasurement0 = filtered
57 self._measurement0 = value
58 if self._measurement0 is not None:
59 if self not in self._measurement0._tieToMeasurement0:
60 self._measurement0._tieToMeasurement0.append(self)
62 measurement0 = property(getmeasurement0, setmeasurement0)
64 def getblock0(self):
66 return self._block0
68 def setblock0(self, value):
69 if self._block0 is not None:
70 filtered = [x for x in self.block0.tieToMeasurement0 if x != self]
71 self._block0._tieToMeasurement0 = filtered
73 self._block0 = value
74 if self._block0 is not None:
75 if self not in self._block0._tieToMeasurement0:
76 self._block0._tieToMeasurement0.append(self)
78 block0 = property(getblock0, setblock0)
80 def getmetaBlockInput0(self):
81 """The identified block input to which this measurement applies. Note this applies only to the external interface of blocks.
82 """
83 return self._metaBlockInput0
85 def setmetaBlockInput0(self, value):
86 if self._metaBlockInput0 is not None:
87 filtered = [x for x in self.metaBlockInput0.tieToMeasurement0 if x != self]
88 self._metaBlockInput0._tieToMeasurement0 = filtered
90 self._metaBlockInput0 = value
91 if self._metaBlockInput0 is not None:
92 if self not in self._metaBlockInput0._tieToMeasurement0:
93 self._metaBlockInput0._tieToMeasurement0.append(self)
95 metaBlockInput0 = property(getmetaBlockInput0, setmetaBlockInput0)