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 RecloseSequence(IdentifiedObject
):
20 """A reclose sequence (open and close) is defined for each possible reclosure of a breaker.
23 def __init__(self
, recloseDelay
=0.0, recloseStep
=0, ProtectedSwitch
=None, *args
, **kw_args
):
24 """Initialises a new 'RecloseSequence' instance.
26 @param recloseDelay: Indicates the time lapse before the reclose step will execute a reclose.
27 @param recloseStep: Indicates the ordinal position of the reclose step relative to other steps in the sequence.
28 @param ProtectedSwitch: A breaker may have zero or more automatic reclosures after a trip occurs.
30 #: Indicates the time lapse before the reclose step will execute a reclose.
31 self
.recloseDelay
= recloseDelay
33 #: Indicates the ordinal position of the reclose step relative to other steps in the sequence.
34 self
.recloseStep
= recloseStep
36 self
._ProtectedSwitch
= None
37 self
.ProtectedSwitch
= ProtectedSwitch
39 super(RecloseSequence
, self
).__init
__(*args
, **kw_args
)
41 _attrs
= ["recloseDelay", "recloseStep"]
42 _attr_types
= {"recloseDelay": float, "recloseStep": int}
43 _defaults
= {"recloseDelay": 0.0, "recloseStep": 0}
45 _refs
= ["ProtectedSwitch"]
48 def getProtectedSwitch(self
):
49 """A breaker may have zero or more automatic reclosures after a trip occurs.
51 return self
._ProtectedSwitch
53 def setProtectedSwitch(self
, value
):
54 if self
._ProtectedSwitch
is not None:
55 filtered
= [x
for x
in self
.ProtectedSwitch
.RecloseSequences
if x
!= self
]
56 self
._ProtectedSwitch
._RecloseSequences
= filtered
58 self
._ProtectedSwitch
= value
59 if self
._ProtectedSwitch
is not None:
60 self
._ProtectedSwitch
._RecloseSequences
.append(self
)
62 ProtectedSwitch
= property(getProtectedSwitch
, setProtectedSwitch
)