Update README.rst
[PyCIM.git] / CIM14 / CPSM / Equipment / Wires / TapChanger.py
blobf8aa63c3ae1528f40e46501a786c807bbe2b76d1
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 TapChanger(PowerSystemResource):
24 """Mechanism for changing transformer winding tap positions.
25 """
27 def __init__(self, stepVoltageIncrement=0.0, neutralStep=0, normalStep=0, ltcFlag=False, neutralU=0.0, lowStep=0, regulationStatus=False, highStep=0, TapSchedules=None, ImpedanceVariationCurve=None, RegulatingControl=None, *args, **kw_args):
28 """Initialises a new 'TapChanger' instance.
30 @param stepVoltageIncrement: Tap step increment, in per cent of nominal voltage, per step position. For a symmetrical PhaseTapChanger, the stepVoltageIncrement is used in the formula for calculation of the phase angle. For a symmetrical PhaseTapChanger, the voltage magnitude does not change with tap step.This is required if the Tap Changer is a RatioTapChanger and there is no step change table.
31 @param neutralStep: The neutral tap step position for this winding.
32 @param normalStep: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting.
33 @param ltcFlag: Specifies whether or not a TapChanger has load tap changing capabilities.
34 @param neutralU: Voltage at which the winding operates at the neutral tap setting.
35 @param lowStep: Lowest possible tap step position, retard from neutral
36 @param regulationStatus: Specifies the default regulation status of the TapChanger. True is regulating. False is not regulating.
37 @param highStep: Highest possible tap step position, advance from neutral
38 @param TapSchedules: A TapChanger can have TapSchedules.
39 @param ImpedanceVariationCurve: A TapChanger can have an associated ImpedanceVariationCurve to define impedance variations with tap step changes.
40 @param RegulatingControl:
41 """
42 #: Tap step increment, in per cent of nominal voltage, per step position. For a symmetrical PhaseTapChanger, the stepVoltageIncrement is used in the formula for calculation of the phase angle. For a symmetrical PhaseTapChanger, the voltage magnitude does not change with tap step.This is required if the Tap Changer is a RatioTapChanger and there is no step change table.
43 self.stepVoltageIncrement = stepVoltageIncrement
45 #: The neutral tap step position for this winding.
46 self.neutralStep = neutralStep
48 #: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting.
49 self.normalStep = normalStep
51 #: Specifies whether or not a TapChanger has load tap changing capabilities.
52 self.ltcFlag = ltcFlag
54 #: Voltage at which the winding operates at the neutral tap setting.
55 self.neutralU = neutralU
57 #: Lowest possible tap step position, retard from neutral
58 self.lowStep = lowStep
60 #: Specifies the default regulation status of the TapChanger. True is regulating. False is not regulating.
61 self.regulationStatus = regulationStatus
63 #: Highest possible tap step position, advance from neutral
64 self.highStep = highStep
66 self._TapSchedules = []
67 self.TapSchedules = [] if TapSchedules is None else TapSchedules
69 self._ImpedanceVariationCurve = None
70 self.ImpedanceVariationCurve = ImpedanceVariationCurve
72 self._RegulatingControl = None
73 self.RegulatingControl = RegulatingControl
75 super(TapChanger, self).__init__(*args, **kw_args)
77 _attrs = ["stepVoltageIncrement", "neutralStep", "normalStep", "ltcFlag", "neutralU", "lowStep", "regulationStatus", "highStep"]
78 _attr_types = {"stepVoltageIncrement": float, "neutralStep": int, "normalStep": int, "ltcFlag": bool, "neutralU": float, "lowStep": int, "regulationStatus": bool, "highStep": int}
79 _defaults = {"stepVoltageIncrement": 0.0, "neutralStep": 0, "normalStep": 0, "ltcFlag": False, "neutralU": 0.0, "lowStep": 0, "regulationStatus": False, "highStep": 0}
80 _enums = {}
81 _refs = ["TapSchedules", "ImpedanceVariationCurve", "RegulatingControl"]
82 _many_refs = ["TapSchedules"]
84 def getTapSchedules(self):
85 """A TapChanger can have TapSchedules.
86 """
87 return self._TapSchedules
89 def setTapSchedules(self, value):
90 for x in self._TapSchedules:
91 x.TapChanger = None
92 for y in value:
93 y._TapChanger = self
94 self._TapSchedules = value
96 TapSchedules = property(getTapSchedules, setTapSchedules)
98 def addTapSchedules(self, *TapSchedules):
99 for obj in TapSchedules:
100 obj.TapChanger = self
102 def removeTapSchedules(self, *TapSchedules):
103 for obj in TapSchedules:
104 obj.TapChanger = None
106 def getImpedanceVariationCurve(self):
107 """A TapChanger can have an associated ImpedanceVariationCurve to define impedance variations with tap step changes.
109 return self._ImpedanceVariationCurve
111 def setImpedanceVariationCurve(self, value):
112 if self._ImpedanceVariationCurve is not None:
113 self._ImpedanceVariationCurve._TapChanger = None
115 self._ImpedanceVariationCurve = value
116 if self._ImpedanceVariationCurve is not None:
117 self._ImpedanceVariationCurve.TapChanger = None
118 self._ImpedanceVariationCurve._TapChanger = self
120 ImpedanceVariationCurve = property(getImpedanceVariationCurve, setImpedanceVariationCurve)
122 def getRegulatingControl(self):
124 return self._RegulatingControl
126 def setRegulatingControl(self, value):
127 if self._RegulatingControl is not None:
128 filtered = [x for x in self.RegulatingControl.TapChanger if x != self]
129 self._RegulatingControl._TapChanger = filtered
131 self._RegulatingControl = value
132 if self._RegulatingControl is not None:
133 if self not in self._RegulatingControl._TapChanger:
134 self._RegulatingControl._TapChanger.append(self)
136 RegulatingControl = property(getRegulatingControl, setRegulatingControl)