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
.ConnectivityNodeContainer
import ConnectivityNodeContainer
19 class EquivalentNetwork(ConnectivityNodeContainer
):
20 """A class that represents an external meshed network that has been reduced to an electrically equivalent model. The ConnectivityNodes contained in the equivalent are intended to reflect internal nodes of the equivalent. The boundary Connectivity nodes where the equivalent connects outside itself are NOT contained by the equivalent.
23 def __init__(self
, EquivalentEquipments
=None, *args
, **kw_args
):
24 """Initialises a new 'EquivalentNetwork' instance.
26 @param EquivalentEquipments: The associated reduced equivalents.
28 self
._EquivalentEquipments
= []
29 self
.EquivalentEquipments
= [] if EquivalentEquipments
is None else EquivalentEquipments
31 super(EquivalentNetwork
, self
).__init
__(*args
, **kw_args
)
37 _refs
= ["EquivalentEquipments"]
38 _many_refs
= ["EquivalentEquipments"]
40 def getEquivalentEquipments(self
):
41 """The associated reduced equivalents.
43 return self
._EquivalentEquipments
45 def setEquivalentEquipments(self
, value
):
46 for x
in self
._EquivalentEquipments
:
47 x
._EquivalentNetwork
= None
49 y
._EquivalentNetwork
= self
50 self
._EquivalentEquipments
= value
52 EquivalentEquipments
= property(getEquivalentEquipments
, setEquivalentEquipments
)
54 def addEquivalentEquipments(self
, *EquivalentEquipments
):
55 for obj
in EquivalentEquipments
:
56 obj
._EquivalentNetwork
= self
57 self
._EquivalentEquipments
.append(obj
)
59 def removeEquivalentEquipments(self
, *EquivalentEquipments
):
60 for obj
in EquivalentEquipments
:
61 obj
._EquivalentNetwork
= None
62 self
._EquivalentEquipments
.remove(obj
)