Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Core / Bay.py
blob98b6189905647fb4a501f983052268d3739b308e
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.EquipmentContainer import EquipmentContainer
23 class Bay(EquipmentContainer):
24 """A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry.
25 """
27 def __init__(self, busBarConfiguration="mainWithTransfer", breakerConfiguration="breakerAndAHalf", bayPowerMeasFlag=False, bayEnergyMeasFlag=False, Substation=None, VoltageLevel=None, *args, **kw_args):
28 """Initialises a new 'Bay' instance.
30 @param busBarConfiguration: Bus bar configuration. Values are: "mainWithTransfer", "ringBus", "singleBus", "doubleBus"
31 @param breakerConfiguration: Breaker configuration. Values are: "breakerAndAHalf", "singleBreaker", "noBreaker", "doubleBreaker"
32 @param bayPowerMeasFlag: Indicates the presence/absence of active/reactive power measurements.
33 @param bayEnergyMeasFlag: Indicates the presence/absence of energy measurements.
34 @param Substation: The association is used in the naming hierarchy.
35 @param VoltageLevel: The association is used in the naming hierarchy.
36 """
37 #: Bus bar configuration. Values are: "mainWithTransfer", "ringBus", "singleBus", "doubleBus"
38 self.busBarConfiguration = busBarConfiguration
40 #: Breaker configuration. Values are: "breakerAndAHalf", "singleBreaker", "noBreaker", "doubleBreaker"
41 self.breakerConfiguration = breakerConfiguration
43 #: Indicates the presence/absence of active/reactive power measurements.
44 self.bayPowerMeasFlag = bayPowerMeasFlag
46 #: Indicates the presence/absence of energy measurements.
47 self.bayEnergyMeasFlag = bayEnergyMeasFlag
49 self._Substation = None
50 self.Substation = Substation
52 self._VoltageLevel = None
53 self.VoltageLevel = VoltageLevel
55 super(Bay, self).__init__(*args, **kw_args)
57 _attrs = ["busBarConfiguration", "breakerConfiguration", "bayPowerMeasFlag", "bayEnergyMeasFlag"]
58 _attr_types = {"busBarConfiguration": str, "breakerConfiguration": str, "bayPowerMeasFlag": bool, "bayEnergyMeasFlag": bool}
59 _defaults = {"busBarConfiguration": "mainWithTransfer", "breakerConfiguration": "breakerAndAHalf", "bayPowerMeasFlag": False, "bayEnergyMeasFlag": False}
60 _enums = {"busBarConfiguration": "BusbarConfiguration", "breakerConfiguration": "BreakerConfiguration"}
61 _refs = ["Substation", "VoltageLevel"]
62 _many_refs = []
64 def getSubstation(self):
65 """The association is used in the naming hierarchy.
66 """
67 return self._Substation
69 def setSubstation(self, value):
70 if self._Substation is not None:
71 filtered = [x for x in self.Substation.Bays if x != self]
72 self._Substation._Bays = filtered
74 self._Substation = value
75 if self._Substation is not None:
76 if self not in self._Substation._Bays:
77 self._Substation._Bays.append(self)
79 Substation = property(getSubstation, setSubstation)
81 def getVoltageLevel(self):
82 """The association is used in the naming hierarchy.
83 """
84 return self._VoltageLevel
86 def setVoltageLevel(self, value):
87 if self._VoltageLevel is not None:
88 filtered = [x for x in self.VoltageLevel.Bays if x != self]
89 self._VoltageLevel._Bays = filtered
91 self._VoltageLevel = value
92 if self._VoltageLevel is not None:
93 if self not in self._VoltageLevel._Bays:
94 self._VoltageLevel._Bays.append(self)
96 VoltageLevel = property(getVoltageLevel, setVoltageLevel)