Implementing RDF/XML serialisation using meta-data attributes.
[PyCIM.git] / schemata / CIM14 / IEC61970 / Core / Terminal.py
blobd6edfdc293acbe71e2a22720347a465b859139a3
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'.
21 """
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.
40 """
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
50 self._Block = []
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
80 self._TieFlow = []
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}
88 _enums = {}
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.
94 """
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 self._TopologicalNode._Terminal.append(self)
106 TopologicalNode = property(getTopologicalNode, setTopologicalNode)
108 def getBlock(self):
109 """The dynamics block associated with the terminal.
111 return self._Block
113 def setBlock(self, value):
114 for x in self._Block:
115 x._Terminal = None
116 for y in value:
117 y._Terminal = self
118 self._Block = value
120 Block = property(getBlock, setBlock)
122 def addBlock(self, *Block):
123 for obj in Block:
124 obj._Terminal = self
125 self._Block.append(obj)
127 def removeBlock(self, *Block):
128 for obj in Block:
129 obj._Terminal = None
130 self._Block.remove(obj)
132 def getOperationalLimitSet(self):
133 """The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment.
135 return self._OperationalLimitSet
137 def setOperationalLimitSet(self, value):
138 for x in self._OperationalLimitSet:
139 x._Terminal = None
140 for y in value:
141 y._Terminal = self
142 self._OperationalLimitSet = value
144 OperationalLimitSet = property(getOperationalLimitSet, setOperationalLimitSet)
146 def addOperationalLimitSet(self, *OperationalLimitSet):
147 for obj in OperationalLimitSet:
148 obj._Terminal = self
149 self._OperationalLimitSet.append(obj)
151 def removeOperationalLimitSet(self, *OperationalLimitSet):
152 for obj in OperationalLimitSet:
153 obj._Terminal = None
154 self._OperationalLimitSet.remove(obj)
156 def getHasSecond_MutualCoupling(self):
157 """Mutual couplings with the branch associated as the first branch.
159 return self._HasSecond_MutualCoupling
161 def setHasSecond_MutualCoupling(self, value):
162 for x in self._HasSecond_MutualCoupling:
163 x._Second_Terminal = None
164 for y in value:
165 y._Second_Terminal = self
166 self._HasSecond_MutualCoupling = value
168 HasSecond_MutualCoupling = property(getHasSecond_MutualCoupling, setHasSecond_MutualCoupling)
170 def addHasSecond_MutualCoupling(self, *HasSecond_MutualCoupling):
171 for obj in HasSecond_MutualCoupling:
172 obj._Second_Terminal = self
173 self._HasSecond_MutualCoupling.append(obj)
175 def removeHasSecond_MutualCoupling(self, *HasSecond_MutualCoupling):
176 for obj in HasSecond_MutualCoupling:
177 obj._Second_Terminal = None
178 self._HasSecond_MutualCoupling.remove(obj)
180 def getRegulatingControl(self):
181 """The terminal is regulated by a control.
183 return self._RegulatingControl
185 def setRegulatingControl(self, value):
186 for x in self._RegulatingControl:
187 x._Terminal = None
188 for y in value:
189 y._Terminal = self
190 self._RegulatingControl = value
192 RegulatingControl = property(getRegulatingControl, setRegulatingControl)
194 def addRegulatingControl(self, *RegulatingControl):
195 for obj in RegulatingControl:
196 obj._Terminal = self
197 self._RegulatingControl.append(obj)
199 def removeRegulatingControl(self, *RegulatingControl):
200 for obj in RegulatingControl:
201 obj._Terminal = None
202 self._RegulatingControl.remove(obj)
204 def getMeasurements(self):
205 """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.
207 return self._Measurements
209 def setMeasurements(self, value):
210 for x in self._Measurements:
211 x._Terminal = None
212 for y in value:
213 y._Terminal = self
214 self._Measurements = value
216 Measurements = property(getMeasurements, setMeasurements)
218 def addMeasurements(self, *Measurements):
219 for obj in Measurements:
220 obj._Terminal = self
221 self._Measurements.append(obj)
223 def removeMeasurements(self, *Measurements):
224 for obj in Measurements:
225 obj._Terminal = None
226 self._Measurements.remove(obj)
228 def getBranchGroupTerminal(self):
229 """The directed branch group terminals for which the terminal is monitored.
231 return self._BranchGroupTerminal
233 def setBranchGroupTerminal(self, value):
234 for x in self._BranchGroupTerminal:
235 x._Terminal = None
236 for y in value:
237 y._Terminal = self
238 self._BranchGroupTerminal = value
240 BranchGroupTerminal = property(getBranchGroupTerminal, setBranchGroupTerminal)
242 def addBranchGroupTerminal(self, *BranchGroupTerminal):
243 for obj in BranchGroupTerminal:
244 obj._Terminal = self
245 self._BranchGroupTerminal.append(obj)
247 def removeBranchGroupTerminal(self, *BranchGroupTerminal):
248 for obj in BranchGroupTerminal:
249 obj._Terminal = None
250 self._BranchGroupTerminal.remove(obj)
252 def getConductingEquipment(self):
253 """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes
255 return self._ConductingEquipment
257 def setConductingEquipment(self, value):
258 if self._ConductingEquipment is not None:
259 filtered = [x for x in self.ConductingEquipment.Terminals if x != self]
260 self._ConductingEquipment._Terminals = filtered
262 self._ConductingEquipment = value
263 if self._ConductingEquipment is not None:
264 self._ConductingEquipment._Terminals.append(self)
266 ConductingEquipment = property(getConductingEquipment, setConductingEquipment)
268 def getHasFirst_MutualCoupling(self):
269 """Mutual couplings associated with the branch as the first branch.
271 return self._HasFirst_MutualCoupling
273 def setHasFirst_MutualCoupling(self, value):
274 for x in self._HasFirst_MutualCoupling:
275 x._First_Terminal = None
276 for y in value:
277 y._First_Terminal = self
278 self._HasFirst_MutualCoupling = value
280 HasFirst_MutualCoupling = property(getHasFirst_MutualCoupling, setHasFirst_MutualCoupling)
282 def addHasFirst_MutualCoupling(self, *HasFirst_MutualCoupling):
283 for obj in HasFirst_MutualCoupling:
284 obj._First_Terminal = self
285 self._HasFirst_MutualCoupling.append(obj)
287 def removeHasFirst_MutualCoupling(self, *HasFirst_MutualCoupling):
288 for obj in HasFirst_MutualCoupling:
289 obj._First_Terminal = None
290 self._HasFirst_MutualCoupling.remove(obj)
292 def getSvPowerFlow(self):
293 """The power flow state associated with the terminal.
295 return self._SvPowerFlow
297 def setSvPowerFlow(self, value):
298 if self._SvPowerFlow is not None:
299 self._SvPowerFlow._Terminal = None
301 self._SvPowerFlow = value
302 if self._SvPowerFlow is not None:
303 self._SvPowerFlow._Terminal = self
305 SvPowerFlow = property(getSvPowerFlow, setSvPowerFlow)
307 def getConnectivityNode(self):
308 """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals.
310 return self._ConnectivityNode
312 def setConnectivityNode(self, value):
313 if self._ConnectivityNode is not None:
314 filtered = [x for x in self.ConnectivityNode.Terminals if x != self]
315 self._ConnectivityNode._Terminals = filtered
317 self._ConnectivityNode = value
318 if self._ConnectivityNode is not None:
319 self._ConnectivityNode._Terminals.append(self)
321 ConnectivityNode = property(getConnectivityNode, setConnectivityNode)
323 def getTieFlow(self):
324 """The control area tie flows to which this terminal associates.
326 return self._TieFlow
328 def setTieFlow(self, value):
329 for x in self._TieFlow:
330 x._Terminal = None
331 for y in value:
332 y._Terminal = self
333 self._TieFlow = value
335 TieFlow = property(getTieFlow, setTieFlow)
337 def addTieFlow(self, *TieFlow):
338 for obj in TieFlow:
339 obj._Terminal = self
340 self._TieFlow.append(obj)
342 def removeTieFlow(self, *TieFlow):
343 for obj in TieFlow:
344 obj._Terminal = None
345 self._TieFlow.remove(obj)