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 BlockType(IdentifiedObject
):
24 """This is the kind of a block used to specify what kind of blocks could fit into a particular slot. For example, only blocks of type 'pss' would fit into a 'pss' type block. Though a cross compound generator configuration would possibly have multple pss blocks playing specific roles such as pss1 and pss2..
27 def __init__(self
, slot0
=None, metaBlock0
=None, *args
, **kw_args
):
28 """Initialises a new 'BlockType' instance.
34 self
.slot0
= [] if slot0
is None else slot0
37 self
.metaBlock0
= [] if metaBlock0
is None else metaBlock0
39 super(BlockType
, self
).__init
__(*args
, **kw_args
)
45 _refs
= ["slot0", "metaBlock0"]
46 _many_refs
= ["slot0", "metaBlock0"]
52 def setslot0(self
, value
):
59 slot0
= property(getslot0
, setslot0
)
61 def addslot0(self
, *slot0
):
65 def removeslot0(self
, *slot0
):
69 def getmetaBlock0(self
):
71 return self
._metaBlock
0
73 def setmetaBlock0(self
, value
):
74 for x
in self
._metaBlock
0:
78 self
._metaBlock
0 = value
80 metaBlock0
= property(getmetaBlock0
, setmetaBlock0
)
82 def addmetaBlock0(self
, *metaBlock0
):
83 for obj
in metaBlock0
:
86 def removemetaBlock0(self
, *metaBlock0
):
87 for obj
in metaBlock0
: