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
21 from CIM14
.CPSM
.Equipment
.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'.
27 def __init__(self
, sequenceNumber
=0, OperationalLimitSet
=None, ConductingEquipment
=None, HasFirst_MutualCoupling
=None, Measurements
=None, ConnectivityNode
=None, RegulatingControl
=None, TieFlow
=None, HasSecond_MutualCoupling
=None, *args
, **kw_args
):
28 """Initialises a new 'Terminal' instance.
30 @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.
31 @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.
32 @param ConductingEquipment: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
33 @param HasFirst_MutualCoupling: Mutual couplings associated with the branch as the first branch.
34 @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.
35 @param ConnectivityNode: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals.
36 @param RegulatingControl: The terminal is regulated by a control.
37 @param TieFlow: The control area tie flows to which this terminal associates.
38 @param HasSecond_MutualCoupling: Mutual couplings with the branch associated as the first branch.
40 #: 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.
41 self
.sequenceNumber
= sequenceNumber
43 self
._OperationalLimitSet
= []
44 self
.OperationalLimitSet
= [] if OperationalLimitSet
is None else OperationalLimitSet
46 self
._ConductingEquipment
= None
47 self
.ConductingEquipment
= ConductingEquipment
49 self
._HasFirst
_MutualCoupling
= []
50 self
.HasFirst_MutualCoupling
= [] if HasFirst_MutualCoupling
is None else HasFirst_MutualCoupling
52 self
._Measurements
= []
53 self
.Measurements
= [] if Measurements
is None else Measurements
55 self
._ConnectivityNode
= None
56 self
.ConnectivityNode
= ConnectivityNode
58 self
._RegulatingControl
= []
59 self
.RegulatingControl
= [] if RegulatingControl
is None else RegulatingControl
62 self
.TieFlow
= [] if TieFlow
is None else TieFlow
64 self
._HasSecond
_MutualCoupling
= []
65 self
.HasSecond_MutualCoupling
= [] if HasSecond_MutualCoupling
is None else HasSecond_MutualCoupling
67 super(Terminal
, self
).__init
__(*args
, **kw_args
)
69 _attrs
= ["sequenceNumber"]
70 _attr_types
= {"sequenceNumber": int}
71 _defaults
= {"sequenceNumber": 0}
73 _refs
= ["OperationalLimitSet", "ConductingEquipment", "HasFirst_MutualCoupling", "Measurements", "ConnectivityNode", "RegulatingControl", "TieFlow", "HasSecond_MutualCoupling"]
74 _many_refs
= ["OperationalLimitSet", "HasFirst_MutualCoupling", "Measurements", "RegulatingControl", "TieFlow", "HasSecond_MutualCoupling"]
76 def getOperationalLimitSet(self
):
77 """The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment.
79 return self
._OperationalLimitSet
81 def setOperationalLimitSet(self
, value
):
82 for x
in self
._OperationalLimitSet
:
86 self
._OperationalLimitSet
= value
88 OperationalLimitSet
= property(getOperationalLimitSet
, setOperationalLimitSet
)
90 def addOperationalLimitSet(self
, *OperationalLimitSet
):
91 for obj
in OperationalLimitSet
:
94 def removeOperationalLimitSet(self
, *OperationalLimitSet
):
95 for obj
in OperationalLimitSet
:
98 def getConductingEquipment(self
):
99 """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
101 return self
._ConductingEquipment
103 def setConductingEquipment(self
, value
):
104 if self
._ConductingEquipment
is not None:
105 filtered
= [x
for x
in self
.ConductingEquipment
.Terminals
if x
!= self
]
106 self
._ConductingEquipment
._Terminals
= filtered
108 self
._ConductingEquipment
= value
109 if self
._ConductingEquipment
is not None:
110 if self
not in self
._ConductingEquipment
._Terminals
:
111 self
._ConductingEquipment
._Terminals
.append(self
)
113 ConductingEquipment
= property(getConductingEquipment
, setConductingEquipment
)
115 def getHasFirst_MutualCoupling(self
):
116 """Mutual couplings associated with the branch as the first branch.
118 return self
._HasFirst
_MutualCoupling
120 def setHasFirst_MutualCoupling(self
, value
):
121 for x
in self
._HasFirst
_MutualCoupling
:
122 x
.First_Terminal
= None
124 y
._First
_Terminal
= self
125 self
._HasFirst
_MutualCoupling
= value
127 HasFirst_MutualCoupling
= property(getHasFirst_MutualCoupling
, setHasFirst_MutualCoupling
)
129 def addHasFirst_MutualCoupling(self
, *HasFirst_MutualCoupling
):
130 for obj
in HasFirst_MutualCoupling
:
131 obj
.First_Terminal
= self
133 def removeHasFirst_MutualCoupling(self
, *HasFirst_MutualCoupling
):
134 for obj
in HasFirst_MutualCoupling
:
135 obj
.First_Terminal
= None
137 def getMeasurements(self
):
138 """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.
140 return self
._Measurements
142 def setMeasurements(self
, value
):
143 for x
in self
._Measurements
:
147 self
._Measurements
= value
149 Measurements
= property(getMeasurements
, setMeasurements
)
151 def addMeasurements(self
, *Measurements
):
152 for obj
in Measurements
:
155 def removeMeasurements(self
, *Measurements
):
156 for obj
in Measurements
:
159 def getConnectivityNode(self
):
160 """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals.
162 return self
._ConnectivityNode
164 def setConnectivityNode(self
, value
):
165 if self
._ConnectivityNode
is not None:
166 filtered
= [x
for x
in self
.ConnectivityNode
.Terminals
if x
!= self
]
167 self
._ConnectivityNode
._Terminals
= filtered
169 self
._ConnectivityNode
= value
170 if self
._ConnectivityNode
is not None:
171 if self
not in self
._ConnectivityNode
._Terminals
:
172 self
._ConnectivityNode
._Terminals
.append(self
)
174 ConnectivityNode
= property(getConnectivityNode
, setConnectivityNode
)
176 def getRegulatingControl(self
):
177 """The terminal is regulated by a control.
179 return self
._RegulatingControl
181 def setRegulatingControl(self
, value
):
182 for x
in self
._RegulatingControl
:
186 self
._RegulatingControl
= value
188 RegulatingControl
= property(getRegulatingControl
, setRegulatingControl
)
190 def addRegulatingControl(self
, *RegulatingControl
):
191 for obj
in RegulatingControl
:
194 def removeRegulatingControl(self
, *RegulatingControl
):
195 for obj
in RegulatingControl
:
198 def getTieFlow(self
):
199 """The control area tie flows to which this terminal associates.
203 def setTieFlow(self
, value
):
204 for x
in self
._TieFlow
:
208 self
._TieFlow
= value
210 TieFlow
= property(getTieFlow
, setTieFlow
)
212 def addTieFlow(self
, *TieFlow
):
216 def removeTieFlow(self
, *TieFlow
):
220 def getHasSecond_MutualCoupling(self
):
221 """Mutual couplings with the branch associated as the first branch.
223 return self
._HasSecond
_MutualCoupling
225 def setHasSecond_MutualCoupling(self
, value
):
226 for x
in self
._HasSecond
_MutualCoupling
:
227 x
.Second_Terminal
= None
229 y
._Second
_Terminal
= self
230 self
._HasSecond
_MutualCoupling
= value
232 HasSecond_MutualCoupling
= property(getHasSecond_MutualCoupling
, setHasSecond_MutualCoupling
)
234 def addHasSecond_MutualCoupling(self
, *HasSecond_MutualCoupling
):
235 for obj
in HasSecond_MutualCoupling
:
236 obj
.Second_Terminal
= self
238 def removeHasSecond_MutualCoupling(self
, *HasSecond_MutualCoupling
):
239 for obj
in HasSecond_MutualCoupling
:
240 obj
.Second_Terminal
= None