Implementing RDF/XML serialisation using meta-data attributes.
[PyCIM.git] / schemata / CIM14 / Dynamics / TieToMeasurement.py
blob2297b2a4f3192ef0508f8a110aa41090833ee0f4
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 self._measurement0._tieToMeasurement0.append(self)
61 measurement0 = property(getmeasurement0, setmeasurement0)
63 def getblock0(self):
65 return self._block0
67 def setblock0(self, value):
68 if self._block0 is not None:
69 filtered = [x for x in self.block0.tieToMeasurement0 if x != self]
70 self._block0._tieToMeasurement0 = filtered
72 self._block0 = value
73 if self._block0 is not None:
74 self._block0._tieToMeasurement0.append(self)
76 block0 = property(getblock0, setblock0)
78 def getmetaBlockInput0(self):
79 """The identified block input to which this measurement applies. Note this applies only to the external interface of blocks.
80 """
81 return self._metaBlockInput0
83 def setmetaBlockInput0(self, value):
84 if self._metaBlockInput0 is not None:
85 filtered = [x for x in self.metaBlockInput0.tieToMeasurement0 if x != self]
86 self._metaBlockInput0._tieToMeasurement0 = filtered
88 self._metaBlockInput0 = value
89 if self._metaBlockInput0 is not None:
90 self._metaBlockInput0._tieToMeasurement0.append(self)
92 metaBlockInput0 = property(getmetaBlockInput0, setmetaBlockInput0)