Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Dynamics / MetaBlockSignal.py
blob37eeb242bdeee947bf0d682cd501a50ef2456df5
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
19 # IN THE SOFTWARE.
21 from CIM14.IEC61970.Core.IdentifiedObject import IdentifiedObject
23 class MetaBlockSignal(IdentifiedObject):
25 def __init__(self, metaBlockSignal1=None, metaBlockSignal=None, MemberOf_MetaBlock=None, From=None, To=None, *args, **kw_args):
26 """Initialises a new 'MetaBlockSignal' instance.
28 @param metaBlockSignal1:
29 @param metaBlockSignal:
30 @param MemberOf_MetaBlock:
31 @param From:
32 @param To:
33 """
34 self._metaBlockSignal1 = []
35 self.metaBlockSignal1 = [] if metaBlockSignal1 is None else metaBlockSignal1
37 self._metaBlockSignal = []
38 self.metaBlockSignal = [] if metaBlockSignal is None else metaBlockSignal
40 self._MemberOf_MetaBlock = None
41 self.MemberOf_MetaBlock = MemberOf_MetaBlock
43 self._From = None
44 self.From = From
46 self._To = None
47 self.To = To
49 super(MetaBlockSignal, self).__init__(*args, **kw_args)
51 _attrs = []
52 _attr_types = {}
53 _defaults = {}
54 _enums = {}
55 _refs = ["metaBlockSignal1", "metaBlockSignal", "MemberOf_MetaBlock", "From", "To"]
56 _many_refs = ["metaBlockSignal1", "metaBlockSignal"]
58 def getmetaBlockSignal1(self):
60 return self._metaBlockSignal1
62 def setmetaBlockSignal1(self, value):
63 for p in self._metaBlockSignal1:
64 filtered = [q for q in p.metaBlockSignal if q != self]
65 self._metaBlockSignal1._metaBlockSignal = filtered
66 for r in value:
67 if self not in r._metaBlockSignal:
68 r._metaBlockSignal.append(self)
69 self._metaBlockSignal1 = value
71 metaBlockSignal1 = property(getmetaBlockSignal1, setmetaBlockSignal1)
73 def addmetaBlockSignal1(self, *metaBlockSignal1):
74 for obj in metaBlockSignal1:
75 if self not in obj._metaBlockSignal:
76 obj._metaBlockSignal.append(self)
77 self._metaBlockSignal1.append(obj)
79 def removemetaBlockSignal1(self, *metaBlockSignal1):
80 for obj in metaBlockSignal1:
81 if self in obj._metaBlockSignal:
82 obj._metaBlockSignal.remove(self)
83 self._metaBlockSignal1.remove(obj)
85 def getmetaBlockSignal(self):
87 return self._metaBlockSignal
89 def setmetaBlockSignal(self, value):
90 for p in self._metaBlockSignal:
91 filtered = [q for q in p.metaBlockSignal1 if q != self]
92 self._metaBlockSignal._metaBlockSignal1 = filtered
93 for r in value:
94 if self not in r._metaBlockSignal1:
95 r._metaBlockSignal1.append(self)
96 self._metaBlockSignal = value
98 metaBlockSignal = property(getmetaBlockSignal, setmetaBlockSignal)
100 def addmetaBlockSignal(self, *metaBlockSignal):
101 for obj in metaBlockSignal:
102 if self not in obj._metaBlockSignal1:
103 obj._metaBlockSignal1.append(self)
104 self._metaBlockSignal.append(obj)
106 def removemetaBlockSignal(self, *metaBlockSignal):
107 for obj in metaBlockSignal:
108 if self in obj._metaBlockSignal1:
109 obj._metaBlockSignal1.remove(self)
110 self._metaBlockSignal.remove(obj)
112 def getMemberOf_MetaBlock(self):
114 return self._MemberOf_MetaBlock
116 def setMemberOf_MetaBlock(self, value):
117 if self._MemberOf_MetaBlock is not None:
118 filtered = [x for x in self.MemberOf_MetaBlock.MetaBlockSignal if x != self]
119 self._MemberOf_MetaBlock._MetaBlockSignal = filtered
121 self._MemberOf_MetaBlock = value
122 if self._MemberOf_MetaBlock is not None:
123 if self not in self._MemberOf_MetaBlock._MetaBlockSignal:
124 self._MemberOf_MetaBlock._MetaBlockSignal.append(self)
126 MemberOf_MetaBlock = property(getMemberOf_MetaBlock, setMemberOf_MetaBlock)
128 def getFrom(self):
130 return self._From
132 def setFrom(self, value):
133 if self._From is not None:
134 self._From._MetaBlockSignal = None
136 self._From = value
137 if self._From is not None:
138 self._From.MetaBlockSignal = None
139 self._From._MetaBlockSignal = self
141 From = property(getFrom, setFrom)
143 def getTo(self):
145 return self._To
147 def setTo(self, value):
148 if self._To is not None:
149 filtered = [x for x in self.To.MetaBlockSignal if x != self]
150 self._To._MetaBlockSignal = filtered
152 self._To = value
153 if self._To is not None:
154 if self not in self._To._MetaBlockSignal:
155 self._To._MetaBlockSignal.append(self)
157 To = property(getTo, setTo)