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 MetaBlockSignal(IdentifiedObject
):
21 def __init__(self
, metaBlockSignal1
=None, metaBlockSignal
=None, MemberOf_MetaBlock
=None, From
=None, To
=None, *args
, **kw_args
):
22 """Initialises a new 'MetaBlockSignal' instance.
24 @param metaBlockSignal1:
25 @param metaBlockSignal:
26 @param MemberOf_MetaBlock:
30 self
._metaBlockSignal
1 = []
31 self
.metaBlockSignal1
= [] if metaBlockSignal1
is None else metaBlockSignal1
33 self
._metaBlockSignal
= []
34 self
.metaBlockSignal
= [] if metaBlockSignal
is None else metaBlockSignal
36 self
._MemberOf
_MetaBlock
= None
37 self
.MemberOf_MetaBlock
= MemberOf_MetaBlock
45 super(MetaBlockSignal
, self
).__init
__(*args
, **kw_args
)
51 _refs
= ["metaBlockSignal1", "metaBlockSignal", "MemberOf_MetaBlock", "From", "To"]
52 _many_refs
= ["metaBlockSignal1", "metaBlockSignal"]
54 def getmetaBlockSignal1(self
):
56 return self
._metaBlockSignal
1
58 def setmetaBlockSignal1(self
, value
):
59 for p
in self
._metaBlockSignal
1:
60 filtered
= [q
for q
in p
.metaBlockSignal
if q
!= self
]
61 self
._metaBlockSignal
1._metaBlockSignal
= filtered
63 if self
not in r
._metaBlockSignal
:
64 r
._metaBlockSignal
.append(self
)
65 self
._metaBlockSignal
1 = value
67 metaBlockSignal1
= property(getmetaBlockSignal1
, setmetaBlockSignal1
)
69 def addmetaBlockSignal1(self
, *metaBlockSignal1
):
70 for obj
in metaBlockSignal1
:
71 if self
not in obj
._metaBlockSignal
:
72 obj
._metaBlockSignal
.append(self
)
73 self
._metaBlockSignal
1.append(obj
)
75 def removemetaBlockSignal1(self
, *metaBlockSignal1
):
76 for obj
in metaBlockSignal1
:
77 if self
in obj
._metaBlockSignal
:
78 obj
._metaBlockSignal
.remove(self
)
79 self
._metaBlockSignal
1.remove(obj
)
81 def getmetaBlockSignal(self
):
83 return self
._metaBlockSignal
85 def setmetaBlockSignal(self
, value
):
86 for p
in self
._metaBlockSignal
:
87 filtered
= [q
for q
in p
.metaBlockSignal1
if q
!= self
]
88 self
._metaBlockSignal
._metaBlockSignal
1 = filtered
90 if self
not in r
._metaBlockSignal
1:
91 r
._metaBlockSignal
1.append(self
)
92 self
._metaBlockSignal
= value
94 metaBlockSignal
= property(getmetaBlockSignal
, setmetaBlockSignal
)
96 def addmetaBlockSignal(self
, *metaBlockSignal
):
97 for obj
in metaBlockSignal
:
98 if self
not in obj
._metaBlockSignal
1:
99 obj
._metaBlockSignal
1.append(self
)
100 self
._metaBlockSignal
.append(obj
)
102 def removemetaBlockSignal(self
, *metaBlockSignal
):
103 for obj
in metaBlockSignal
:
104 if self
in obj
._metaBlockSignal
1:
105 obj
._metaBlockSignal
1.remove(self
)
106 self
._metaBlockSignal
.remove(obj
)
108 def getMemberOf_MetaBlock(self
):
110 return self
._MemberOf
_MetaBlock
112 def setMemberOf_MetaBlock(self
, value
):
113 if self
._MemberOf
_MetaBlock
is not None:
114 filtered
= [x
for x
in self
.MemberOf_MetaBlock
.MetaBlockSignal
if x
!= self
]
115 self
._MemberOf
_MetaBlock
._MetaBlockSignal
= filtered
117 self
._MemberOf
_MetaBlock
= value
118 if self
._MemberOf
_MetaBlock
is not None:
119 self
._MemberOf
_MetaBlock
._MetaBlockSignal
.append(self
)
121 MemberOf_MetaBlock
= property(getMemberOf_MetaBlock
, setMemberOf_MetaBlock
)
127 def setFrom(self
, value
):
128 if self
._From
is not None:
129 self
._From
._MetaBlockSignal
= None
132 if self
._From
is not None:
133 self
._From
._MetaBlockSignal
= self
135 From
= property(getFrom
, setFrom
)
141 def setTo(self
, value
):
142 if self
._To
is not None:
143 filtered
= [x
for x
in self
.To
.MetaBlockSignal
if x
!= self
]
144 self
._To
._MetaBlockSignal
= filtered
147 if self
._To
is not None:
148 self
._To
._MetaBlockSignal
.append(self
)
150 To
= property(getTo
, setTo
)