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
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
19 class BlockType(IdentifiedObject
):
20 """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..
23 def __init__(self
, slot0
=None, metaBlock0
=None, *args
, **kw_args
):
24 """Initialises a new 'BlockType' instance.
30 self
.slot0
= [] if slot0
is None else slot0
33 self
.metaBlock0
= [] if metaBlock0
is None else metaBlock0
35 super(BlockType
, self
).__init
__(*args
, **kw_args
)
41 _refs
= ["slot0", "metaBlock0"]
42 _many_refs
= ["slot0", "metaBlock0"]
48 def setslot0(self
, value
):
55 slot0
= property(getslot0
, setslot0
)
57 def addslot0(self
, *slot0
):
59 obj
._blockType
0 = self
60 self
._slot
0.append(obj
)
62 def removeslot0(self
, *slot0
):
64 obj
._blockType
0 = None
65 self
._slot
0.remove(obj
)
67 def getmetaBlock0(self
):
69 return self
._metaBlock
0
71 def setmetaBlock0(self
, value
):
72 for x
in self
._metaBlock
0:
76 self
._metaBlock
0 = value
78 metaBlock0
= property(getmetaBlock0
, setmetaBlock0
)
80 def addmetaBlock0(self
, *metaBlock0
):
81 for obj
in metaBlock0
:
82 obj
._blockType
0 = self
83 self
._metaBlock
0.append(obj
)
85 def removemetaBlock0(self
, *metaBlock0
):
86 for obj
in metaBlock0
:
87 obj
._blockType
0 = None
88 self
._metaBlock
0.remove(obj
)