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.
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:
30 self
._MetaBlockConnection
= None
31 self
.MetaBlockConnection
= MetaBlockConnection
33 self
._MemberOf
_BlockConnectivity
= None
34 self
.MemberOf_BlockConnectivity
= MemberOf_BlockConnectivity
39 super(BlockConnection
, self
).__init
__(*args
, **kw_args
)
45 _refs
= ["MetaBlockConnection", "MemberOf_BlockConnectivity", "Block"]
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 self
._MetaBlockConnection
._BlockConnection
.append(self
)
61 MetaBlockConnection
= property(getMetaBlockConnection
, setMetaBlockConnection
)
63 def getMemberOf_BlockConnectivity(self
):
65 return self
._MemberOf
_BlockConnectivity
67 def setMemberOf_BlockConnectivity(self
, value
):
68 if self
._MemberOf
_BlockConnectivity
is not None:
69 filtered
= [x
for x
in self
.MemberOf_BlockConnectivity
.BlockConnection
if x
!= self
]
70 self
._MemberOf
_BlockConnectivity
._BlockConnection
= filtered
72 self
._MemberOf
_BlockConnectivity
= value
73 if self
._MemberOf
_BlockConnectivity
is not None:
74 self
._MemberOf
_BlockConnectivity
._BlockConnection
.append(self
)
76 MemberOf_BlockConnectivity
= property(getMemberOf_BlockConnectivity
, setMemberOf_BlockConnectivity
)
82 def setBlock(self
, value
):
83 if self
._Block
is not None:
84 filtered
= [x
for x
in self
.Block
.BlockConnection
if x
!= self
]
85 self
._Block
._BlockConnection
= filtered
88 if self
._Block
is not None:
89 self
._Block
._BlockConnection
.append(self
)
91 Block
= property(getBlock
, setBlock
)