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 SlotConnection(IdentifiedObject
):
24 """Standard connectivity if not specified at the instance level..
27 def __init__(self
, connectionFrame0
=None, slotInput0
=None, slotOutput0
=None, *args
, **kw_args
):
28 """Initialises a new 'SlotConnection' instance.
30 @param connectionFrame0:
34 self
._connectionFrame
0 = None
35 self
.connectionFrame0
= connectionFrame0
37 self
._slotInput
0 = None
38 self
.slotInput0
= slotInput0
40 self
._slotOutput
0 = None
41 self
.slotOutput0
= slotOutput0
43 super(SlotConnection
, self
).__init
__(*args
, **kw_args
)
49 _refs
= ["connectionFrame0", "slotInput0", "slotOutput0"]
52 def getconnectionFrame0(self
):
54 return self
._connectionFrame
0
56 def setconnectionFrame0(self
, value
):
57 if self
._connectionFrame
0 is not None:
58 filtered
= [x
for x
in self
.connectionFrame0
.slotConnection0
if x
!= self
]
59 self
._connectionFrame
0._slotConnection
0 = filtered
61 self
._connectionFrame
0 = value
62 if self
._connectionFrame
0 is not None:
63 if self
not in self
._connectionFrame
0._slotConnection
0:
64 self
._connectionFrame
0._slotConnection
0.append(self
)
66 connectionFrame0
= property(getconnectionFrame0
, setconnectionFrame0
)
68 def getslotInput0(self
):
70 return self
._slotInput
0
72 def setslotInput0(self
, value
):
73 if self
._slotInput
0 is not None:
74 self
._slotInput
0._slotConnection
0 = None
76 self
._slotInput
0 = value
77 if self
._slotInput
0 is not None:
78 self
._slotInput
0.slotConnection0
= None
79 self
._slotInput
0._slotConnection
0 = self
81 slotInput0
= property(getslotInput0
, setslotInput0
)
83 def getslotOutput0(self
):
85 return self
._slotOutput
0
87 def setslotOutput0(self
, value
):
88 if self
._slotOutput
0 is not None:
89 filtered
= [x
for x
in self
.slotOutput0
.slotConnection0
if x
!= self
]
90 self
._slotOutput
0._slotConnection
0 = filtered
92 self
._slotOutput
0 = value
93 if self
._slotOutput
0 is not None:
94 if self
not in self
._slotOutput
0._slotConnection
0:
95 self
._slotOutput
0._slotConnection
0.append(self
)
97 slotOutput0
= property(getslotOutput0
, setslotOutput0
)