Adding CDPSM package.
[PyCIM.git] / CIM14 / IEC61970 / Wires / TapChanger.py
blob89843f4d564624c395b79df8904168cafe2bdbf7
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 TapChanger(PowerSystemResource):
20 """Mechanism for changing transformer winding tap positions.
21 """
23 def __init__(self, stepVoltageIncrement=0.0, normalStep=0, neutralStep=0, subsequentDelay=0.0, regulationStatus=False, ltcFlag=False, highStep=0, initialDelay=0.0, lowStep=0, neutralU=0.0, SvTapStep=None, ImpedanceVariationCurve=None, TapSchedules=None, RegulatingControl=None, *args, **kw_args):
24 """Initialises a new 'TapChanger' instance.
26 @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.
27 @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.
28 @param neutralStep: The neutral tap step position for this winding.
29 @param subsequentDelay: For an LTC, the delay for subsequent tap changer operation (second and later step changes)
30 @param regulationStatus: Specifies the default regulation status of the TapChanger. True is regulating. False is not regulating.
31 @param ltcFlag: Specifies whether or not a TapChanger has load tap changing capabilities.
32 @param highStep: Highest possible tap step position, advance from neutral
33 @param initialDelay: For an LTC, the delay for initial tap changer operation (first step change)
34 @param lowStep: Lowest possible tap step position, retard from neutral
35 @param neutralU: Voltage at which the winding operates at the neutral tap setting.
36 @param SvTapStep: The tap step state associated with the tap changer.
37 @param ImpedanceVariationCurve: A TapChanger can have an associated ImpedanceVariationCurve to define impedance variations with tap step changes.
38 @param TapSchedules: A TapChanger can have TapSchedules.
39 @param RegulatingControl:
40 """
41 #: 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.
42 self.stepVoltageIncrement = stepVoltageIncrement
44 #: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting.
45 self.normalStep = normalStep
47 #: The neutral tap step position for this winding.
48 self.neutralStep = neutralStep
50 #: For an LTC, the delay for subsequent tap changer operation (second and later step changes)
51 self.subsequentDelay = subsequentDelay
53 #: Specifies the default regulation status of the TapChanger. True is regulating. False is not regulating.
54 self.regulationStatus = regulationStatus
56 #: Specifies whether or not a TapChanger has load tap changing capabilities.
57 self.ltcFlag = ltcFlag
59 #: Highest possible tap step position, advance from neutral
60 self.highStep = highStep
62 #: For an LTC, the delay for initial tap changer operation (first step change)
63 self.initialDelay = initialDelay
65 #: Lowest possible tap step position, retard from neutral
66 self.lowStep = lowStep
68 #: Voltage at which the winding operates at the neutral tap setting.
69 self.neutralU = neutralU
71 self._SvTapStep = None
72 self.SvTapStep = SvTapStep
74 self._ImpedanceVariationCurve = None
75 self.ImpedanceVariationCurve = ImpedanceVariationCurve
77 self._TapSchedules = []
78 self.TapSchedules = [] if TapSchedules is None else TapSchedules
80 self._RegulatingControl = None
81 self.RegulatingControl = RegulatingControl
83 super(TapChanger, self).__init__(*args, **kw_args)
85 _attrs = ["stepVoltageIncrement", "normalStep", "neutralStep", "subsequentDelay", "regulationStatus", "ltcFlag", "highStep", "initialDelay", "lowStep", "neutralU"]
86 _attr_types = {"stepVoltageIncrement": float, "normalStep": int, "neutralStep": int, "subsequentDelay": float, "regulationStatus": bool, "ltcFlag": bool, "highStep": int, "initialDelay": float, "lowStep": int, "neutralU": float}
87 _defaults = {"stepVoltageIncrement": 0.0, "normalStep": 0, "neutralStep": 0, "subsequentDelay": 0.0, "regulationStatus": False, "ltcFlag": False, "highStep": 0, "initialDelay": 0.0, "lowStep": 0, "neutralU": 0.0}
88 _enums = {}
89 _refs = ["SvTapStep", "ImpedanceVariationCurve", "TapSchedules", "RegulatingControl"]
90 _many_refs = ["TapSchedules"]
92 def getSvTapStep(self):
93 """The tap step state associated with the tap changer.
94 """
95 return self._SvTapStep
97 def setSvTapStep(self, value):
98 if self._SvTapStep is not None:
99 self._SvTapStep._TapChanger = None
101 self._SvTapStep = value
102 if self._SvTapStep is not None:
103 self._SvTapStep.TapChanger = None
104 self._SvTapStep._TapChanger = self
106 SvTapStep = property(getSvTapStep, setSvTapStep)
108 def getImpedanceVariationCurve(self):
109 """A TapChanger can have an associated ImpedanceVariationCurve to define impedance variations with tap step changes.
111 return self._ImpedanceVariationCurve
113 def setImpedanceVariationCurve(self, value):
114 if self._ImpedanceVariationCurve is not None:
115 self._ImpedanceVariationCurve._TapChanger = None
117 self._ImpedanceVariationCurve = value
118 if self._ImpedanceVariationCurve is not None:
119 self._ImpedanceVariationCurve.TapChanger = None
120 self._ImpedanceVariationCurve._TapChanger = self
122 ImpedanceVariationCurve = property(getImpedanceVariationCurve, setImpedanceVariationCurve)
124 def getTapSchedules(self):
125 """A TapChanger can have TapSchedules.
127 return self._TapSchedules
129 def setTapSchedules(self, value):
130 for x in self._TapSchedules:
131 x.TapChanger = None
132 for y in value:
133 y._TapChanger = self
134 self._TapSchedules = value
136 TapSchedules = property(getTapSchedules, setTapSchedules)
138 def addTapSchedules(self, *TapSchedules):
139 for obj in TapSchedules:
140 obj.TapChanger = self
142 def removeTapSchedules(self, *TapSchedules):
143 for obj in TapSchedules:
144 obj.TapChanger = None
146 def getRegulatingControl(self):
148 return self._RegulatingControl
150 def setRegulatingControl(self, value):
151 if self._RegulatingControl is not None:
152 filtered = [x for x in self.RegulatingControl.TapChanger if x != self]
153 self._RegulatingControl._TapChanger = filtered
155 self._RegulatingControl = value
156 if self._RegulatingControl is not None:
157 if self not in self._RegulatingControl._TapChanger:
158 self._RegulatingControl._TapChanger.append(self)
160 RegulatingControl = property(getRegulatingControl, setRegulatingControl)