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
.Element
import Element
19 class Quality61850(Element
):
20 """Quality flags in this class are as defined in IEC 61850, except for estimatorReplaced, which has been included in this class for convenience.
23 def __init__(self
, validity
="QUESTIONABLE", source
="SUBSTITUTED", failure
=False, suspect
=False, oldData
=False, badReference
=False, test
=False, outOfRange
=False, estimatorReplaced
=False, oscillatory
=False, operatorBlocked
=False, overFlow
=False, *args
, **kw_args
):
24 """Initialises a new 'Quality61850' instance.
26 @param validity: Validity of the measurement value. Values are: "QUESTIONABLE", "INVALID", "GOOD"
27 @param source: Source gives information related to the origin of a value. The value may be acquired from the process, defaulted or substituted. Values are: "SUBSTITUTED", "DEFAULTED", "PROCESS"
28 @param failure: This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure.
29 @param suspect: A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator.
30 @param oldData: Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval.
31 @param badReference: Measurement value may be incorrect due to a reference being out of calibration.
32 @param test: Measurement value is transmitted for test purposes.
33 @param outOfRange: Measurement value is beyond a predefined range of value.
34 @param estimatorReplaced: Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience.
35 @param oscillatory: To prevent some overload of the communication it is sensible to detect and suppress oscillating (fast changing) binary inputs. If a signal changes in a defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) then oscillation is detected and the detail quality identifier 'oscillatory' is set. If it is detected a configured numbers of transient changes could be passed by. In this time the validity status 'questionable' is set. If after this defined numbers of changes the signal is still in the oscillating state the value shall be set either to the opposite state of the previous stable value or to a defined default value. In this case the validity status 'questionable' is reset and 'invalid' is set as long as the signal is oscillating. If it is configured such that no transient changes should be passed by then the validity status 'invalid' is set immediately in addition to the detail quality identifier 'oscillatory' (used for status information only).
36 @param operatorBlocked: Measurement value is blocked and hence unavailable for transmission.
37 @param overFlow: Measurement value is beyond the capability of being represented properly. For example, a counter value overflows from maximum count back to a value of zero.
39 #: Validity of the measurement value. Values are: "QUESTIONABLE", "INVALID", "GOOD"
40 self
.validity
= validity
42 #: Source gives information related to the origin of a value. The value may be acquired from the process, defaulted or substituted. Values are: "SUBSTITUTED", "DEFAULTED", "PROCESS"
45 #: This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure.
46 self
.failure
= failure
48 #: A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator.
49 self
.suspect
= suspect
51 #: Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval.
52 self
.oldData
= oldData
54 #: Measurement value may be incorrect due to a reference being out of calibration.
55 self
.badReference
= badReference
57 #: Measurement value is transmitted for test purposes.
60 #: Measurement value is beyond a predefined range of value.
61 self
.outOfRange
= outOfRange
63 #: Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience.
64 self
.estimatorReplaced
= estimatorReplaced
66 #: To prevent some overload of the communication it is sensible to detect and suppress oscillating (fast changing) binary inputs. If a signal changes in a defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) then oscillation is detected and the detail quality identifier 'oscillatory' is set. If it is detected a configured numbers of transient changes could be passed by. In this time the validity status 'questionable' is set. If after this defined numbers of changes the signal is still in the oscillating state the value shall be set either to the opposite state of the previous stable value or to a defined default value. In this case the validity status 'questionable' is reset and 'invalid' is set as long as the signal is oscillating. If it is configured such that no transient changes should be passed by then the validity status 'invalid' is set immediately in addition to the detail quality identifier 'oscillatory' (used for status information only).
67 self
.oscillatory
= oscillatory
69 #: Measurement value is blocked and hence unavailable for transmission.
70 self
.operatorBlocked
= operatorBlocked
72 #: Measurement value is beyond the capability of being represented properly. For example, a counter value overflows from maximum count back to a value of zero.
73 self
.overFlow
= overFlow
75 super(Quality61850
, self
).__init
__(*args
, **kw_args
)
77 _attrs
= ["validity", "source", "failure", "suspect", "oldData", "badReference", "test", "outOfRange", "estimatorReplaced", "oscillatory", "operatorBlocked", "overFlow"]
78 _attr_types
= {"validity": str, "source": str, "failure": bool, "suspect": bool, "oldData": bool, "badReference": bool, "test": bool, "outOfRange": bool, "estimatorReplaced": bool, "oscillatory": bool, "operatorBlocked": bool, "overFlow": bool}
79 _defaults
= {"validity": "QUESTIONABLE", "source": "SUBSTITUTED", "failure": False, "suspect": False, "oldData": False, "badReference": False, "test": False, "outOfRange": False, "estimatorReplaced": False, "oscillatory": False, "operatorBlocked": False, "overFlow": False}
80 _enums
= {"validity": "Validity", "source": "Source"}