Adding CDPSM package.
[PyCIM.git] / CIM14 / Dynamics / BlockConnection.py
blobbca7632b7fdb1ba5c550b2dca1ea8f0da95dcdb4
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 BlockConnection(IdentifiedObject):
20 """A meta-dyanamics model connectivity specification.
21 """
23 def __init__(self, MetaBlockConnection=None, MemberOf_BlockConnectivity=None, Block=None, *args, **kw_args):
24 """Initialises a new 'BlockConnection' instance.
26 @param MetaBlockConnection:
27 @param MemberOf_BlockConnectivity:
28 @param Block:
29 """
30 self._MetaBlockConnection = None
31 self.MetaBlockConnection = MetaBlockConnection
33 self._MemberOf_BlockConnectivity = None
34 self.MemberOf_BlockConnectivity = MemberOf_BlockConnectivity
36 self._Block = None
37 self.Block = Block
39 super(BlockConnection, self).__init__(*args, **kw_args)
41 _attrs = []
42 _attr_types = {}
43 _defaults = {}
44 _enums = {}
45 _refs = ["MetaBlockConnection", "MemberOf_BlockConnectivity", "Block"]
46 _many_refs = []
48 def getMetaBlockConnection(self):
50 return self._MetaBlockConnection
52 def setMetaBlockConnection(self, value):
53 if self._MetaBlockConnection is not None:
54 filtered = [x for x in self.MetaBlockConnection.BlockConnection if x != self]
55 self._MetaBlockConnection._BlockConnection = filtered
57 self._MetaBlockConnection = value
58 if self._MetaBlockConnection is not None:
59 if self not in self._MetaBlockConnection._BlockConnection:
60 self._MetaBlockConnection._BlockConnection.append(self)
62 MetaBlockConnection = property(getMetaBlockConnection, setMetaBlockConnection)
64 def getMemberOf_BlockConnectivity(self):
66 return self._MemberOf_BlockConnectivity
68 def setMemberOf_BlockConnectivity(self, value):
69 if self._MemberOf_BlockConnectivity is not None:
70 filtered = [x for x in self.MemberOf_BlockConnectivity.BlockConnection if x != self]
71 self._MemberOf_BlockConnectivity._BlockConnection = filtered
73 self._MemberOf_BlockConnectivity = value
74 if self._MemberOf_BlockConnectivity is not None:
75 if self not in self._MemberOf_BlockConnectivity._BlockConnection:
76 self._MemberOf_BlockConnectivity._BlockConnection.append(self)
78 MemberOf_BlockConnectivity = property(getMemberOf_BlockConnectivity, setMemberOf_BlockConnectivity)
80 def getBlock(self):
82 return self._Block
84 def setBlock(self, value):
85 if self._Block is not None:
86 filtered = [x for x in self.Block.BlockConnection if x != self]
87 self._Block._BlockConnection = filtered
89 self._Block = value
90 if self._Block is not None:
91 if self not in self._Block._BlockConnection:
92 self._Block._BlockConnection.append(self)
94 Block = property(getBlock, setBlock)