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
.IdentifiedObject
import IdentifiedObject
19 class Terminal(IdentifiedObject
):
20 """An electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called 'connectivity nodes'.
23 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
):
24 """Initialises a new 'Terminal' instance.
26 @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.
27 @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.
28 @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.
29 @param Block: The dynamics block associated with the terminal.
30 @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.
31 @param HasSecond_MutualCoupling: Mutual couplings with the branch associated as the first branch.
32 @param RegulatingControl: The terminal is regulated by a control.
33 @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.
34 @param BranchGroupTerminal: The directed branch group terminals for which the terminal is monitored.
35 @param ConductingEquipment: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
36 @param HasFirst_MutualCoupling: Mutual couplings associated with the branch as the first branch.
37 @param SvPowerFlow: The power flow state associated with the terminal.
38 @param ConnectivityNode: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals.
39 @param TieFlow: The control area tie flows to which this terminal associates.
41 #: 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.
42 self
.connected
= connected
44 #: 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.
45 self
.sequenceNumber
= sequenceNumber
47 self
._TopologicalNode
= None
48 self
.TopologicalNode
= TopologicalNode
51 self
.Block
= [] if Block
is None else Block
53 self
._OperationalLimitSet
= []
54 self
.OperationalLimitSet
= [] if OperationalLimitSet
is None else OperationalLimitSet
56 self
._HasSecond
_MutualCoupling
= []
57 self
.HasSecond_MutualCoupling
= [] if HasSecond_MutualCoupling
is None else HasSecond_MutualCoupling
59 self
._RegulatingControl
= []
60 self
.RegulatingControl
= [] if RegulatingControl
is None else RegulatingControl
62 self
._Measurements
= []
63 self
.Measurements
= [] if Measurements
is None else Measurements
65 self
._BranchGroupTerminal
= []
66 self
.BranchGroupTerminal
= [] if BranchGroupTerminal
is None else BranchGroupTerminal
68 self
._ConductingEquipment
= None
69 self
.ConductingEquipment
= ConductingEquipment
71 self
._HasFirst
_MutualCoupling
= []
72 self
.HasFirst_MutualCoupling
= [] if HasFirst_MutualCoupling
is None else HasFirst_MutualCoupling
74 self
._SvPowerFlow
= None
75 self
.SvPowerFlow
= SvPowerFlow
77 self
._ConnectivityNode
= None
78 self
.ConnectivityNode
= ConnectivityNode
81 self
.TieFlow
= [] if TieFlow
is None else TieFlow
83 super(Terminal
, self
).__init
__(*args
, **kw_args
)
85 _attrs
= ["connected", "sequenceNumber"]
86 _attr_types
= {"connected": bool, "sequenceNumber": int}
87 _defaults
= {"connected": False, "sequenceNumber": 0}
89 _refs
= ["TopologicalNode", "Block", "OperationalLimitSet", "HasSecond_MutualCoupling", "RegulatingControl", "Measurements", "BranchGroupTerminal", "ConductingEquipment", "HasFirst_MutualCoupling", "SvPowerFlow", "ConnectivityNode", "TieFlow"]
90 _many_refs
= ["Block", "OperationalLimitSet", "HasSecond_MutualCoupling", "RegulatingControl", "Measurements", "BranchGroupTerminal", "HasFirst_MutualCoupling", "TieFlow"]
92 def getTopologicalNode(self
):
93 """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.
95 return self
._TopologicalNode
97 def setTopologicalNode(self
, value
):
98 if self
._TopologicalNode
is not None:
99 filtered
= [x
for x
in self
.TopologicalNode
.Terminal
if x
!= self
]
100 self
._TopologicalNode
._Terminal
= filtered
102 self
._TopologicalNode
= value
103 if self
._TopologicalNode
is not None:
104 if self
not in self
._TopologicalNode
._Terminal
:
105 self
._TopologicalNode
._Terminal
.append(self
)
107 TopologicalNode
= property(getTopologicalNode
, setTopologicalNode
)
110 """The dynamics block associated with the terminal.
114 def setBlock(self
, value
):
115 for x
in self
._Block
:
121 Block
= property(getBlock
, setBlock
)
123 def addBlock(self
, *Block
):
127 def removeBlock(self
, *Block
):
131 def getOperationalLimitSet(self
):
132 """The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment.
134 return self
._OperationalLimitSet
136 def setOperationalLimitSet(self
, value
):
137 for x
in self
._OperationalLimitSet
:
141 self
._OperationalLimitSet
= value
143 OperationalLimitSet
= property(getOperationalLimitSet
, setOperationalLimitSet
)
145 def addOperationalLimitSet(self
, *OperationalLimitSet
):
146 for obj
in OperationalLimitSet
:
149 def removeOperationalLimitSet(self
, *OperationalLimitSet
):
150 for obj
in OperationalLimitSet
:
153 def getHasSecond_MutualCoupling(self
):
154 """Mutual couplings with the branch associated as the first branch.
156 return self
._HasSecond
_MutualCoupling
158 def setHasSecond_MutualCoupling(self
, value
):
159 for x
in self
._HasSecond
_MutualCoupling
:
160 x
.Second_Terminal
= None
162 y
._Second
_Terminal
= self
163 self
._HasSecond
_MutualCoupling
= value
165 HasSecond_MutualCoupling
= property(getHasSecond_MutualCoupling
, setHasSecond_MutualCoupling
)
167 def addHasSecond_MutualCoupling(self
, *HasSecond_MutualCoupling
):
168 for obj
in HasSecond_MutualCoupling
:
169 obj
.Second_Terminal
= self
171 def removeHasSecond_MutualCoupling(self
, *HasSecond_MutualCoupling
):
172 for obj
in HasSecond_MutualCoupling
:
173 obj
.Second_Terminal
= None
175 def getRegulatingControl(self
):
176 """The terminal is regulated by a control.
178 return self
._RegulatingControl
180 def setRegulatingControl(self
, value
):
181 for x
in self
._RegulatingControl
:
185 self
._RegulatingControl
= value
187 RegulatingControl
= property(getRegulatingControl
, setRegulatingControl
)
189 def addRegulatingControl(self
, *RegulatingControl
):
190 for obj
in RegulatingControl
:
193 def removeRegulatingControl(self
, *RegulatingControl
):
194 for obj
in RegulatingControl
:
197 def getMeasurements(self
):
198 """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.
200 return self
._Measurements
202 def setMeasurements(self
, value
):
203 for x
in self
._Measurements
:
207 self
._Measurements
= value
209 Measurements
= property(getMeasurements
, setMeasurements
)
211 def addMeasurements(self
, *Measurements
):
212 for obj
in Measurements
:
215 def removeMeasurements(self
, *Measurements
):
216 for obj
in Measurements
:
219 def getBranchGroupTerminal(self
):
220 """The directed branch group terminals for which the terminal is monitored.
222 return self
._BranchGroupTerminal
224 def setBranchGroupTerminal(self
, value
):
225 for x
in self
._BranchGroupTerminal
:
229 self
._BranchGroupTerminal
= value
231 BranchGroupTerminal
= property(getBranchGroupTerminal
, setBranchGroupTerminal
)
233 def addBranchGroupTerminal(self
, *BranchGroupTerminal
):
234 for obj
in BranchGroupTerminal
:
237 def removeBranchGroupTerminal(self
, *BranchGroupTerminal
):
238 for obj
in BranchGroupTerminal
:
241 def getConductingEquipment(self
):
242 """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
244 return self
._ConductingEquipment
246 def setConductingEquipment(self
, value
):
247 if self
._ConductingEquipment
is not None:
248 filtered
= [x
for x
in self
.ConductingEquipment
.Terminals
if x
!= self
]
249 self
._ConductingEquipment
._Terminals
= filtered
251 self
._ConductingEquipment
= value
252 if self
._ConductingEquipment
is not None:
253 if self
not in self
._ConductingEquipment
._Terminals
:
254 self
._ConductingEquipment
._Terminals
.append(self
)
256 ConductingEquipment
= property(getConductingEquipment
, setConductingEquipment
)
258 def getHasFirst_MutualCoupling(self
):
259 """Mutual couplings associated with the branch as the first branch.
261 return self
._HasFirst
_MutualCoupling
263 def setHasFirst_MutualCoupling(self
, value
):
264 for x
in self
._HasFirst
_MutualCoupling
:
265 x
.First_Terminal
= None
267 y
._First
_Terminal
= self
268 self
._HasFirst
_MutualCoupling
= value
270 HasFirst_MutualCoupling
= property(getHasFirst_MutualCoupling
, setHasFirst_MutualCoupling
)
272 def addHasFirst_MutualCoupling(self
, *HasFirst_MutualCoupling
):
273 for obj
in HasFirst_MutualCoupling
:
274 obj
.First_Terminal
= self
276 def removeHasFirst_MutualCoupling(self
, *HasFirst_MutualCoupling
):
277 for obj
in HasFirst_MutualCoupling
:
278 obj
.First_Terminal
= None
280 def getSvPowerFlow(self
):
281 """The power flow state associated with the terminal.
283 return self
._SvPowerFlow
285 def setSvPowerFlow(self
, value
):
286 if self
._SvPowerFlow
is not None:
287 self
._SvPowerFlow
._Terminal
= None
289 self
._SvPowerFlow
= value
290 if self
._SvPowerFlow
is not None:
291 self
._SvPowerFlow
.Terminal
= None
292 self
._SvPowerFlow
._Terminal
= self
294 SvPowerFlow
= property(getSvPowerFlow
, setSvPowerFlow
)
296 def getConnectivityNode(self
):
297 """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals.
299 return self
._ConnectivityNode
301 def setConnectivityNode(self
, value
):
302 if self
._ConnectivityNode
is not None:
303 filtered
= [x
for x
in self
.ConnectivityNode
.Terminals
if x
!= self
]
304 self
._ConnectivityNode
._Terminals
= filtered
306 self
._ConnectivityNode
= value
307 if self
._ConnectivityNode
is not None:
308 if self
not in self
._ConnectivityNode
._Terminals
:
309 self
._ConnectivityNode
._Terminals
.append(self
)
311 ConnectivityNode
= property(getConnectivityNode
, setConnectivityNode
)
313 def getTieFlow(self
):
314 """The control area tie flows to which this terminal associates.
318 def setTieFlow(self
, value
):
319 for x
in self
._TieFlow
:
323 self
._TieFlow
= value
325 TieFlow
= property(getTieFlow
, setTieFlow
)
327 def addTieFlow(self
, *TieFlow
):
331 def removeTieFlow(self
, *TieFlow
):