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
.Element
import Element
23 class Quality61850(Element
):
24 """Quality flags in this class are as defined in IEC 61850, except for estimatorReplaced, which has been included in this class for convenience.
27 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
):
28 """Initialises a new 'Quality61850' instance.
30 @param validity: Validity of the measurement value. Values are: "QUESTIONABLE", "INVALID", "GOOD"
31 @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"
32 @param failure: This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure.
33 @param suspect: A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator.
34 @param oldData: Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval.
35 @param badReference: Measurement value may be incorrect due to a reference being out of calibration.
36 @param test: Measurement value is transmitted for test purposes.
37 @param outOfRange: Measurement value is beyond a predefined range of value.
38 @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.
39 @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).
40 @param operatorBlocked: Measurement value is blocked and hence unavailable for transmission.
41 @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.
43 #: Validity of the measurement value. Values are: "QUESTIONABLE", "INVALID", "GOOD"
44 self
.validity
= validity
46 #: 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"
49 #: This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure.
50 self
.failure
= failure
52 #: A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator.
53 self
.suspect
= suspect
55 #: Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval.
56 self
.oldData
= oldData
58 #: Measurement value may be incorrect due to a reference being out of calibration.
59 self
.badReference
= badReference
61 #: Measurement value is transmitted for test purposes.
64 #: Measurement value is beyond a predefined range of value.
65 self
.outOfRange
= outOfRange
67 #: Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience.
68 self
.estimatorReplaced
= estimatorReplaced
70 #: 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).
71 self
.oscillatory
= oscillatory
73 #: Measurement value is blocked and hence unavailable for transmission.
74 self
.operatorBlocked
= operatorBlocked
76 #: 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.
77 self
.overFlow
= overFlow
79 super(Quality61850
, self
).__init
__(*args
, **kw_args
)
81 _attrs
= ["validity", "source", "failure", "suspect", "oldData", "badReference", "test", "outOfRange", "estimatorReplaced", "oscillatory", "operatorBlocked", "overFlow"]
82 _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}
83 _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}
84 _enums
= {"validity": "Validity", "source": "Source"}