Fixing website and API documentation links
[PyCIM.git] / CIM14 / CPSM / Equipment / Wires / RegulatingControl.py
blobfd050681dcf62906814c8ce174991f0a3df0b7fe
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.CPSM.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.Although targetRange and targetValue is optional, at least one must be used.
25 """
27 def __init__(self, targetRange=0.0, mode="reactivePower", discrete=False, targetValue=0.0, RegulationSchedule=None, 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 RegulationSchedule: Schedule for this Regulating regulating control.
35 @param Terminal: The terminal associated with this regulating control.
36 @param RegulatingCondEq: The equipment that participates in this regulating control scheme.
37 @param TapChanger: copy from reg conduting eq
38 """
39 #: 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.
40 self.targetRange = targetRange
42 #: 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"
43 self.mode = mode
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._RegulatingCondEq = []
58 self.RegulatingCondEq = [] if RegulatingCondEq is None else RegulatingCondEq
60 self._TapChanger = []
61 self.TapChanger = [] if TapChanger is None else TapChanger
63 super(RegulatingControl, self).__init__(*args, **kw_args)
65 _attrs = ["targetRange", "mode", "discrete", "targetValue"]
66 _attr_types = {"targetRange": float, "mode": str, "discrete": bool, "targetValue": float}
67 _defaults = {"targetRange": 0.0, "mode": "reactivePower", "discrete": False, "targetValue": 0.0}
68 _enums = {"mode": "RegulatingControlModeKind"}
69 _refs = ["RegulationSchedule", "Terminal", "RegulatingCondEq", "TapChanger"]
70 _many_refs = ["RegulationSchedule", "RegulatingCondEq", "TapChanger"]
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 getRegulatingCondEq(self):
112 """The equipment that participates in this regulating control scheme.
114 return self._RegulatingCondEq
116 def setRegulatingCondEq(self, value):
117 for x in self._RegulatingCondEq:
118 x.RegulatingControl = None
119 for y in value:
120 y._RegulatingControl = self
121 self._RegulatingCondEq = value
123 RegulatingCondEq = property(getRegulatingCondEq, setRegulatingCondEq)
125 def addRegulatingCondEq(self, *RegulatingCondEq):
126 for obj in RegulatingCondEq:
127 obj.RegulatingControl = self
129 def removeRegulatingCondEq(self, *RegulatingCondEq):
130 for obj in RegulatingCondEq:
131 obj.RegulatingControl = None
133 def getTapChanger(self):
134 """copy from reg conduting eq
136 return self._TapChanger
138 def setTapChanger(self, value):
139 for x in self._TapChanger:
140 x.RegulatingControl = None
141 for y in value:
142 y._RegulatingControl = self
143 self._TapChanger = value
145 TapChanger = property(getTapChanger, setTapChanger)
147 def addTapChanger(self, *TapChanger):
148 for obj in TapChanger:
149 obj.RegulatingControl = self
151 def removeTapChanger(self, *TapChanger):
152 for obj in TapChanger:
153 obj.RegulatingControl = None