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 OperationalLimitType(IdentifiedObject
):
20 """A type of limit. The meaning of a specific limit is described in this class.
23 def __init__(self
, direction
="low", acceptableDuration
=0.0, OperationalLimit
=None, *args
, **kw_args
):
24 """Initialises a new 'OperationalLimitType' instance.
26 @param direction: The direction of the limit. Values are: "low", "absoluteValue", "high"
27 @param acceptableDuration: The nominal acceptable duration of the limit. Limits are commonly expressed in terms of the a time limit for which the limit is normally acceptable. The actual acceptable duration of a specific limit may depend on other local factors such as temperature or wind speed.
28 @param OperationalLimit: The operational limits associated with this type of limit.
30 #: The direction of the limit. Values are: "low", "absoluteValue", "high"
31 self
.direction
= direction
33 #: The nominal acceptable duration of the limit. Limits are commonly expressed in terms of the a time limit for which the limit is normally acceptable. The actual acceptable duration of a specific limit may depend on other local factors such as temperature or wind speed.
34 self
.acceptableDuration
= acceptableDuration
36 self
._OperationalLimit
= []
37 self
.OperationalLimit
= [] if OperationalLimit
is None else OperationalLimit
39 super(OperationalLimitType
, self
).__init
__(*args
, **kw_args
)
41 _attrs
= ["direction", "acceptableDuration"]
42 _attr_types
= {"direction": str, "acceptableDuration": float}
43 _defaults
= {"direction": "low", "acceptableDuration": 0.0}
44 _enums
= {"direction": "OperationalLimitDirectionKind"}
45 _refs
= ["OperationalLimit"]
46 _many_refs
= ["OperationalLimit"]
48 def getOperationalLimit(self
):
49 """The operational limits associated with this type of limit.
51 return self
._OperationalLimit
53 def setOperationalLimit(self
, value
):
54 for x
in self
._OperationalLimit
:
55 x
.OperationalLimitType
= None
57 y
._OperationalLimitType
= self
58 self
._OperationalLimit
= value
60 OperationalLimit
= property(getOperationalLimit
, setOperationalLimit
)
62 def addOperationalLimit(self
, *OperationalLimit
):
63 for obj
in OperationalLimit
:
64 obj
.OperationalLimitType
= self
66 def removeOperationalLimit(self
, *OperationalLimit
):
67 for obj
in OperationalLimit
:
68 obj
.OperationalLimitType
= None