Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Dynamics / Generators / GenEquiv.py
blob74cd190dd1cf834e8e7df1b8be49fb2196f4cdac
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.Dynamics.RotatingMachine import RotatingMachine
23 class GenEquiv(RotatingMachine):
24 """An equivalent representation of a synchronous generator as a constant internal voltage behind an impedance Ra plus Xp.
25 """
27 def __init__(self, xp=0.0, synchronousMachine0=None, *args, **kw_args):
28 """Initialises a new 'GenEquiv' instance.
30 @param xp: Equivalent reactance, also known as Xp.
31 @param synchronousMachine0:
32 """
33 #: Equivalent reactance, also known as Xp.
34 self.xp = xp
36 self._synchronousMachine0 = []
37 self.synchronousMachine0 = [] if synchronousMachine0 is None else synchronousMachine0
39 super(GenEquiv, self).__init__(*args, **kw_args)
41 _attrs = ["xp"]
42 _attr_types = {"xp": float}
43 _defaults = {"xp": 0.0}
44 _enums = {}
45 _refs = ["synchronousMachine0"]
46 _many_refs = ["synchronousMachine0"]
48 def getsynchronousMachine0(self):
50 return self._synchronousMachine0
52 def setsynchronousMachine0(self, value):
53 for p in self._synchronousMachine0:
54 filtered = [q for q in p.genEquiv0 if q != self]
55 self._synchronousMachine0._genEquiv0 = filtered
56 for r in value:
57 if self not in r._genEquiv0:
58 r._genEquiv0.append(self)
59 self._synchronousMachine0 = value
61 synchronousMachine0 = property(getsynchronousMachine0, setsynchronousMachine0)
63 def addsynchronousMachine0(self, *synchronousMachine0):
64 for obj in synchronousMachine0:
65 if self not in obj._genEquiv0:
66 obj._genEquiv0.append(self)
67 self._synchronousMachine0.append(obj)
69 def removesynchronousMachine0(self, *synchronousMachine0):
70 for obj in synchronousMachine0:
71 if self in obj._genEquiv0:
72 obj._genEquiv0.remove(self)
73 self._synchronousMachine0.remove(obj)