Implementing RDF/XML serialisation using meta-data attributes.
[PyCIM.git] / schemata / CIM14 / Dynamics / Slot.py
blobdafe77548b28ab3f5550b467167643845a49ea22
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.
24 @param blockType0:
25 @param slotReference0:
26 @param slotOutput0:
27 @param connectionFrame0:
28 @param slotInput0:
29 """
30 self._blockType0 = None
31 self.blockType0 = blockType0
33 self._slotReference0 = []
34 self.slotReference0 = [] if slotReference0 is None else slotReference0
36 self._slotOutput0 = []
37 self.slotOutput0 = [] if slotOutput0 is None else slotOutput0
39 self._connectionFrame0 = None
40 self.connectionFrame0 = connectionFrame0
42 self._slotInput0 = []
43 self.slotInput0 = [] if slotInput0 is None else slotInput0
45 super(Slot, self).__init__(*args, **kw_args)
47 _attrs = []
48 _attr_types = {}
49 _defaults = {}
50 _enums = {}
51 _refs = ["blockType0", "slotReference0", "slotOutput0", "connectionFrame0", "slotInput0"]
52 _many_refs = ["slotReference0", "slotOutput0", "slotInput0"]
54 def getblockType0(self):
56 return self._blockType0
58 def setblockType0(self, value):
59 if self._blockType0 is not None:
60 filtered = [x for x in self.blockType0.slot0 if x != self]
61 self._blockType0._slot0 = filtered
63 self._blockType0 = value
64 if self._blockType0 is not None:
65 self._blockType0._slot0.append(self)
67 blockType0 = property(getblockType0, setblockType0)
69 def getslotReference0(self):
71 return self._slotReference0
73 def setslotReference0(self, value):
74 for x in self._slotReference0:
75 x._slot0 = None
76 for y in value:
77 y._slot0 = self
78 self._slotReference0 = value
80 slotReference0 = property(getslotReference0, setslotReference0)
82 def addslotReference0(self, *slotReference0):
83 for obj in slotReference0:
84 obj._slot0 = self
85 self._slotReference0.append(obj)
87 def removeslotReference0(self, *slotReference0):
88 for obj in slotReference0:
89 obj._slot0 = None
90 self._slotReference0.remove(obj)
92 def getslotOutput0(self):
94 return self._slotOutput0
96 def setslotOutput0(self, value):
97 for x in self._slotOutput0:
98 x._slot0 = None
99 for y in value:
100 y._slot0 = self
101 self._slotOutput0 = value
103 slotOutput0 = property(getslotOutput0, setslotOutput0)
105 def addslotOutput0(self, *slotOutput0):
106 for obj in slotOutput0:
107 obj._slot0 = self
108 self._slotOutput0.append(obj)
110 def removeslotOutput0(self, *slotOutput0):
111 for obj in slotOutput0:
112 obj._slot0 = None
113 self._slotOutput0.remove(obj)
115 def getconnectionFrame0(self):
117 return self._connectionFrame0
119 def setconnectionFrame0(self, value):
120 if self._connectionFrame0 is not None:
121 filtered = [x for x in self.connectionFrame0.slot0 if x != self]
122 self._connectionFrame0._slot0 = filtered
124 self._connectionFrame0 = value
125 if self._connectionFrame0 is not None:
126 self._connectionFrame0._slot0.append(self)
128 connectionFrame0 = property(getconnectionFrame0, setconnectionFrame0)
130 def getslotInput0(self):
132 return self._slotInput0
134 def setslotInput0(self, value):
135 for x in self._slotInput0:
136 x._slot0 = None
137 for y in value:
138 y._slot0 = self
139 self._slotInput0 = value
141 slotInput0 = property(getslotInput0, setslotInput0)
143 def addslotInput0(self, *slotInput0):
144 for obj in slotInput0:
145 obj._slot0 = self
146 self._slotInput0.append(obj)
148 def removeslotInput0(self, *slotInput0):
149 for obj in slotInput0:
150 obj._slot0 = None
151 self._slotInput0.remove(obj)