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 TopologicalNode(IdentifiedObject
):
20 """For a detailed substation model a TopologicalNode is a set of connectivity nodes that, in the current network state, are connected together through any type of closed switches, including jumpers. Topological nodes changes as the current network state changes (i.e., switches, breakers, etc. change state). For a planning model switch statuses are not used to form TopologicalNodes. Instead they are manually created or deleted in a model builder tool. TopologialNodes maintained this way are also called 'busses'.
23 def __init__(self
, Terminal
=None, TopologicalIsland
=None, ReportingGroup
=None, ConnectivityNodes
=None, SvInjection
=None, SvVoltage
=None, SvShortCircuit
=None, BaseVoltage
=None, ConnectivityNodeContainer
=None, AngleRef_TopologicalIsland
=None, *args
, **kw_args
):
24 """Initialises a new 'TopologicalNode' instance.
26 @param Terminal: The terminals associated with the topological node. This can be used as an alternative to the connectivity node path to terminal, 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.
27 @param TopologicalIsland: A topological node belongs to a topological island
28 @param ReportingGroup: The reporting group to which the topological node belongs.
29 @param ConnectivityNodes: Several ConnectivityNode(s) may combine together to form a single TopologicalNode, depending on the current state of the network.
30 @param SvInjection: The injection state associated with the topological node.
31 @param SvVoltage: The state voltage associated with the topological node.
32 @param SvShortCircuit: The short circuit state associated with the topological node.
33 @param BaseVoltage: The base voltage of the topologocial node.
34 @param ConnectivityNodeContainer: The connectivity node container to which the toplogical node belongs.
35 @param AngleRef_TopologicalIsland: The island for which the node is an angle reference. Normally there is one angle reference node for each island.
38 self
.Terminal
= [] if Terminal
is None else Terminal
40 self
._TopologicalIsland
= None
41 self
.TopologicalIsland
= TopologicalIsland
43 self
._ReportingGroup
= None
44 self
.ReportingGroup
= ReportingGroup
46 self
._ConnectivityNodes
= []
47 self
.ConnectivityNodes
= [] if ConnectivityNodes
is None else ConnectivityNodes
49 self
._SvInjection
= None
50 self
.SvInjection
= SvInjection
52 self
._SvVoltage
= None
53 self
.SvVoltage
= SvVoltage
55 self
._SvShortCircuit
= None
56 self
.SvShortCircuit
= SvShortCircuit
58 self
._BaseVoltage
= None
59 self
.BaseVoltage
= BaseVoltage
61 self
._ConnectivityNodeContainer
= None
62 self
.ConnectivityNodeContainer
= ConnectivityNodeContainer
64 self
._AngleRef
_TopologicalIsland
= None
65 self
.AngleRef_TopologicalIsland
= AngleRef_TopologicalIsland
67 super(TopologicalNode
, self
).__init
__(*args
, **kw_args
)
73 _refs
= ["Terminal", "TopologicalIsland", "ReportingGroup", "ConnectivityNodes", "SvInjection", "SvVoltage", "SvShortCircuit", "BaseVoltage", "ConnectivityNodeContainer", "AngleRef_TopologicalIsland"]
74 _many_refs
= ["Terminal", "ConnectivityNodes"]
76 def getTerminal(self
):
77 """The terminals associated with the topological node. This can be used as an alternative to the connectivity node path to terminal, 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.
81 def setTerminal(self
, value
):
82 for x
in self
._Terminal
:
83 x
._TopologicalNode
= None
85 y
._TopologicalNode
= self
86 self
._Terminal
= value
88 Terminal
= property(getTerminal
, setTerminal
)
90 def addTerminal(self
, *Terminal
):
92 obj
._TopologicalNode
= self
93 self
._Terminal
.append(obj
)
95 def removeTerminal(self
, *Terminal
):
97 obj
._TopologicalNode
= None
98 self
._Terminal
.remove(obj
)
100 def getTopologicalIsland(self
):
101 """A topological node belongs to a topological island
103 return self
._TopologicalIsland
105 def setTopologicalIsland(self
, value
):
106 if self
._TopologicalIsland
is not None:
107 filtered
= [x
for x
in self
.TopologicalIsland
.TopologicalNodes
if x
!= self
]
108 self
._TopologicalIsland
._TopologicalNodes
= filtered
110 self
._TopologicalIsland
= value
111 if self
._TopologicalIsland
is not None:
112 self
._TopologicalIsland
._TopologicalNodes
.append(self
)
114 TopologicalIsland
= property(getTopologicalIsland
, setTopologicalIsland
)
116 def getReportingGroup(self
):
117 """The reporting group to which the topological node belongs.
119 return self
._ReportingGroup
121 def setReportingGroup(self
, value
):
122 if self
._ReportingGroup
is not None:
123 filtered
= [x
for x
in self
.ReportingGroup
.TopologicalNode
if x
!= self
]
124 self
._ReportingGroup
._TopologicalNode
= filtered
126 self
._ReportingGroup
= value
127 if self
._ReportingGroup
is not None:
128 self
._ReportingGroup
._TopologicalNode
.append(self
)
130 ReportingGroup
= property(getReportingGroup
, setReportingGroup
)
132 def getConnectivityNodes(self
):
133 """Several ConnectivityNode(s) may combine together to form a single TopologicalNode, depending on the current state of the network.
135 return self
._ConnectivityNodes
137 def setConnectivityNodes(self
, value
):
138 for x
in self
._ConnectivityNodes
:
139 x
._TopologicalNode
= None
141 y
._TopologicalNode
= self
142 self
._ConnectivityNodes
= value
144 ConnectivityNodes
= property(getConnectivityNodes
, setConnectivityNodes
)
146 def addConnectivityNodes(self
, *ConnectivityNodes
):
147 for obj
in ConnectivityNodes
:
148 obj
._TopologicalNode
= self
149 self
._ConnectivityNodes
.append(obj
)
151 def removeConnectivityNodes(self
, *ConnectivityNodes
):
152 for obj
in ConnectivityNodes
:
153 obj
._TopologicalNode
= None
154 self
._ConnectivityNodes
.remove(obj
)
156 def getSvInjection(self
):
157 """The injection state associated with the topological node.
159 return self
._SvInjection
161 def setSvInjection(self
, value
):
162 if self
._SvInjection
is not None:
163 self
._SvInjection
._TopologicalNode
= None
165 self
._SvInjection
= value
166 if self
._SvInjection
is not None:
167 self
._SvInjection
._TopologicalNode
= self
169 SvInjection
= property(getSvInjection
, setSvInjection
)
171 def getSvVoltage(self
):
172 """The state voltage associated with the topological node.
174 return self
._SvVoltage
176 def setSvVoltage(self
, value
):
177 if self
._SvVoltage
is not None:
178 self
._SvVoltage
._TopologicalNode
= None
180 self
._SvVoltage
= value
181 if self
._SvVoltage
is not None:
182 self
._SvVoltage
._TopologicalNode
= self
184 SvVoltage
= property(getSvVoltage
, setSvVoltage
)
186 def getSvShortCircuit(self
):
187 """The short circuit state associated with the topological node.
189 return self
._SvShortCircuit
191 def setSvShortCircuit(self
, value
):
192 if self
._SvShortCircuit
is not None:
193 self
._SvShortCircuit
._TopologicalNode
= None
195 self
._SvShortCircuit
= value
196 if self
._SvShortCircuit
is not None:
197 self
._SvShortCircuit
._TopologicalNode
= self
199 SvShortCircuit
= property(getSvShortCircuit
, setSvShortCircuit
)
201 def getBaseVoltage(self
):
202 """The base voltage of the topologocial node.
204 return self
._BaseVoltage
206 def setBaseVoltage(self
, value
):
207 if self
._BaseVoltage
is not None:
208 filtered
= [x
for x
in self
.BaseVoltage
.TopologicalNode
if x
!= self
]
209 self
._BaseVoltage
._TopologicalNode
= filtered
211 self
._BaseVoltage
= value
212 if self
._BaseVoltage
is not None:
213 self
._BaseVoltage
._TopologicalNode
.append(self
)
215 BaseVoltage
= property(getBaseVoltage
, setBaseVoltage
)
217 def getConnectivityNodeContainer(self
):
218 """The connectivity node container to which the toplogical node belongs.
220 return self
._ConnectivityNodeContainer
222 def setConnectivityNodeContainer(self
, value
):
223 if self
._ConnectivityNodeContainer
is not None:
224 filtered
= [x
for x
in self
.ConnectivityNodeContainer
.TopologicalNode
if x
!= self
]
225 self
._ConnectivityNodeContainer
._TopologicalNode
= filtered
227 self
._ConnectivityNodeContainer
= value
228 if self
._ConnectivityNodeContainer
is not None:
229 self
._ConnectivityNodeContainer
._TopologicalNode
.append(self
)
231 ConnectivityNodeContainer
= property(getConnectivityNodeContainer
, setConnectivityNodeContainer
)
233 def getAngleRef_TopologicalIsland(self
):
234 """The island for which the node is an angle reference. Normally there is one angle reference node for each island.
236 return self
._AngleRef
_TopologicalIsland
238 def setAngleRef_TopologicalIsland(self
, value
):
239 if self
._AngleRef
_TopologicalIsland
is not None:
240 self
._AngleRef
_TopologicalIsland
._AngleRef
_TopologicalNode
= None
242 self
._AngleRef
_TopologicalIsland
= value
243 if self
._AngleRef
_TopologicalIsland
is not None:
244 self
._AngleRef
_TopologicalIsland
._AngleRef
_TopologicalNode
= self
246 AngleRef_TopologicalIsland
= property(getAngleRef_TopologicalIsland
, setAngleRef_TopologicalIsland
)