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 MetaBlockOutputReference(IdentifiedObject
):
21 def __init__(self
, MetaBlockConnectable
=None, MemberOf_MetaBlockReference
=None, MetaBlockSignal
=None, StandardControlBlock_MetaBlockConnectable
=None, *args
, **kw_args
):
22 """Initialises a new 'MetaBlockOutputReference' instance.
24 @param MetaBlockConnectable:
25 @param MemberOf_MetaBlockReference:
26 @param MetaBlockSignal:
27 @param StandardControlBlock_MetaBlockConnectable:
29 self
._MetaBlockConnectable
= None
30 self
.MetaBlockConnectable
= MetaBlockConnectable
32 self
._MemberOf
_MetaBlockReference
= None
33 self
.MemberOf_MetaBlockReference
= MemberOf_MetaBlockReference
35 self
._MetaBlockSignal
= []
36 self
.MetaBlockSignal
= [] if MetaBlockSignal
is None else MetaBlockSignal
38 self
._StandardControlBlock
_MetaBlockConnectable
= None
39 self
.StandardControlBlock_MetaBlockConnectable
= StandardControlBlock_MetaBlockConnectable
41 super(MetaBlockOutputReference
, self
).__init
__(*args
, **kw_args
)
47 _refs
= ["MetaBlockConnectable", "MemberOf_MetaBlockReference", "MetaBlockSignal", "StandardControlBlock_MetaBlockConnectable"]
48 _many_refs
= ["MetaBlockSignal"]
50 def getMetaBlockConnectable(self
):
52 return self
._MetaBlockConnectable
54 def setMetaBlockConnectable(self
, value
):
55 if self
._MetaBlockConnectable
is not None:
56 filtered
= [x
for x
in self
.MetaBlockConnectable
.MetaBlockOutputReference
if x
!= self
]
57 self
._MetaBlockConnectable
._MetaBlockOutputReference
= filtered
59 self
._MetaBlockConnectable
= value
60 if self
._MetaBlockConnectable
is not None:
61 self
._MetaBlockConnectable
._MetaBlockOutputReference
.append(self
)
63 MetaBlockConnectable
= property(getMetaBlockConnectable
, setMetaBlockConnectable
)
65 def getMemberOf_MetaBlockReference(self
):
67 return self
._MemberOf
_MetaBlockReference
69 def setMemberOf_MetaBlockReference(self
, value
):
70 if self
._MemberOf
_MetaBlockReference
is not None:
71 filtered
= [x
for x
in self
.MemberOf_MetaBlockReference
.MetaBlockOutputReference
if x
!= self
]
72 self
._MemberOf
_MetaBlockReference
._MetaBlockOutputReference
= filtered
74 self
._MemberOf
_MetaBlockReference
= value
75 if self
._MemberOf
_MetaBlockReference
is not None:
76 self
._MemberOf
_MetaBlockReference
._MetaBlockOutputReference
.append(self
)
78 MemberOf_MetaBlockReference
= property(getMemberOf_MetaBlockReference
, setMemberOf_MetaBlockReference
)
80 def getMetaBlockSignal(self
):
82 return self
._MetaBlockSignal
84 def setMetaBlockSignal(self
, value
):
85 for x
in self
._MetaBlockSignal
:
89 self
._MetaBlockSignal
= value
91 MetaBlockSignal
= property(getMetaBlockSignal
, setMetaBlockSignal
)
93 def addMetaBlockSignal(self
, *MetaBlockSignal
):
94 for obj
in MetaBlockSignal
:
96 self
._MetaBlockSignal
.append(obj
)
98 def removeMetaBlockSignal(self
, *MetaBlockSignal
):
99 for obj
in MetaBlockSignal
:
101 self
._MetaBlockSignal
.remove(obj
)
103 def getStandardControlBlock_MetaBlockConnectable(self
):
105 return self
._StandardControlBlock
_MetaBlockConnectable
107 def setStandardControlBlock_MetaBlockConnectable(self
, value
):
108 if self
._StandardControlBlock
_MetaBlockConnectable
is not None:
109 filtered
= [x
for x
in self
.StandardControlBlock_MetaBlockConnectable
.StandardControlBlock_MetaBlockOutputReference
if x
!= self
]
110 self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockOutputReference
= filtered
112 self
._StandardControlBlock
_MetaBlockConnectable
= value
113 if self
._StandardControlBlock
_MetaBlockConnectable
is not None:
114 self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockOutputReference
.append(self
)
116 StandardControlBlock_MetaBlockConnectable
= property(getStandardControlBlock_MetaBlockConnectable
, setStandardControlBlock_MetaBlockConnectable
)