Adding class meta-data attributes.
[PyCIM.git] / schemata / CIM14 / Dynamics / MetaBlockOutput.py
blobea5cf16a8e275e4743a4c1a4d8f219cf0612375a
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 MetaBlockOutput(MetaBlockConnectable):
20 """Output state of a block. This is a public interface external to the block. One or more block outputs should be specified in order to link blocks together. Certain block kinds might require a specific output. For example, an exciter block might require an output called 'Ea'.
21 """
23 def __init__(self, BlockOutputReference=None, MemberOf_MetaBlock=None, blockUsageOutputReference0=None, blockOutputType0=None, *args, **kw_args):
24 """Initialises a new 'MetaBlockOutput' instance.
26 @param BlockOutputReference: A block output reference for the block output. The output of the block is passed to the block output reference which is a block connectable and thus can be connected at the dynamics metadata level to another block.
27 @param MemberOf_MetaBlock: The block that contains the output.
28 @param blockUsageOutputReference0:
29 @param blockOutputType0:
30 """
31 self._BlockOutputReference = []
32 self.BlockOutputReference = [] if BlockOutputReference is None else BlockOutputReference
34 self._MemberOf_MetaBlock = None
35 self.MemberOf_MetaBlock = MemberOf_MetaBlock
37 self._blockUsageOutputReference0 = []
38 self.blockUsageOutputReference0 = [] if blockUsageOutputReference0 is None else blockUsageOutputReference0
40 self._blockOutputType0 = None
41 self.blockOutputType0 = blockOutputType0
43 super(MetaBlockOutput, self).__init__(*args, **kw_args)
45 _attrs = []
46 _attr_types = {}
47 _defaults = {}
48 _enums = {}
49 _refs = ["BlockOutputReference", "MemberOf_MetaBlock", "blockUsageOutputReference0", "blockOutputType0"]
50 _many_refs = ["BlockOutputReference", "blockUsageOutputReference0"]
52 def getBlockOutputReference(self):
53 """A block output reference for the block output. The output of the block is passed to the block output reference which is a block connectable and thus can be connected at the dynamics metadata level to another block.
54 """
55 return self._BlockOutputReference
57 def setBlockOutputReference(self, value):
58 for x in self._BlockOutputReference:
59 x._metaBlockOutput0 = None
60 for y in value:
61 y._metaBlockOutput0 = self
62 self._BlockOutputReference = value
64 BlockOutputReference = property(getBlockOutputReference, setBlockOutputReference)
66 def addBlockOutputReference(self, *BlockOutputReference):
67 for obj in BlockOutputReference:
68 obj._metaBlockOutput0 = self
69 self._BlockOutputReference.append(obj)
71 def removeBlockOutputReference(self, *BlockOutputReference):
72 for obj in BlockOutputReference:
73 obj._metaBlockOutput0 = None
74 self._BlockOutputReference.remove(obj)
76 def getMemberOf_MetaBlock(self):
77 """The block that contains the output.
78 """
79 return self._MemberOf_MetaBlock
81 def setMemberOf_MetaBlock(self, value):
82 if self._MemberOf_MetaBlock is not None:
83 filtered = [x for x in self.MemberOf_MetaBlock.MetaBlockOutput if x != self]
84 self._MemberOf_MetaBlock._MetaBlockOutput = filtered
86 self._MemberOf_MetaBlock = value
87 if self._MemberOf_MetaBlock is not None:
88 self._MemberOf_MetaBlock._MetaBlockOutput.append(self)
90 MemberOf_MetaBlock = property(getMemberOf_MetaBlock, setMemberOf_MetaBlock)
92 def getblockUsageOutputReference0(self):
94 return self._blockUsageOutputReference0
96 def setblockUsageOutputReference0(self, value):
97 for x in self._blockUsageOutputReference0:
98 x._metaBlockOutput0 = None
99 for y in value:
100 y._metaBlockOutput0 = self
101 self._blockUsageOutputReference0 = value
103 blockUsageOutputReference0 = property(getblockUsageOutputReference0, setblockUsageOutputReference0)
105 def addblockUsageOutputReference0(self, *blockUsageOutputReference0):
106 for obj in blockUsageOutputReference0:
107 obj._metaBlockOutput0 = self
108 self._blockUsageOutputReference0.append(obj)
110 def removeblockUsageOutputReference0(self, *blockUsageOutputReference0):
111 for obj in blockUsageOutputReference0:
112 obj._metaBlockOutput0 = None
113 self._blockUsageOutputReference0.remove(obj)
115 def getblockOutputType0(self):
117 return self._blockOutputType0
119 def setblockOutputType0(self, value):
120 if self._blockOutputType0 is not None:
121 filtered = [x for x in self.blockOutputType0.metaBlockOutput0 if x != self]
122 self._blockOutputType0._metaBlockOutput0 = filtered
124 self._blockOutputType0 = value
125 if self._blockOutputType0 is not None:
126 self._blockOutputType0._metaBlockOutput0.append(self)
128 blockOutputType0 = property(getblockOutputType0, setblockOutputType0)