Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Dynamics / BlockUsageOutputReference.py
blob95df5a63369036f4a75431ab8ca1909e0671e1ac
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 BlockUsageOutputReference(IdentifiedObject):
24 """Used at instance level to tie the input of a referenced block to the output of another referenced block. Note that typically an input is only tied to an output of another block at the same PowerSystemResource, but there is no restriction to do so. If the output is implicity tied to an input, then the an instance of this class is not required. The sole purpose of this class is to explicitly tio the input of other blocks at the power system instance level.
25 """
27 def __init__(self, block0=None, BlockUsageInputReference=None, metaBlockOutput0=None, *args, **kw_args):
28 """Initialises a new 'BlockUsageOutputReference' instance.
30 @param block0:
31 @param BlockUsageInputReference: Can cross BlockUsage objects.
32 @param metaBlockOutput0:
33 """
34 self._block0 = None
35 self.block0 = block0
37 self._BlockUsageInputReference = []
38 self.BlockUsageInputReference = [] if BlockUsageInputReference is None else BlockUsageInputReference
40 self._metaBlockOutput0 = None
41 self.metaBlockOutput0 = metaBlockOutput0
43 super(BlockUsageOutputReference, self).__init__(*args, **kw_args)
45 _attrs = []
46 _attr_types = {}
47 _defaults = {}
48 _enums = {}
49 _refs = ["block0", "BlockUsageInputReference", "metaBlockOutput0"]
50 _many_refs = ["BlockUsageInputReference"]
52 def getblock0(self):
54 return self._block0
56 def setblock0(self, value):
57 if self._block0 is not None:
58 filtered = [x for x in self.block0.BlockUsageOutputReference if x != self]
59 self._block0._BlockUsageOutputReference = filtered
61 self._block0 = value
62 if self._block0 is not None:
63 if self not in self._block0._BlockUsageOutputReference:
64 self._block0._BlockUsageOutputReference.append(self)
66 block0 = property(getblock0, setblock0)
68 def getBlockUsageInputReference(self):
69 """Can cross BlockUsage objects.
70 """
71 return self._BlockUsageInputReference
73 def setBlockUsageInputReference(self, value):
74 for x in self._BlockUsageInputReference:
75 x.BlockUsageOutputReference = None
76 for y in value:
77 y._BlockUsageOutputReference = self
78 self._BlockUsageInputReference = value
80 BlockUsageInputReference = property(getBlockUsageInputReference, setBlockUsageInputReference)
82 def addBlockUsageInputReference(self, *BlockUsageInputReference):
83 for obj in BlockUsageInputReference:
84 obj.BlockUsageOutputReference = self
86 def removeBlockUsageInputReference(self, *BlockUsageInputReference):
87 for obj in BlockUsageInputReference:
88 obj.BlockUsageOutputReference = None
90 def getmetaBlockOutput0(self):
92 return self._metaBlockOutput0
94 def setmetaBlockOutput0(self, value):
95 if self._metaBlockOutput0 is not None:
96 filtered = [x for x in self.metaBlockOutput0.blockUsageOutputReference0 if x != self]
97 self._metaBlockOutput0._blockUsageOutputReference0 = filtered
99 self._metaBlockOutput0 = value
100 if self._metaBlockOutput0 is not None:
101 if self not in self._metaBlockOutput0._blockUsageOutputReference0:
102 self._metaBlockOutput0._blockUsageOutputReference0.append(self)
104 metaBlockOutput0 = property(getmetaBlockOutput0, setmetaBlockOutput0)