Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Dynamics / MetaBlockParameter.py
blobbc13a9c6adac786ac6a5e8b82c410525406bd0f2
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.Dynamics.MetaBlockConnectable import MetaBlockConnectable
23 class MetaBlockParameter(MetaBlockConnectable):
24 """An identified parameter of a block. This is meta dynamics model and does not contain specific parameter values. When using a block one would need to supply specific parameter values. These are typically time constants, but are not restricted to this. Sometimes, for standard blocks, the block paramter may come directly from the attributes of an associated PowerSystemResource object, but such parameters may be specified to enable user defined models to alter the behavior of a standard block.
25 """
27 def __init__(self, BlockParameter=None, MemberOf_MetaBlock=None, *args, **kw_args):
28 """Initialises a new 'MetaBlockParameter' instance.
30 @param BlockParameter:
31 @param MemberOf_MetaBlock: Paramters belong to a block.
32 """
33 self._BlockParameter = []
34 self.BlockParameter = [] if BlockParameter is None else BlockParameter
36 self._MemberOf_MetaBlock = None
37 self.MemberOf_MetaBlock = MemberOf_MetaBlock
39 super(MetaBlockParameter, self).__init__(*args, **kw_args)
41 _attrs = []
42 _attr_types = {}
43 _defaults = {}
44 _enums = {}
45 _refs = ["BlockParameter", "MemberOf_MetaBlock"]
46 _many_refs = ["BlockParameter"]
48 def getBlockParameter(self):
50 return self._BlockParameter
52 def setBlockParameter(self, value):
53 for x in self._BlockParameter:
54 x.MetaBlockParameter = None
55 for y in value:
56 y._MetaBlockParameter = self
57 self._BlockParameter = value
59 BlockParameter = property(getBlockParameter, setBlockParameter)
61 def addBlockParameter(self, *BlockParameter):
62 for obj in BlockParameter:
63 obj.MetaBlockParameter = self
65 def removeBlockParameter(self, *BlockParameter):
66 for obj in BlockParameter:
67 obj.MetaBlockParameter = None
69 def getMemberOf_MetaBlock(self):
70 """Paramters belong to a block.
71 """
72 return self._MemberOf_MetaBlock
74 def setMemberOf_MetaBlock(self, value):
75 if self._MemberOf_MetaBlock is not None:
76 filtered = [x for x in self.MemberOf_MetaBlock.MetaBlockParameter if x != self]
77 self._MemberOf_MetaBlock._MetaBlockParameter = filtered
79 self._MemberOf_MetaBlock = value
80 if self._MemberOf_MetaBlock is not None:
81 if self not in self._MemberOf_MetaBlock._MetaBlockParameter:
82 self._MemberOf_MetaBlock._MetaBlockParameter.append(self)
84 MemberOf_MetaBlock = property(getMemberOf_MetaBlock, setMemberOf_MetaBlock)