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 MetaBlockConnectable(IdentifiedObject
):
24 """This is a source connection for a block input at the dynamics meta-data level. The subtypes represent different ways to obtain the numbers. Note that a block output is NOT derived from this class since block outputs can only be computed from references to other blocks via the BlockOutputReference class.
27 def __init__(self
, StandardControlBlock_MetaBlockStateReference
=None, MetaBlockOutputReference
=None, MetaBlockStateReference
=None, BlockInputReference
=None, StandardControlBlock_MetaBlockInputReference
=None, StandardControlBlock_MetaBlockParameterReference
=None, MetaBlockParameterReference
=None, StandardControlBlock_MetaBlockOutputReference
=None, MetaBlockInputReference
=None, *args
, **kw_args
):
28 """Initialises a new 'MetaBlockConnectable' instance.
30 @param StandardControlBlock_MetaBlockStateReference:
31 @param MetaBlockOutputReference:
32 @param MetaBlockStateReference:
33 @param BlockInputReference: Each block reference input is usually tied to one (sometimes zero for optional inputs) external block inputs or internal block reference outputs.
34 @param StandardControlBlock_MetaBlockInputReference:
35 @param StandardControlBlock_MetaBlockParameterReference:
36 @param MetaBlockParameterReference:
37 @param StandardControlBlock_MetaBlockOutputReference:
38 @param MetaBlockInputReference:
40 self
._StandardControlBlock
_MetaBlockStateReference
= []
41 self
.StandardControlBlock_MetaBlockStateReference
= [] if StandardControlBlock_MetaBlockStateReference
is None else StandardControlBlock_MetaBlockStateReference
43 self
._MetaBlockOutputReference
= []
44 self
.MetaBlockOutputReference
= [] if MetaBlockOutputReference
is None else MetaBlockOutputReference
46 self
._MetaBlockStateReference
= []
47 self
.MetaBlockStateReference
= [] if MetaBlockStateReference
is None else MetaBlockStateReference
49 self
._BlockInputReference
= []
50 self
.BlockInputReference
= [] if BlockInputReference
is None else BlockInputReference
52 self
._StandardControlBlock
_MetaBlockInputReference
= []
53 self
.StandardControlBlock_MetaBlockInputReference
= [] if StandardControlBlock_MetaBlockInputReference
is None else StandardControlBlock_MetaBlockInputReference
55 self
._StandardControlBlock
_MetaBlockParameterReference
= []
56 self
.StandardControlBlock_MetaBlockParameterReference
= [] if StandardControlBlock_MetaBlockParameterReference
is None else StandardControlBlock_MetaBlockParameterReference
58 self
._MetaBlockParameterReference
= []
59 self
.MetaBlockParameterReference
= [] if MetaBlockParameterReference
is None else MetaBlockParameterReference
61 self
._StandardControlBlock
_MetaBlockOutputReference
= []
62 self
.StandardControlBlock_MetaBlockOutputReference
= [] if StandardControlBlock_MetaBlockOutputReference
is None else StandardControlBlock_MetaBlockOutputReference
64 self
._MetaBlockInputReference
= []
65 self
.MetaBlockInputReference
= [] if MetaBlockInputReference
is None else MetaBlockInputReference
67 super(MetaBlockConnectable
, self
).__init
__(*args
, **kw_args
)
73 _refs
= ["StandardControlBlock_MetaBlockStateReference", "MetaBlockOutputReference", "MetaBlockStateReference", "BlockInputReference", "StandardControlBlock_MetaBlockInputReference", "StandardControlBlock_MetaBlockParameterReference", "MetaBlockParameterReference", "StandardControlBlock_MetaBlockOutputReference", "MetaBlockInputReference"]
74 _many_refs
= ["StandardControlBlock_MetaBlockStateReference", "MetaBlockOutputReference", "MetaBlockStateReference", "BlockInputReference", "StandardControlBlock_MetaBlockInputReference", "StandardControlBlock_MetaBlockParameterReference", "MetaBlockParameterReference", "StandardControlBlock_MetaBlockOutputReference", "MetaBlockInputReference"]
76 def getStandardControlBlock_MetaBlockStateReference(self
):
78 return self
._StandardControlBlock
_MetaBlockStateReference
80 def setStandardControlBlock_MetaBlockStateReference(self
, value
):
81 for x
in self
._StandardControlBlock
_MetaBlockStateReference
:
82 x
.StandardControlBlock_MetaBlockConnectable
= None
84 y
._StandardControlBlock
_MetaBlockConnectable
= self
85 self
._StandardControlBlock
_MetaBlockStateReference
= value
87 StandardControlBlock_MetaBlockStateReference
= property(getStandardControlBlock_MetaBlockStateReference
, setStandardControlBlock_MetaBlockStateReference
)
89 def addStandardControlBlock_MetaBlockStateReference(self
, *StandardControlBlock_MetaBlockStateReference
):
90 for obj
in StandardControlBlock_MetaBlockStateReference
:
91 obj
.StandardControlBlock_MetaBlockConnectable
= self
93 def removeStandardControlBlock_MetaBlockStateReference(self
, *StandardControlBlock_MetaBlockStateReference
):
94 for obj
in StandardControlBlock_MetaBlockStateReference
:
95 obj
.StandardControlBlock_MetaBlockConnectable
= None
97 def getMetaBlockOutputReference(self
):
99 return self
._MetaBlockOutputReference
101 def setMetaBlockOutputReference(self
, value
):
102 for x
in self
._MetaBlockOutputReference
:
103 x
.MetaBlockConnectable
= None
105 y
._MetaBlockConnectable
= self
106 self
._MetaBlockOutputReference
= value
108 MetaBlockOutputReference
= property(getMetaBlockOutputReference
, setMetaBlockOutputReference
)
110 def addMetaBlockOutputReference(self
, *MetaBlockOutputReference
):
111 for obj
in MetaBlockOutputReference
:
112 obj
.MetaBlockConnectable
= self
114 def removeMetaBlockOutputReference(self
, *MetaBlockOutputReference
):
115 for obj
in MetaBlockOutputReference
:
116 obj
.MetaBlockConnectable
= None
118 def getMetaBlockStateReference(self
):
120 return self
._MetaBlockStateReference
122 def setMetaBlockStateReference(self
, value
):
123 for x
in self
._MetaBlockStateReference
:
124 x
.MetaBlockConnectable
= None
126 y
._MetaBlockConnectable
= self
127 self
._MetaBlockStateReference
= value
129 MetaBlockStateReference
= property(getMetaBlockStateReference
, setMetaBlockStateReference
)
131 def addMetaBlockStateReference(self
, *MetaBlockStateReference
):
132 for obj
in MetaBlockStateReference
:
133 obj
.MetaBlockConnectable
= self
135 def removeMetaBlockStateReference(self
, *MetaBlockStateReference
):
136 for obj
in MetaBlockStateReference
:
137 obj
.MetaBlockConnectable
= None
139 def getBlockInputReference(self
):
140 """Each block reference input is usually tied to one (sometimes zero for optional inputs) external block inputs or internal block reference outputs.
142 return self
._BlockInputReference
144 def setBlockInputReference(self
, value
):
145 for x
in self
._BlockInputReference
:
146 x
.BlockConnectable
= None
148 y
._BlockConnectable
= self
149 self
._BlockInputReference
= value
151 BlockInputReference
= property(getBlockInputReference
, setBlockInputReference
)
153 def addBlockInputReference(self
, *BlockInputReference
):
154 for obj
in BlockInputReference
:
155 obj
.BlockConnectable
= self
157 def removeBlockInputReference(self
, *BlockInputReference
):
158 for obj
in BlockInputReference
:
159 obj
.BlockConnectable
= None
161 def getStandardControlBlock_MetaBlockInputReference(self
):
163 return self
._StandardControlBlock
_MetaBlockInputReference
165 def setStandardControlBlock_MetaBlockInputReference(self
, value
):
166 for x
in self
._StandardControlBlock
_MetaBlockInputReference
:
167 x
.StandardControlBlock_MetaBlockConnectable
= None
169 y
._StandardControlBlock
_MetaBlockConnectable
= self
170 self
._StandardControlBlock
_MetaBlockInputReference
= value
172 StandardControlBlock_MetaBlockInputReference
= property(getStandardControlBlock_MetaBlockInputReference
, setStandardControlBlock_MetaBlockInputReference
)
174 def addStandardControlBlock_MetaBlockInputReference(self
, *StandardControlBlock_MetaBlockInputReference
):
175 for obj
in StandardControlBlock_MetaBlockInputReference
:
176 obj
.StandardControlBlock_MetaBlockConnectable
= self
178 def removeStandardControlBlock_MetaBlockInputReference(self
, *StandardControlBlock_MetaBlockInputReference
):
179 for obj
in StandardControlBlock_MetaBlockInputReference
:
180 obj
.StandardControlBlock_MetaBlockConnectable
= None
182 def getStandardControlBlock_MetaBlockParameterReference(self
):
184 return self
._StandardControlBlock
_MetaBlockParameterReference
186 def setStandardControlBlock_MetaBlockParameterReference(self
, value
):
187 for x
in self
._StandardControlBlock
_MetaBlockParameterReference
:
188 x
.StandardControlBlock_MetaBlockConnectable
= None
190 y
._StandardControlBlock
_MetaBlockConnectable
= self
191 self
._StandardControlBlock
_MetaBlockParameterReference
= value
193 StandardControlBlock_MetaBlockParameterReference
= property(getStandardControlBlock_MetaBlockParameterReference
, setStandardControlBlock_MetaBlockParameterReference
)
195 def addStandardControlBlock_MetaBlockParameterReference(self
, *StandardControlBlock_MetaBlockParameterReference
):
196 for obj
in StandardControlBlock_MetaBlockParameterReference
:
197 obj
.StandardControlBlock_MetaBlockConnectable
= self
199 def removeStandardControlBlock_MetaBlockParameterReference(self
, *StandardControlBlock_MetaBlockParameterReference
):
200 for obj
in StandardControlBlock_MetaBlockParameterReference
:
201 obj
.StandardControlBlock_MetaBlockConnectable
= None
203 def getMetaBlockParameterReference(self
):
205 return self
._MetaBlockParameterReference
207 def setMetaBlockParameterReference(self
, value
):
208 for x
in self
._MetaBlockParameterReference
:
209 x
.MetaBlockConnectable
= None
211 y
._MetaBlockConnectable
= self
212 self
._MetaBlockParameterReference
= value
214 MetaBlockParameterReference
= property(getMetaBlockParameterReference
, setMetaBlockParameterReference
)
216 def addMetaBlockParameterReference(self
, *MetaBlockParameterReference
):
217 for obj
in MetaBlockParameterReference
:
218 obj
.MetaBlockConnectable
= self
220 def removeMetaBlockParameterReference(self
, *MetaBlockParameterReference
):
221 for obj
in MetaBlockParameterReference
:
222 obj
.MetaBlockConnectable
= None
224 def getStandardControlBlock_MetaBlockOutputReference(self
):
226 return self
._StandardControlBlock
_MetaBlockOutputReference
228 def setStandardControlBlock_MetaBlockOutputReference(self
, value
):
229 for x
in self
._StandardControlBlock
_MetaBlockOutputReference
:
230 x
.StandardControlBlock_MetaBlockConnectable
= None
232 y
._StandardControlBlock
_MetaBlockConnectable
= self
233 self
._StandardControlBlock
_MetaBlockOutputReference
= value
235 StandardControlBlock_MetaBlockOutputReference
= property(getStandardControlBlock_MetaBlockOutputReference
, setStandardControlBlock_MetaBlockOutputReference
)
237 def addStandardControlBlock_MetaBlockOutputReference(self
, *StandardControlBlock_MetaBlockOutputReference
):
238 for obj
in StandardControlBlock_MetaBlockOutputReference
:
239 obj
.StandardControlBlock_MetaBlockConnectable
= self
241 def removeStandardControlBlock_MetaBlockOutputReference(self
, *StandardControlBlock_MetaBlockOutputReference
):
242 for obj
in StandardControlBlock_MetaBlockOutputReference
:
243 obj
.StandardControlBlock_MetaBlockConnectable
= None
245 def getMetaBlockInputReference(self
):
247 return self
._MetaBlockInputReference
249 def setMetaBlockInputReference(self
, value
):
250 for x
in self
._MetaBlockInputReference
:
251 x
.MetaBlockConnectable
= None
253 y
._MetaBlockConnectable
= self
254 self
._MetaBlockInputReference
= value
256 MetaBlockInputReference
= property(getMetaBlockInputReference
, setMetaBlockInputReference
)
258 def addMetaBlockInputReference(self
, *MetaBlockInputReference
):
259 for obj
in MetaBlockInputReference
:
260 obj
.MetaBlockConnectable
= self
262 def removeMetaBlockInputReference(self
, *MetaBlockInputReference
):
263 for obj
in MetaBlockInputReference
:
264 obj
.MetaBlockConnectable
= None