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
.Dynamics
.MetaBlockConnectable
import MetaBlockConnectable
19 class MetaBlockInput(MetaBlockConnectable
):
20 """Linkage at the dynanics meta model level. The output of a block could link to this. This is a public interface external to the block.
23 def __init__(self
, blockInputReference0
=None, MemberOf_MetaBlock
=None, blockUsageInputReference0
=None, blockInputType0
=None, tieToMeasurement0
=None, *args
, **kw_args
):
24 """Initialises a new 'MetaBlockInput' instance.
26 @param blockInputReference0: References the idenfiied input for the block reference.
27 @param MemberOf_MetaBlock: Inputs belong to a block.
28 @param blockUsageInputReference0:
29 @param blockInputType0:
30 @param tieToMeasurement0: The identified block input to which this measurement applies. Note this applies only to the external interface of blocks.
32 self
._blockInputReference
0 = []
33 self
.blockInputReference0
= [] if blockInputReference0
is None else blockInputReference0
35 self
._MemberOf
_MetaBlock
= None
36 self
.MemberOf_MetaBlock
= MemberOf_MetaBlock
38 self
._blockUsageInputReference
0 = []
39 self
.blockUsageInputReference0
= [] if blockUsageInputReference0
is None else blockUsageInputReference0
41 self
._blockInputType
0 = None
42 self
.blockInputType0
= blockInputType0
44 self
._tieToMeasurement
0 = []
45 self
.tieToMeasurement0
= [] if tieToMeasurement0
is None else tieToMeasurement0
47 super(MetaBlockInput
, self
).__init
__(*args
, **kw_args
)
53 _refs
= ["blockInputReference0", "MemberOf_MetaBlock", "blockUsageInputReference0", "blockInputType0", "tieToMeasurement0"]
54 _many_refs
= ["blockInputReference0", "blockUsageInputReference0", "tieToMeasurement0"]
56 def getblockInputReference0(self
):
57 """References the idenfiied input for the block reference.
59 return self
._blockInputReference
0
61 def setblockInputReference0(self
, value
):
62 for x
in self
._blockInputReference
0:
63 x
._metaBlockInput
0 = None
65 y
._metaBlockInput
0 = self
66 self
._blockInputReference
0 = value
68 blockInputReference0
= property(getblockInputReference0
, setblockInputReference0
)
70 def addblockInputReference0(self
, *blockInputReference0
):
71 for obj
in blockInputReference0
:
72 obj
._metaBlockInput
0 = self
73 self
._blockInputReference
0.append(obj
)
75 def removeblockInputReference0(self
, *blockInputReference0
):
76 for obj
in blockInputReference0
:
77 obj
._metaBlockInput
0 = None
78 self
._blockInputReference
0.remove(obj
)
80 def getMemberOf_MetaBlock(self
):
81 """Inputs belong to a block.
83 return self
._MemberOf
_MetaBlock
85 def setMemberOf_MetaBlock(self
, value
):
86 if self
._MemberOf
_MetaBlock
is not None:
87 filtered
= [x
for x
in self
.MemberOf_MetaBlock
.MetaBlockInput
if x
!= self
]
88 self
._MemberOf
_MetaBlock
._MetaBlockInput
= filtered
90 self
._MemberOf
_MetaBlock
= value
91 if self
._MemberOf
_MetaBlock
is not None:
92 self
._MemberOf
_MetaBlock
._MetaBlockInput
.append(self
)
94 MemberOf_MetaBlock
= property(getMemberOf_MetaBlock
, setMemberOf_MetaBlock
)
96 def getblockUsageInputReference0(self
):
98 return self
._blockUsageInputReference
0
100 def setblockUsageInputReference0(self
, value
):
101 for x
in self
._blockUsageInputReference
0:
102 x
._metaBlockInput
0 = None
104 y
._metaBlockInput
0 = self
105 self
._blockUsageInputReference
0 = value
107 blockUsageInputReference0
= property(getblockUsageInputReference0
, setblockUsageInputReference0
)
109 def addblockUsageInputReference0(self
, *blockUsageInputReference0
):
110 for obj
in blockUsageInputReference0
:
111 obj
._metaBlockInput
0 = self
112 self
._blockUsageInputReference
0.append(obj
)
114 def removeblockUsageInputReference0(self
, *blockUsageInputReference0
):
115 for obj
in blockUsageInputReference0
:
116 obj
._metaBlockInput
0 = None
117 self
._blockUsageInputReference
0.remove(obj
)
119 def getblockInputType0(self
):
121 return self
._blockInputType
0
123 def setblockInputType0(self
, value
):
124 if self
._blockInputType
0 is not None:
125 filtered
= [x
for x
in self
.blockInputType0
.metaBlockInput0
if x
!= self
]
126 self
._blockInputType
0._metaBlockInput
0 = filtered
128 self
._blockInputType
0 = value
129 if self
._blockInputType
0 is not None:
130 self
._blockInputType
0._metaBlockInput
0.append(self
)
132 blockInputType0
= property(getblockInputType0
, setblockInputType0
)
134 def gettieToMeasurement0(self
):
135 """The identified block input to which this measurement applies. Note this applies only to the external interface of blocks.
137 return self
._tieToMeasurement
0
139 def settieToMeasurement0(self
, value
):
140 for x
in self
._tieToMeasurement
0:
141 x
._metaBlockInput
0 = None
143 y
._metaBlockInput
0 = self
144 self
._tieToMeasurement
0 = value
146 tieToMeasurement0
= property(gettieToMeasurement0
, settieToMeasurement0
)
148 def addtieToMeasurement0(self
, *tieToMeasurement0
):
149 for obj
in tieToMeasurement0
:
150 obj
._metaBlockInput
0 = self
151 self
._tieToMeasurement
0.append(obj
)
153 def removetieToMeasurement0(self
, *tieToMeasurement0
):
154 for obj
in tieToMeasurement0
:
155 obj
._metaBlockInput
0 = None
156 self
._tieToMeasurement
0.remove(obj
)