Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Wires / CompositeSwitch.py
blob281c5d0c4a4037fe26a9ab4460bfc08df625040d
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
19 # IN THE SOFTWARE.
21 from CIM14.IEC61970.Core.Equipment import Equipment
23 class CompositeSwitch(Equipment):
24 """A model of a set of individual Switches normally enclosed within the same cabinet and possibly with interlocks that restrict the combination of switch positions. These are typically found in medium voltage distribution networks. A CompositeSwitch could represent a Ring-Main-Unit (RMU), or pad-mounted switchgear, with primitive internal devices such as an internal bus-bar plus 3 or 4 internal switches each of which may individually be open or closed. A CompositeSwitch and a set of contained Switches can also be used to represent a multi-position switch e.g. a switch that can connect a circuit to Ground, Open or Busbar.
25 """
27 def __init__(self, compositeSwitchType='', Switches=None, *args, **kw_args):
28 """Initialises a new 'CompositeSwitch' instance.
30 @param compositeSwitchType: An alphanumeric code that can be used as a reference to extar information such as the description of the interlocking scheme if any
31 @param Switches: Switches contained in this Composite switch.
32 """
33 #: An alphanumeric code that can be used as a reference to extar information such as the description of the interlocking scheme if any
34 self.compositeSwitchType = compositeSwitchType
36 self._Switches = []
37 self.Switches = [] if Switches is None else Switches
39 super(CompositeSwitch, self).__init__(*args, **kw_args)
41 _attrs = ["compositeSwitchType"]
42 _attr_types = {"compositeSwitchType": str}
43 _defaults = {"compositeSwitchType": ''}
44 _enums = {}
45 _refs = ["Switches"]
46 _many_refs = ["Switches"]
48 def getSwitches(self):
49 """Switches contained in this Composite switch.
50 """
51 return self._Switches
53 def setSwitches(self, value):
54 for x in self._Switches:
55 x.CompositeSwitch = None
56 for y in value:
57 y._CompositeSwitch = self
58 self._Switches = value
60 Switches = property(getSwitches, setSwitches)
62 def addSwitches(self, *Switches):
63 for obj in Switches:
64 obj.CompositeSwitch = self
66 def removeSwitches(self, *Switches):
67 for obj in Switches:
68 obj.CompositeSwitch = None