Adding CDPSM package.
[PyCIM.git] / CIM14 / IEC61970 / Core / Bay.py
blob3ccd0433107380d6b848eb918da7b5483b40c773
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.EquipmentContainer import EquipmentContainer
19 class Bay(EquipmentContainer):
20 """A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry.
21 """
23 def __init__(self, busBarConfiguration="mainWithTransfer", breakerConfiguration="breakerAndAHalf", bayPowerMeasFlag=False, bayEnergyMeasFlag=False, Substation=None, VoltageLevel=None, *args, **kw_args):
24 """Initialises a new 'Bay' instance.
26 @param busBarConfiguration: Bus bar configuration. Values are: "mainWithTransfer", "ringBus", "singleBus", "doubleBus"
27 @param breakerConfiguration: Breaker configuration. Values are: "breakerAndAHalf", "singleBreaker", "noBreaker", "doubleBreaker"
28 @param bayPowerMeasFlag: Indicates the presence/absence of active/reactive power measurements.
29 @param bayEnergyMeasFlag: Indicates the presence/absence of energy measurements.
30 @param Substation: The association is used in the naming hierarchy.
31 @param VoltageLevel: The association is used in the naming hierarchy.
32 """
33 #: Bus bar configuration. Values are: "mainWithTransfer", "ringBus", "singleBus", "doubleBus"
34 self.busBarConfiguration = busBarConfiguration
36 #: Breaker configuration. Values are: "breakerAndAHalf", "singleBreaker", "noBreaker", "doubleBreaker"
37 self.breakerConfiguration = breakerConfiguration
39 #: Indicates the presence/absence of active/reactive power measurements.
40 self.bayPowerMeasFlag = bayPowerMeasFlag
42 #: Indicates the presence/absence of energy measurements.
43 self.bayEnergyMeasFlag = bayEnergyMeasFlag
45 self._Substation = None
46 self.Substation = Substation
48 self._VoltageLevel = None
49 self.VoltageLevel = VoltageLevel
51 super(Bay, self).__init__(*args, **kw_args)
53 _attrs = ["busBarConfiguration", "breakerConfiguration", "bayPowerMeasFlag", "bayEnergyMeasFlag"]
54 _attr_types = {"busBarConfiguration": str, "breakerConfiguration": str, "bayPowerMeasFlag": bool, "bayEnergyMeasFlag": bool}
55 _defaults = {"busBarConfiguration": "mainWithTransfer", "breakerConfiguration": "breakerAndAHalf", "bayPowerMeasFlag": False, "bayEnergyMeasFlag": False}
56 _enums = {"busBarConfiguration": "BusbarConfiguration", "breakerConfiguration": "BreakerConfiguration"}
57 _refs = ["Substation", "VoltageLevel"]
58 _many_refs = []
60 def getSubstation(self):
61 """The association is used in the naming hierarchy.
62 """
63 return self._Substation
65 def setSubstation(self, value):
66 if self._Substation is not None:
67 filtered = [x for x in self.Substation.Bays if x != self]
68 self._Substation._Bays = filtered
70 self._Substation = value
71 if self._Substation is not None:
72 if self not in self._Substation._Bays:
73 self._Substation._Bays.append(self)
75 Substation = property(getSubstation, setSubstation)
77 def getVoltageLevel(self):
78 """The association is used in the naming hierarchy.
79 """
80 return self._VoltageLevel
82 def setVoltageLevel(self, value):
83 if self._VoltageLevel is not None:
84 filtered = [x for x in self.VoltageLevel.Bays if x != self]
85 self._VoltageLevel._Bays = filtered
87 self._VoltageLevel = value
88 if self._VoltageLevel is not None:
89 if self not in self._VoltageLevel._Bays:
90 self._VoltageLevel._Bays.append(self)
92 VoltageLevel = property(getVoltageLevel, setVoltageLevel)