Adding CDPSM package.
[PyCIM.git] / CIM14 / IEC61970 / Wires / RegulatingControl.py
blob461716e769230f67686e79b72a7439a8ca7be8d5
1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14.IEC61970.Core.PowerSystemResource import PowerSystemResource
19 class RegulatingControl(PowerSystemResource):
20 """Specifies a set of equipment that works together to control a power system quantity such as voltage or flow.
21 """
23 def __init__(self, mode="fixed", targetRange=0.0, discrete=False, targetValue=0.0, RegulationSchedule=None, Terminal=None, TapChanger=None, RegulatingCondEq=None, *args, **kw_args):
24 """Initialises a new 'RegulatingControl' instance.
26 @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"
27 @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.
28 @param discrete: The regulation is performed in a discrete mode.
29 @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.
30 @param RegulationSchedule: Schedule for this Regulating regulating control.
31 @param Terminal: The terminal associated with this regulating control.
32 @param TapChanger: copy from reg conduting eq
33 @param RegulatingCondEq: The equipment that participates in this regulating control scheme.
34 """
35 #: 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"
36 self.mode = mode
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 regulation is performed in a discrete mode.
42 self.discrete = discrete
44 #: 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.
45 self.targetValue = targetValue
47 self._RegulationSchedule = []
48 self.RegulationSchedule = [] if RegulationSchedule is None else RegulationSchedule
50 self._Terminal = None
51 self.Terminal = Terminal
53 self._TapChanger = []
54 self.TapChanger = [] if TapChanger is None else TapChanger
56 self._RegulatingCondEq = []
57 self.RegulatingCondEq = [] if RegulatingCondEq is None else RegulatingCondEq
59 super(RegulatingControl, self).__init__(*args, **kw_args)
61 _attrs = ["mode", "targetRange", "discrete", "targetValue"]
62 _attr_types = {"mode": str, "targetRange": float, "discrete": bool, "targetValue": float}
63 _defaults = {"mode": "fixed", "targetRange": 0.0, "discrete": False, "targetValue": 0.0}
64 _enums = {"mode": "RegulatingControlModeKind"}
65 _refs = ["RegulationSchedule", "Terminal", "TapChanger", "RegulatingCondEq"]
66 _many_refs = ["RegulationSchedule", "TapChanger", "RegulatingCondEq"]
68 def getRegulationSchedule(self):
69 """Schedule for this Regulating regulating control.
70 """
71 return self._RegulationSchedule
73 def setRegulationSchedule(self, value):
74 for x in self._RegulationSchedule:
75 x.RegulatingControl = None
76 for y in value:
77 y._RegulatingControl = self
78 self._RegulationSchedule = value
80 RegulationSchedule = property(getRegulationSchedule, setRegulationSchedule)
82 def addRegulationSchedule(self, *RegulationSchedule):
83 for obj in RegulationSchedule:
84 obj.RegulatingControl = self
86 def removeRegulationSchedule(self, *RegulationSchedule):
87 for obj in RegulationSchedule:
88 obj.RegulatingControl = None
90 def getTerminal(self):
91 """The terminal associated with this regulating control.
92 """
93 return self._Terminal
95 def setTerminal(self, value):
96 if self._Terminal is not None:
97 filtered = [x for x in self.Terminal.RegulatingControl if x != self]
98 self._Terminal._RegulatingControl = filtered
100 self._Terminal = value
101 if self._Terminal is not None:
102 if self not in self._Terminal._RegulatingControl:
103 self._Terminal._RegulatingControl.append(self)
105 Terminal = property(getTerminal, setTerminal)
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
115 for y in value:
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
129 def getRegulatingCondEq(self):
130 """The equipment that participates in this regulating control scheme.
132 return self._RegulatingCondEq
134 def setRegulatingCondEq(self, value):
135 for x in self._RegulatingCondEq:
136 x.RegulatingControl = None
137 for y in value:
138 y._RegulatingControl = self
139 self._RegulatingCondEq = value
141 RegulatingCondEq = property(getRegulatingCondEq, setRegulatingCondEq)
143 def addRegulatingCondEq(self, *RegulatingCondEq):
144 for obj in RegulatingCondEq:
145 obj.RegulatingControl = self
147 def removeRegulatingCondEq(self, *RegulatingCondEq):
148 for obj in RegulatingCondEq:
149 obj.RegulatingControl = None