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 Slot(IdentifiedObject
):
21 def __init__(self
, blockType0
=None, slotReference0
=None, slotOutput0
=None, connectionFrame0
=None, slotInput0
=None, *args
, **kw_args
):
22 """Initialises a new 'Slot' instance.
25 @param slotReference0:
27 @param connectionFrame0:
30 self
._blockType
0 = None
31 self
.blockType0
= blockType0
33 self
._slotReference
0 = []
34 self
.slotReference0
= [] if slotReference0
is None else slotReference0
36 self
._slotOutput
0 = []
37 self
.slotOutput0
= [] if slotOutput0
is None else slotOutput0
39 self
._connectionFrame
0 = None
40 self
.connectionFrame0
= connectionFrame0
43 self
.slotInput0
= [] if slotInput0
is None else slotInput0
45 super(Slot
, self
).__init
__(*args
, **kw_args
)
51 _refs
= ["blockType0", "slotReference0", "slotOutput0", "connectionFrame0", "slotInput0"]
52 _many_refs
= ["slotReference0", "slotOutput0", "slotInput0"]
54 def getblockType0(self
):
56 return self
._blockType
0
58 def setblockType0(self
, value
):
59 if self
._blockType
0 is not None:
60 filtered
= [x
for x
in self
.blockType0
.slot0
if x
!= self
]
61 self
._blockType
0._slot
0 = filtered
63 self
._blockType
0 = value
64 if self
._blockType
0 is not None:
65 self
._blockType
0._slot
0.append(self
)
67 blockType0
= property(getblockType0
, setblockType0
)
69 def getslotReference0(self
):
71 return self
._slotReference
0
73 def setslotReference0(self
, value
):
74 for x
in self
._slotReference
0:
78 self
._slotReference
0 = value
80 slotReference0
= property(getslotReference0
, setslotReference0
)
82 def addslotReference0(self
, *slotReference0
):
83 for obj
in slotReference0
:
85 self
._slotReference
0.append(obj
)
87 def removeslotReference0(self
, *slotReference0
):
88 for obj
in slotReference0
:
90 self
._slotReference
0.remove(obj
)
92 def getslotOutput0(self
):
94 return self
._slotOutput
0
96 def setslotOutput0(self
, value
):
97 for x
in self
._slotOutput
0:
101 self
._slotOutput
0 = value
103 slotOutput0
= property(getslotOutput0
, setslotOutput0
)
105 def addslotOutput0(self
, *slotOutput0
):
106 for obj
in slotOutput0
:
108 self
._slotOutput
0.append(obj
)
110 def removeslotOutput0(self
, *slotOutput0
):
111 for obj
in slotOutput0
:
113 self
._slotOutput
0.remove(obj
)
115 def getconnectionFrame0(self
):
117 return self
._connectionFrame
0
119 def setconnectionFrame0(self
, value
):
120 if self
._connectionFrame
0 is not None:
121 filtered
= [x
for x
in self
.connectionFrame0
.slot0
if x
!= self
]
122 self
._connectionFrame
0._slot
0 = filtered
124 self
._connectionFrame
0 = value
125 if self
._connectionFrame
0 is not None:
126 self
._connectionFrame
0._slot
0.append(self
)
128 connectionFrame0
= property(getconnectionFrame0
, setconnectionFrame0
)
130 def getslotInput0(self
):
132 return self
._slotInput
0
134 def setslotInput0(self
, value
):
135 for x
in self
._slotInput
0:
139 self
._slotInput
0 = value
141 slotInput0
= property(getslotInput0
, setslotInput0
)
143 def addslotInput0(self
, *slotInput0
):
144 for obj
in slotInput0
:
146 self
._slotInput
0.append(obj
)
148 def removeslotInput0(self
, *slotInput0
):
149 for obj
in slotInput0
:
151 self
._slotInput
0.remove(obj
)