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
21 from CIM14
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class BranchGroup(IdentifiedObject
):
24 """A group of branch terminals whose directed flow summation is to be monitored. Abranch group need not form a cutset of the network.
27 def __init__(self
, minimumReactivePower
=0.0, monitorActivePower
=False, minimumActivePower
=0.0, maximumReactivePower
=0.0, maximumActivePower
=0.0, monitorReactivePower
=False, BranchGroupTerminal
=None, *args
, **kw_args
):
28 """Initialises a new 'BranchGroup' instance.
30 @param minimumReactivePower: The minimum reactive power flow.
31 @param monitorActivePower: Monitor the active power flow.
32 @param minimumActivePower: The minimum active power flow.
33 @param maximumReactivePower: The maximum reactive power flow.
34 @param maximumActivePower: The maximum active power flow.
35 @param monitorReactivePower: Monitor the reactive power flow.
36 @param BranchGroupTerminal: The directed branch group terminals to be summed.
38 #: The minimum reactive power flow.
39 self
.minimumReactivePower
= minimumReactivePower
41 #: Monitor the active power flow.
42 self
.monitorActivePower
= monitorActivePower
44 #: The minimum active power flow.
45 self
.minimumActivePower
= minimumActivePower
47 #: The maximum reactive power flow.
48 self
.maximumReactivePower
= maximumReactivePower
50 #: The maximum active power flow.
51 self
.maximumActivePower
= maximumActivePower
53 #: Monitor the reactive power flow.
54 self
.monitorReactivePower
= monitorReactivePower
56 self
._BranchGroupTerminal
= []
57 self
.BranchGroupTerminal
= [] if BranchGroupTerminal
is None else BranchGroupTerminal
59 super(BranchGroup
, self
).__init
__(*args
, **kw_args
)
61 _attrs
= ["minimumReactivePower", "monitorActivePower", "minimumActivePower", "maximumReactivePower", "maximumActivePower", "monitorReactivePower"]
62 _attr_types
= {"minimumReactivePower": float, "monitorActivePower": bool, "minimumActivePower": float, "maximumReactivePower": float, "maximumActivePower": float, "monitorReactivePower": bool}
63 _defaults
= {"minimumReactivePower": 0.0, "monitorActivePower": False, "minimumActivePower": 0.0, "maximumReactivePower": 0.0, "maximumActivePower": 0.0, "monitorReactivePower": False}
65 _refs
= ["BranchGroupTerminal"]
66 _many_refs
= ["BranchGroupTerminal"]
68 def getBranchGroupTerminal(self
):
69 """The directed branch group terminals to be summed.
71 return self
._BranchGroupTerminal
73 def setBranchGroupTerminal(self
, value
):
74 for x
in self
._BranchGroupTerminal
:
78 self
._BranchGroupTerminal
= value
80 BranchGroupTerminal
= property(getBranchGroupTerminal
, setBranchGroupTerminal
)
82 def addBranchGroupTerminal(self
, *BranchGroupTerminal
):
83 for obj
in BranchGroupTerminal
:
84 obj
.BranchGroup
= self
86 def removeBranchGroupTerminal(self
, *BranchGroupTerminal
):
87 for obj
in BranchGroupTerminal
:
88 obj
.BranchGroup
= None