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 Slot(IdentifiedObject
):
25 def __init__(self
, blockType0
=None, slotReference0
=None, slotOutput0
=None, connectionFrame0
=None, slotInput0
=None, *args
, **kw_args
):
26 """Initialises a new 'Slot' instance.
29 @param slotReference0:
31 @param connectionFrame0:
34 self
._blockType
0 = None
35 self
.blockType0
= blockType0
37 self
._slotReference
0 = []
38 self
.slotReference0
= [] if slotReference0
is None else slotReference0
40 self
._slotOutput
0 = []
41 self
.slotOutput0
= [] if slotOutput0
is None else slotOutput0
43 self
._connectionFrame
0 = None
44 self
.connectionFrame0
= connectionFrame0
47 self
.slotInput0
= [] if slotInput0
is None else slotInput0
49 super(Slot
, self
).__init
__(*args
, **kw_args
)
55 _refs
= ["blockType0", "slotReference0", "slotOutput0", "connectionFrame0", "slotInput0"]
56 _many_refs
= ["slotReference0", "slotOutput0", "slotInput0"]
58 def getblockType0(self
):
60 return self
._blockType
0
62 def setblockType0(self
, value
):
63 if self
._blockType
0 is not None:
64 filtered
= [x
for x
in self
.blockType0
.slot0
if x
!= self
]
65 self
._blockType
0._slot
0 = filtered
67 self
._blockType
0 = value
68 if self
._blockType
0 is not None:
69 if self
not in self
._blockType
0._slot
0:
70 self
._blockType
0._slot
0.append(self
)
72 blockType0
= property(getblockType0
, setblockType0
)
74 def getslotReference0(self
):
76 return self
._slotReference
0
78 def setslotReference0(self
, value
):
79 for x
in self
._slotReference
0:
83 self
._slotReference
0 = value
85 slotReference0
= property(getslotReference0
, setslotReference0
)
87 def addslotReference0(self
, *slotReference0
):
88 for obj
in slotReference0
:
91 def removeslotReference0(self
, *slotReference0
):
92 for obj
in slotReference0
:
95 def getslotOutput0(self
):
97 return self
._slotOutput
0
99 def setslotOutput0(self
, value
):
100 for x
in self
._slotOutput
0:
104 self
._slotOutput
0 = value
106 slotOutput0
= property(getslotOutput0
, setslotOutput0
)
108 def addslotOutput0(self
, *slotOutput0
):
109 for obj
in slotOutput0
:
112 def removeslotOutput0(self
, *slotOutput0
):
113 for obj
in slotOutput0
:
116 def getconnectionFrame0(self
):
118 return self
._connectionFrame
0
120 def setconnectionFrame0(self
, value
):
121 if self
._connectionFrame
0 is not None:
122 filtered
= [x
for x
in self
.connectionFrame0
.slot0
if x
!= self
]
123 self
._connectionFrame
0._slot
0 = filtered
125 self
._connectionFrame
0 = value
126 if self
._connectionFrame
0 is not None:
127 if self
not in self
._connectionFrame
0._slot
0:
128 self
._connectionFrame
0._slot
0.append(self
)
130 connectionFrame0
= property(getconnectionFrame0
, setconnectionFrame0
)
132 def getslotInput0(self
):
134 return self
._slotInput
0
136 def setslotInput0(self
, value
):
137 for x
in self
._slotInput
0:
141 self
._slotInput
0 = value
143 slotInput0
= property(getslotInput0
, setslotInput0
)
145 def addslotInput0(self
, *slotInput0
):
146 for obj
in slotInput0
:
149 def removeslotInput0(self
, *slotInput0
):
150 for obj
in slotInput0
: