1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 from CIM14
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class MetaBlockOutputReference(IdentifiedObject
):
25 def __init__(self
, MetaBlockConnectable
=None, MemberOf_MetaBlockReference
=None, MetaBlockSignal
=None, StandardControlBlock_MetaBlockConnectable
=None, *args
, **kw_args
):
26 """Initialises a new 'MetaBlockOutputReference' instance.
28 @param MetaBlockConnectable:
29 @param MemberOf_MetaBlockReference:
30 @param MetaBlockSignal:
31 @param StandardControlBlock_MetaBlockConnectable:
33 self
._MetaBlockConnectable
= None
34 self
.MetaBlockConnectable
= MetaBlockConnectable
36 self
._MemberOf
_MetaBlockReference
= None
37 self
.MemberOf_MetaBlockReference
= MemberOf_MetaBlockReference
39 self
._MetaBlockSignal
= []
40 self
.MetaBlockSignal
= [] if MetaBlockSignal
is None else MetaBlockSignal
42 self
._StandardControlBlock
_MetaBlockConnectable
= None
43 self
.StandardControlBlock_MetaBlockConnectable
= StandardControlBlock_MetaBlockConnectable
45 super(MetaBlockOutputReference
, self
).__init
__(*args
, **kw_args
)
51 _refs
= ["MetaBlockConnectable", "MemberOf_MetaBlockReference", "MetaBlockSignal", "StandardControlBlock_MetaBlockConnectable"]
52 _many_refs
= ["MetaBlockSignal"]
54 def getMetaBlockConnectable(self
):
56 return self
._MetaBlockConnectable
58 def setMetaBlockConnectable(self
, value
):
59 if self
._MetaBlockConnectable
is not None:
60 filtered
= [x
for x
in self
.MetaBlockConnectable
.MetaBlockOutputReference
if x
!= self
]
61 self
._MetaBlockConnectable
._MetaBlockOutputReference
= filtered
63 self
._MetaBlockConnectable
= value
64 if self
._MetaBlockConnectable
is not None:
65 if self
not in self
._MetaBlockConnectable
._MetaBlockOutputReference
:
66 self
._MetaBlockConnectable
._MetaBlockOutputReference
.append(self
)
68 MetaBlockConnectable
= property(getMetaBlockConnectable
, setMetaBlockConnectable
)
70 def getMemberOf_MetaBlockReference(self
):
72 return self
._MemberOf
_MetaBlockReference
74 def setMemberOf_MetaBlockReference(self
, value
):
75 if self
._MemberOf
_MetaBlockReference
is not None:
76 filtered
= [x
for x
in self
.MemberOf_MetaBlockReference
.MetaBlockOutputReference
if x
!= self
]
77 self
._MemberOf
_MetaBlockReference
._MetaBlockOutputReference
= filtered
79 self
._MemberOf
_MetaBlockReference
= value
80 if self
._MemberOf
_MetaBlockReference
is not None:
81 if self
not in self
._MemberOf
_MetaBlockReference
._MetaBlockOutputReference
:
82 self
._MemberOf
_MetaBlockReference
._MetaBlockOutputReference
.append(self
)
84 MemberOf_MetaBlockReference
= property(getMemberOf_MetaBlockReference
, setMemberOf_MetaBlockReference
)
86 def getMetaBlockSignal(self
):
88 return self
._MetaBlockSignal
90 def setMetaBlockSignal(self
, value
):
91 for x
in self
._MetaBlockSignal
:
95 self
._MetaBlockSignal
= value
97 MetaBlockSignal
= property(getMetaBlockSignal
, setMetaBlockSignal
)
99 def addMetaBlockSignal(self
, *MetaBlockSignal
):
100 for obj
in MetaBlockSignal
:
103 def removeMetaBlockSignal(self
, *MetaBlockSignal
):
104 for obj
in MetaBlockSignal
:
107 def getStandardControlBlock_MetaBlockConnectable(self
):
109 return self
._StandardControlBlock
_MetaBlockConnectable
111 def setStandardControlBlock_MetaBlockConnectable(self
, value
):
112 if self
._StandardControlBlock
_MetaBlockConnectable
is not None:
113 filtered
= [x
for x
in self
.StandardControlBlock_MetaBlockConnectable
.StandardControlBlock_MetaBlockOutputReference
if x
!= self
]
114 self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockOutputReference
= filtered
116 self
._StandardControlBlock
_MetaBlockConnectable
= value
117 if self
._StandardControlBlock
_MetaBlockConnectable
is not None:
118 if self
not in self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockOutputReference
:
119 self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockOutputReference
.append(self
)
121 StandardControlBlock_MetaBlockConnectable
= property(getStandardControlBlock_MetaBlockConnectable
, setStandardControlBlock_MetaBlockConnectable
)