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
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class BusNameMarker(IdentifiedObject
):
24 """Used to apply user standard names to topology buses. Typically used for 'bus/branch' case generation. Associated with one or more ConnectivityNodes that are normally a part of the bus name. The associated ConnectivityNodes are to be connected by non-retained switches. For a ring bus station configuration, all busbar connectivity nodes in the ring are typically associated. For a breaker and a half scheme, both busbars would be associated. For a ring bus, all busbars would be associated. For a 'straight' busbar configuration, only the main connectivity node at the busbar would be associated.
27 def __init__(self
, ReportingGroup
=None, ConnectivityNode
=None, *args
, **kw_args
):
28 """Initialises a new 'BusNameMarker' instance.
30 @param ReportingGroup: The reporting group to which this BusNameMarker belongs.
31 @param ConnectivityNode: The list of nodes which have the same bus name in the normal topology. Note that this list of ConnectivityNodes should be connected by objects derived from Switch that are normally closed.
33 self
._ReportingGroup
= None
34 self
.ReportingGroup
= ReportingGroup
36 self
._ConnectivityNode
= []
37 self
.ConnectivityNode
= [] if ConnectivityNode
is None else ConnectivityNode
39 super(BusNameMarker
, self
).__init
__(*args
, **kw_args
)
45 _refs
= ["ReportingGroup", "ConnectivityNode"]
46 _many_refs
= ["ConnectivityNode"]
48 def getReportingGroup(self
):
49 """The reporting group to which this BusNameMarker belongs.
51 return self
._ReportingGroup
53 def setReportingGroup(self
, value
):
54 if self
._ReportingGroup
is not None:
55 filtered
= [x
for x
in self
.ReportingGroup
.BusNameMarker
if x
!= self
]
56 self
._ReportingGroup
._BusNameMarker
= filtered
58 self
._ReportingGroup
= value
59 if self
._ReportingGroup
is not None:
60 if self
not in self
._ReportingGroup
._BusNameMarker
:
61 self
._ReportingGroup
._BusNameMarker
.append(self
)
63 ReportingGroup
= property(getReportingGroup
, setReportingGroup
)
65 def getConnectivityNode(self
):
66 """The list of nodes which have the same bus name in the normal topology. Note that this list of ConnectivityNodes should be connected by objects derived from Switch that are normally closed.
68 return self
._ConnectivityNode
70 def setConnectivityNode(self
, value
):
71 for x
in self
._ConnectivityNode
:
72 x
.BusNameMarker
= None
74 y
._BusNameMarker
= self
75 self
._ConnectivityNode
= value
77 ConnectivityNode
= property(getConnectivityNode
, setConnectivityNode
)
79 def addConnectivityNode(self
, *ConnectivityNode
):
80 for obj
in ConnectivityNode
:
81 obj
.BusNameMarker
= self
83 def removeConnectivityNode(self
, *ConnectivityNode
):
84 for obj
in ConnectivityNode
:
85 obj
.BusNameMarker
= None