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
.ENTSOE
.Equipment
.Core
.PowerSystemResource
import PowerSystemResource
23 class RegulatingControl(PowerSystemResource
):
24 """Specifies a set of equipment that works together to control a power system quantity such as voltage or flow.
27 def __init__(self
, targetRange
=0.0, mode
="reactivePower", discrete
=False, targetValue
=0.0, Terminal
=None, RegulatingCondEq
=None, TapChanger
=None, *args
, **kw_args
):
28 """Initialises a new 'RegulatingControl' instance.
30 @param targetRange: This is the case input target range. This performs the same function as the value2 attribute on the regulation schedule in the case that schedules are not used. The units of those appropriate for the mode.
31 @param mode: The regulating control mode presently available. This specifications allows for determining the kind of regualation without need for obtaining the units from a schedule. Values are: "reactivePower", "timeScheduled", "voltage", "activePower", "currentFlow", "fixed", "temperature", "powerFactor", "admittance"
32 @param discrete: The regulation is performed in a discrete mode.
33 @param targetValue: The target value specified for case input. This value can be used for the target value wihout the use of schedules. The value has the units appropriate to the mode attribute.
34 @param Terminal: The terminal associated with this regulating control.
35 @param RegulatingCondEq: The equipment that participates in this regulating control scheme.
36 @param TapChanger: copy from reg conduting eq
38 #: This is the case input target range. This performs the same function as the value2 attribute on the regulation schedule in the case that schedules are not used. The units of those appropriate for the mode.
39 self
.targetRange
= targetRange
41 #: The regulating control mode presently available. This specifications allows for determining the kind of regualation without need for obtaining the units from a schedule. Values are: "reactivePower", "timeScheduled", "voltage", "activePower", "currentFlow", "fixed", "temperature", "powerFactor", "admittance"
44 #: The regulation is performed in a discrete mode.
45 self
.discrete
= discrete
47 #: The target value specified for case input. This value can be used for the target value wihout the use of schedules. The value has the units appropriate to the mode attribute.
48 self
.targetValue
= targetValue
51 self
.Terminal
= Terminal
53 self
._RegulatingCondEq
= []
54 self
.RegulatingCondEq
= [] if RegulatingCondEq
is None else RegulatingCondEq
57 self
.TapChanger
= [] if TapChanger
is None else TapChanger
59 super(RegulatingControl
, self
).__init
__(*args
, **kw_args
)
61 _attrs
= ["targetRange", "mode", "discrete", "targetValue"]
62 _attr_types
= {"targetRange": float, "mode": str, "discrete": bool, "targetValue": float}
63 _defaults
= {"targetRange": 0.0, "mode": "reactivePower", "discrete": False, "targetValue": 0.0}
64 _enums
= {"mode": "RegulatingControlModeKind"}
65 _refs
= ["Terminal", "RegulatingCondEq", "TapChanger"]
66 _many_refs
= ["RegulatingCondEq", "TapChanger"]
68 def getTerminal(self
):
69 """The terminal associated with this regulating control.
73 def setTerminal(self
, value
):
74 if self
._Terminal
is not None:
75 filtered
= [x
for x
in self
.Terminal
.RegulatingControl
if x
!= self
]
76 self
._Terminal
._RegulatingControl
= filtered
78 self
._Terminal
= value
79 if self
._Terminal
is not None:
80 if self
not in self
._Terminal
._RegulatingControl
:
81 self
._Terminal
._RegulatingControl
.append(self
)
83 Terminal
= property(getTerminal
, setTerminal
)
85 def getRegulatingCondEq(self
):
86 """The equipment that participates in this regulating control scheme.
88 return self
._RegulatingCondEq
90 def setRegulatingCondEq(self
, value
):
91 for x
in self
._RegulatingCondEq
:
92 x
.RegulatingControl
= None
94 y
._RegulatingControl
= self
95 self
._RegulatingCondEq
= value
97 RegulatingCondEq
= property(getRegulatingCondEq
, setRegulatingCondEq
)
99 def addRegulatingCondEq(self
, *RegulatingCondEq
):
100 for obj
in RegulatingCondEq
:
101 obj
.RegulatingControl
= self
103 def removeRegulatingCondEq(self
, *RegulatingCondEq
):
104 for obj
in RegulatingCondEq
:
105 obj
.RegulatingControl
= None
107 def getTapChanger(self
):
108 """copy from reg conduting eq
110 return self
._TapChanger
112 def setTapChanger(self
, value
):
113 for x
in self
._TapChanger
:
114 x
.RegulatingControl
= None
116 y
._RegulatingControl
= self
117 self
._TapChanger
= value
119 TapChanger
= property(getTapChanger
, setTapChanger
)
121 def addTapChanger(self
, *TapChanger
):
122 for obj
in TapChanger
:
123 obj
.RegulatingControl
= self
125 def removeTapChanger(self
, *TapChanger
):
126 for obj
in TapChanger
:
127 obj
.RegulatingControl
= None