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
.StateVariables
.StateVariable
import StateVariable
19 class SvShuntCompensatorSections(StateVariable
):
20 """State variable for the number of sections in service for a shunt compensator.
23 def __init__(self
, continuousSections
=0.0, sections
=0, ShuntCompensator
=None, *args
, **kw_args
):
24 """Initialises a new 'SvShuntCompensatorSections' instance.
26 @param continuousSections: The number of sections in service as a continous variable.
27 @param sections: The number of sections in service.
28 @param ShuntCompensator: The shunt compensator for which the state applies.
30 #: The number of sections in service as a continous variable.
31 self
.continuousSections
= continuousSections
33 #: The number of sections in service.
34 self
.sections
= sections
36 self
._ShuntCompensator
= None
37 self
.ShuntCompensator
= ShuntCompensator
39 super(SvShuntCompensatorSections
, self
).__init
__(*args
, **kw_args
)
41 _attrs
= ["continuousSections", "sections"]
42 _attr_types
= {"continuousSections": float, "sections": int}
43 _defaults
= {"continuousSections": 0.0, "sections": 0}
45 _refs
= ["ShuntCompensator"]
48 def getShuntCompensator(self
):
49 """The shunt compensator for which the state applies.
51 return self
._ShuntCompensator
53 def setShuntCompensator(self
, value
):
54 if self
._ShuntCompensator
is not None:
55 self
._ShuntCompensator
._SvShuntCompensatorSections
= None
57 self
._ShuntCompensator
= value
58 if self
._ShuntCompensator
is not None:
59 self
._ShuntCompensator
._SvShuntCompensatorSections
= self
61 ShuntCompensator
= property(getShuntCompensator
, setShuntCompensator
)