Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Wires / RegulatingControl.py
blob8138045b50ad65a83f00c9e1e94b27be4a7da1b5
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.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.
25 """
27 def __init__(self, mode="fixed", targetRange=0.0, discrete=False, targetValue=0.0, RegulationSchedule=None, Terminal=None, TapChanger=None, RegulatingCondEq=None, *args, **kw_args):
28 """Initialises a new 'RegulatingControl' instance.
30 @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: "fixed", "voltage", "timeScheduled", "currentFlow", "admittance", "powerFactor", "activePower", "reactivePower", "temperature"
31 @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.
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 RegulationSchedule: Schedule for this Regulating regulating control.
35 @param Terminal: The terminal associated with this regulating control.
36 @param TapChanger: copy from reg conduting eq
37 @param RegulatingCondEq: The equipment that participates in this regulating control scheme.
38 """
39 #: 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: "fixed", "voltage", "timeScheduled", "currentFlow", "admittance", "powerFactor", "activePower", "reactivePower", "temperature"
40 self.mode = mode
42 #: 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.
43 self.targetRange = targetRange
45 #: The regulation is performed in a discrete mode.
46 self.discrete = discrete
48 #: 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.
49 self.targetValue = targetValue
51 self._RegulationSchedule = []
52 self.RegulationSchedule = [] if RegulationSchedule is None else RegulationSchedule
54 self._Terminal = None
55 self.Terminal = Terminal
57 self._TapChanger = []
58 self.TapChanger = [] if TapChanger is None else TapChanger
60 self._RegulatingCondEq = []
61 self.RegulatingCondEq = [] if RegulatingCondEq is None else RegulatingCondEq
63 super(RegulatingControl, self).__init__(*args, **kw_args)
65 _attrs = ["mode", "targetRange", "discrete", "targetValue"]
66 _attr_types = {"mode": str, "targetRange": float, "discrete": bool, "targetValue": float}
67 _defaults = {"mode": "fixed", "targetRange": 0.0, "discrete": False, "targetValue": 0.0}
68 _enums = {"mode": "RegulatingControlModeKind"}
69 _refs = ["RegulationSchedule", "Terminal", "TapChanger", "RegulatingCondEq"]
70 _many_refs = ["RegulationSchedule", "TapChanger", "RegulatingCondEq"]
72 def getRegulationSchedule(self):
73 """Schedule for this Regulating regulating control.
74 """
75 return self._RegulationSchedule
77 def setRegulationSchedule(self, value):
78 for x in self._RegulationSchedule:
79 x.RegulatingControl = None
80 for y in value:
81 y._RegulatingControl = self
82 self._RegulationSchedule = value
84 RegulationSchedule = property(getRegulationSchedule, setRegulationSchedule)
86 def addRegulationSchedule(self, *RegulationSchedule):
87 for obj in RegulationSchedule:
88 obj.RegulatingControl = self
90 def removeRegulationSchedule(self, *RegulationSchedule):
91 for obj in RegulationSchedule:
92 obj.RegulatingControl = None
94 def getTerminal(self):
95 """The terminal associated with this regulating control.
96 """
97 return self._Terminal
99 def setTerminal(self, value):
100 if self._Terminal is not None:
101 filtered = [x for x in self.Terminal.RegulatingControl if x != self]
102 self._Terminal._RegulatingControl = filtered
104 self._Terminal = value
105 if self._Terminal is not None:
106 if self not in self._Terminal._RegulatingControl:
107 self._Terminal._RegulatingControl.append(self)
109 Terminal = property(getTerminal, setTerminal)
111 def getTapChanger(self):
112 """copy from reg conduting eq
114 return self._TapChanger
116 def setTapChanger(self, value):
117 for x in self._TapChanger:
118 x.RegulatingControl = None
119 for y in value:
120 y._RegulatingControl = self
121 self._TapChanger = value
123 TapChanger = property(getTapChanger, setTapChanger)
125 def addTapChanger(self, *TapChanger):
126 for obj in TapChanger:
127 obj.RegulatingControl = self
129 def removeTapChanger(self, *TapChanger):
130 for obj in TapChanger:
131 obj.RegulatingControl = None
133 def getRegulatingCondEq(self):
134 """The equipment that participates in this regulating control scheme.
136 return self._RegulatingCondEq
138 def setRegulatingCondEq(self, value):
139 for x in self._RegulatingCondEq:
140 x.RegulatingControl = None
141 for y in value:
142 y._RegulatingControl = self
143 self._RegulatingCondEq = value
145 RegulatingCondEq = property(getRegulatingCondEq, setRegulatingCondEq)
147 def addRegulatingCondEq(self, *RegulatingCondEq):
148 for obj in RegulatingCondEq:
149 obj.RegulatingControl = self
151 def removeRegulatingCondEq(self, *RegulatingCondEq):
152 for obj in RegulatingCondEq:
153 obj.RegulatingControl = None