Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Core / Terminal.py
blobb4eb2bb995a9cba2996bcd06625b2511eb5ad3bd
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.IdentifiedObject import IdentifiedObject
23 class Terminal(IdentifiedObject):
24 """An electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called 'connectivity nodes'.
25 """
27 def __init__(self, connected=False, sequenceNumber=0, TopologicalNode=None, Block=None, OperationalLimitSet=None, HasSecond_MutualCoupling=None, RegulatingControl=None, Measurements=None, BranchGroupTerminal=None, ConductingEquipment=None, HasFirst_MutualCoupling=None, SvPowerFlow=None, ConnectivityNode=None, TieFlow=None, *args, **kw_args):
28 """Initialises a new 'Terminal' instance.
30 @param connected: The connected status is related to a bus-branch model and the TopologicalNode-Terminal relation. True implies the Terminal is connected to the related TopologicalNode and false implies it is not. In a bus-branch model the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the TopologicalNode-Terminal relation. A valid case is that ConductingEquipment can be connected in one end and open in the other. In particular for an ACLineSegment where the charging can be significant this is a relevant case.
31 @param sequenceNumber: The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the 'starting point' for a two terminal branch. In the case of class TransformerWinding only one terminal is used so its sequenceNumber must be 1.
32 @param TopologicalNode: The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connedtivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would proably not be used.
33 @param Block: The dynamics block associated with the terminal.
34 @param OperationalLimitSet: The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment.
35 @param HasSecond_MutualCoupling: Mutual couplings with the branch associated as the first branch.
36 @param RegulatingControl: The terminal is regulated by a control.
37 @param Measurements: One or more measurements may be associated with a terminal in the network. Measurement-Terminal defines where the measurement is placed in the network topology. Some Measurements represent quantities related to a particular sensor position, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is captured by the Measurement - Terminal association that makes it possible to place the sensing position at a well defined place. The place is defined by the connection of the Terminal to ConductingEquipment.
38 @param BranchGroupTerminal: The directed branch group terminals for which the terminal is monitored.
39 @param ConductingEquipment: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
40 @param HasFirst_MutualCoupling: Mutual couplings associated with the branch as the first branch.
41 @param SvPowerFlow: The power flow state associated with the terminal.
42 @param ConnectivityNode: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals.
43 @param TieFlow: The control area tie flows to which this terminal associates.
44 """
45 #: The connected status is related to a bus-branch model and the TopologicalNode-Terminal relation. True implies the Terminal is connected to the related TopologicalNode and false implies it is not. In a bus-branch model the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the TopologicalNode-Terminal relation. A valid case is that ConductingEquipment can be connected in one end and open in the other. In particular for an ACLineSegment where the charging can be significant this is a relevant case.
46 self.connected = connected
48 #: The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the 'starting point' for a two terminal branch. In the case of class TransformerWinding only one terminal is used so its sequenceNumber must be 1.
49 self.sequenceNumber = sequenceNumber
51 self._TopologicalNode = None
52 self.TopologicalNode = TopologicalNode
54 self._Block = []
55 self.Block = [] if Block is None else Block
57 self._OperationalLimitSet = []
58 self.OperationalLimitSet = [] if OperationalLimitSet is None else OperationalLimitSet
60 self._HasSecond_MutualCoupling = []
61 self.HasSecond_MutualCoupling = [] if HasSecond_MutualCoupling is None else HasSecond_MutualCoupling
63 self._RegulatingControl = []
64 self.RegulatingControl = [] if RegulatingControl is None else RegulatingControl
66 self._Measurements = []
67 self.Measurements = [] if Measurements is None else Measurements
69 self._BranchGroupTerminal = []
70 self.BranchGroupTerminal = [] if BranchGroupTerminal is None else BranchGroupTerminal
72 self._ConductingEquipment = None
73 self.ConductingEquipment = ConductingEquipment
75 self._HasFirst_MutualCoupling = []
76 self.HasFirst_MutualCoupling = [] if HasFirst_MutualCoupling is None else HasFirst_MutualCoupling
78 self._SvPowerFlow = None
79 self.SvPowerFlow = SvPowerFlow
81 self._ConnectivityNode = None
82 self.ConnectivityNode = ConnectivityNode
84 self._TieFlow = []
85 self.TieFlow = [] if TieFlow is None else TieFlow
87 super(Terminal, self).__init__(*args, **kw_args)
89 _attrs = ["connected", "sequenceNumber"]
90 _attr_types = {"connected": bool, "sequenceNumber": int}
91 _defaults = {"connected": False, "sequenceNumber": 0}
92 _enums = {}
93 _refs = ["TopologicalNode", "Block", "OperationalLimitSet", "HasSecond_MutualCoupling", "RegulatingControl", "Measurements", "BranchGroupTerminal", "ConductingEquipment", "HasFirst_MutualCoupling", "SvPowerFlow", "ConnectivityNode", "TieFlow"]
94 _many_refs = ["Block", "OperationalLimitSet", "HasSecond_MutualCoupling", "RegulatingControl", "Measurements", "BranchGroupTerminal", "HasFirst_MutualCoupling", "TieFlow"]
96 def getTopologicalNode(self):
97 """The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connedtivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would proably not be used.
98 """
99 return self._TopologicalNode
101 def setTopologicalNode(self, value):
102 if self._TopologicalNode is not None:
103 filtered = [x for x in self.TopologicalNode.Terminal if x != self]
104 self._TopologicalNode._Terminal = filtered
106 self._TopologicalNode = value
107 if self._TopologicalNode is not None:
108 if self not in self._TopologicalNode._Terminal:
109 self._TopologicalNode._Terminal.append(self)
111 TopologicalNode = property(getTopologicalNode, setTopologicalNode)
113 def getBlock(self):
114 """The dynamics block associated with the terminal.
116 return self._Block
118 def setBlock(self, value):
119 for x in self._Block:
120 x.Terminal = None
121 for y in value:
122 y._Terminal = self
123 self._Block = value
125 Block = property(getBlock, setBlock)
127 def addBlock(self, *Block):
128 for obj in Block:
129 obj.Terminal = self
131 def removeBlock(self, *Block):
132 for obj in Block:
133 obj.Terminal = None
135 def getOperationalLimitSet(self):
136 """The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment.
138 return self._OperationalLimitSet
140 def setOperationalLimitSet(self, value):
141 for x in self._OperationalLimitSet:
142 x.Terminal = None
143 for y in value:
144 y._Terminal = self
145 self._OperationalLimitSet = value
147 OperationalLimitSet = property(getOperationalLimitSet, setOperationalLimitSet)
149 def addOperationalLimitSet(self, *OperationalLimitSet):
150 for obj in OperationalLimitSet:
151 obj.Terminal = self
153 def removeOperationalLimitSet(self, *OperationalLimitSet):
154 for obj in OperationalLimitSet:
155 obj.Terminal = None
157 def getHasSecond_MutualCoupling(self):
158 """Mutual couplings with the branch associated as the first branch.
160 return self._HasSecond_MutualCoupling
162 def setHasSecond_MutualCoupling(self, value):
163 for x in self._HasSecond_MutualCoupling:
164 x.Second_Terminal = None
165 for y in value:
166 y._Second_Terminal = self
167 self._HasSecond_MutualCoupling = value
169 HasSecond_MutualCoupling = property(getHasSecond_MutualCoupling, setHasSecond_MutualCoupling)
171 def addHasSecond_MutualCoupling(self, *HasSecond_MutualCoupling):
172 for obj in HasSecond_MutualCoupling:
173 obj.Second_Terminal = self
175 def removeHasSecond_MutualCoupling(self, *HasSecond_MutualCoupling):
176 for obj in HasSecond_MutualCoupling:
177 obj.Second_Terminal = None
179 def getRegulatingControl(self):
180 """The terminal is regulated by a control.
182 return self._RegulatingControl
184 def setRegulatingControl(self, value):
185 for x in self._RegulatingControl:
186 x.Terminal = None
187 for y in value:
188 y._Terminal = self
189 self._RegulatingControl = value
191 RegulatingControl = property(getRegulatingControl, setRegulatingControl)
193 def addRegulatingControl(self, *RegulatingControl):
194 for obj in RegulatingControl:
195 obj.Terminal = self
197 def removeRegulatingControl(self, *RegulatingControl):
198 for obj in RegulatingControl:
199 obj.Terminal = None
201 def getMeasurements(self):
202 """One or more measurements may be associated with a terminal in the network. Measurement-Terminal defines where the measurement is placed in the network topology. Some Measurements represent quantities related to a particular sensor position, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is captured by the Measurement - Terminal association that makes it possible to place the sensing position at a well defined place. The place is defined by the connection of the Terminal to ConductingEquipment.
204 return self._Measurements
206 def setMeasurements(self, value):
207 for x in self._Measurements:
208 x.Terminal = None
209 for y in value:
210 y._Terminal = self
211 self._Measurements = value
213 Measurements = property(getMeasurements, setMeasurements)
215 def addMeasurements(self, *Measurements):
216 for obj in Measurements:
217 obj.Terminal = self
219 def removeMeasurements(self, *Measurements):
220 for obj in Measurements:
221 obj.Terminal = None
223 def getBranchGroupTerminal(self):
224 """The directed branch group terminals for which the terminal is monitored.
226 return self._BranchGroupTerminal
228 def setBranchGroupTerminal(self, value):
229 for x in self._BranchGroupTerminal:
230 x.Terminal = None
231 for y in value:
232 y._Terminal = self
233 self._BranchGroupTerminal = value
235 BranchGroupTerminal = property(getBranchGroupTerminal, setBranchGroupTerminal)
237 def addBranchGroupTerminal(self, *BranchGroupTerminal):
238 for obj in BranchGroupTerminal:
239 obj.Terminal = self
241 def removeBranchGroupTerminal(self, *BranchGroupTerminal):
242 for obj in BranchGroupTerminal:
243 obj.Terminal = None
245 def getConductingEquipment(self):
246 """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
248 return self._ConductingEquipment
250 def setConductingEquipment(self, value):
251 if self._ConductingEquipment is not None:
252 filtered = [x for x in self.ConductingEquipment.Terminals if x != self]
253 self._ConductingEquipment._Terminals = filtered
255 self._ConductingEquipment = value
256 if self._ConductingEquipment is not None:
257 if self not in self._ConductingEquipment._Terminals:
258 self._ConductingEquipment._Terminals.append(self)
260 ConductingEquipment = property(getConductingEquipment, setConductingEquipment)
262 def getHasFirst_MutualCoupling(self):
263 """Mutual couplings associated with the branch as the first branch.
265 return self._HasFirst_MutualCoupling
267 def setHasFirst_MutualCoupling(self, value):
268 for x in self._HasFirst_MutualCoupling:
269 x.First_Terminal = None
270 for y in value:
271 y._First_Terminal = self
272 self._HasFirst_MutualCoupling = value
274 HasFirst_MutualCoupling = property(getHasFirst_MutualCoupling, setHasFirst_MutualCoupling)
276 def addHasFirst_MutualCoupling(self, *HasFirst_MutualCoupling):
277 for obj in HasFirst_MutualCoupling:
278 obj.First_Terminal = self
280 def removeHasFirst_MutualCoupling(self, *HasFirst_MutualCoupling):
281 for obj in HasFirst_MutualCoupling:
282 obj.First_Terminal = None
284 def getSvPowerFlow(self):
285 """The power flow state associated with the terminal.
287 return self._SvPowerFlow
289 def setSvPowerFlow(self, value):
290 if self._SvPowerFlow is not None:
291 self._SvPowerFlow._Terminal = None
293 self._SvPowerFlow = value
294 if self._SvPowerFlow is not None:
295 self._SvPowerFlow.Terminal = None
296 self._SvPowerFlow._Terminal = self
298 SvPowerFlow = property(getSvPowerFlow, setSvPowerFlow)
300 def getConnectivityNode(self):
301 """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals.
303 return self._ConnectivityNode
305 def setConnectivityNode(self, value):
306 if self._ConnectivityNode is not None:
307 filtered = [x for x in self.ConnectivityNode.Terminals if x != self]
308 self._ConnectivityNode._Terminals = filtered
310 self._ConnectivityNode = value
311 if self._ConnectivityNode is not None:
312 if self not in self._ConnectivityNode._Terminals:
313 self._ConnectivityNode._Terminals.append(self)
315 ConnectivityNode = property(getConnectivityNode, setConnectivityNode)
317 def getTieFlow(self):
318 """The control area tie flows to which this terminal associates.
320 return self._TieFlow
322 def setTieFlow(self, value):
323 for x in self._TieFlow:
324 x.Terminal = None
325 for y in value:
326 y._Terminal = self
327 self._TieFlow = value
329 TieFlow = property(getTieFlow, setTieFlow)
331 def addTieFlow(self, *TieFlow):
332 for obj in TieFlow:
333 obj.Terminal = self
335 def removeTieFlow(self, *TieFlow):
336 for obj in TieFlow:
337 obj.Terminal = None