Update README.rst
[PyCIM.git] / CIM14 / CDPSM / GIS_Connectivity / IEC61970 / Wires / SynchronousMachine.py
blobcbebdfcb965e70fe75a144b277c39d0de1ba2dfd
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.CDPSM.GIS_Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment
23 class SynchronousMachine(ConductingEquipment):
24 """An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump.
25 """
27 def __init__(self, baseQ=0.0, operatingMode="condenser", type="condenser", maxQ=0.0, minQ=0.0, GeneratingUnit=None, *args, **kw_args):
28 """Initialises a new 'SynchronousMachine' instance.
30 @param baseQ: Default base reactive power value. This value represents the initial reactive power that can be used by any application function.
31 @param operatingMode: Current mode of operation. Values are: "condenser", "generator"
32 @param type: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator"
33 @param maxQ: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit.
34 @param minQ: Minimum reactive power limit for the unit.
35 @param GeneratingUnit: A synchronous machine may operate as a generator and as such becomes a member of a generating unit
36 """
37 #: Default base reactive power value. This value represents the initial reactive power that can be used by any application function.
38 self.baseQ = baseQ
40 #: Current mode of operation. Values are: "condenser", "generator"
41 self.operatingMode = operatingMode
43 #: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator"
44 self.type = type
46 #: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit.
47 self.maxQ = maxQ
49 #: Minimum reactive power limit for the unit.
50 self.minQ = minQ
52 self._GeneratingUnit = None
53 self.GeneratingUnit = GeneratingUnit
55 super(SynchronousMachine, self).__init__(*args, **kw_args)
57 _attrs = ["baseQ", "operatingMode", "type", "maxQ", "minQ"]
58 _attr_types = {"baseQ": float, "operatingMode": str, "type": str, "maxQ": float, "minQ": float}
59 _defaults = {"baseQ": 0.0, "operatingMode": "condenser", "type": "condenser", "maxQ": 0.0, "minQ": 0.0}
60 _enums = {"operatingMode": "SynchronousMachineOperatingMode", "type": "SynchronousMachineType"}
61 _refs = ["GeneratingUnit"]
62 _many_refs = []
64 def getGeneratingUnit(self):
65 """A synchronous machine may operate as a generator and as such becomes a member of a generating unit
66 """
67 return self._GeneratingUnit
69 def setGeneratingUnit(self, value):
70 if self._GeneratingUnit is not None:
71 filtered = [x for x in self.GeneratingUnit.SynchronousMachines if x != self]
72 self._GeneratingUnit._SynchronousMachines = filtered
74 self._GeneratingUnit = value
75 if self._GeneratingUnit is not None:
76 if self not in self._GeneratingUnit._SynchronousMachines:
77 self._GeneratingUnit._SynchronousMachines.append(self)
79 GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit)