OcaNumericObserverList¶
A online version of the AES70 specification of this class can be found at http://docs.deuso.de.
The class is a subclass of OcaAgent()
.
This class defines the properties
Name |
JavaScript Type |
AES70 Type |
---|---|---|
State |
OcaObserverState |
OcaObserverState |
ObservedProperties |
OcaProperty[] |
OcaList<OcaProperty> |
Threshold |
number |
OcaFloat64 |
Operator |
OcaRelationalOperator |
OcaRelationalOperator |
TwoWay |
boolean |
OcaBoolean |
Hysteresis |
number |
OcaFloat64 |
Period |
number |
OcaTimeInterval |
Furthermore, it inherits the properties ClassID, ClassVersion, ObjectNumber, Lockable, Role, Label, Owner, State, ObservedProperties, Threshold, Operator, TwoWay, Hysteresis and Period.
-
class
OcaNumericObserverList
(objectNumber, device)¶ Observer of a scalar numeric or boolean property (“target property”) of a set of specified objects. This class is a subclass of OcaNumericObserver , and differs from that class only in that it observes a set of properties rather than a single property. Does not work for array, list, map, struct, or string properties. OcaNumericObserverList emits an Observation event under certain conditions. There are three kinds of conditions:
Numeric comparison . A target property value meets a certain comparison condition. A selection of comparison operators is available. Such observations are called “asynchronous observations”.
Timer expiry . The value of the Period property, if nonzero, is a the time interval for the recurrent timed emission of Observation events. Such events (“periodic observations”) are emitted regardless of the target property’s value.
Combination of (1) and (2) . If a numeric comparison and a nonzero period are both specified, then the Observation event is emitted when the timer expires and the numeric comparison is true for at least one of the observed properties. Such observations are called “conditional-periodic observations”.
This is a weakly typed class. Its threshold is specified as an OcaFloat64 number.
For unsigned integer targets, the threshold and target are both coerced to OcaUint64 before comparing.
For signed integer targets, the threshold and target are both coerced to OcaInt64 before comparing.
For boolean values, the threshold hreshold and target are both coerced to OcaUint8 , True is assigned the value One, False is assigned the value Zero.
Note that this coercion may result in rounding errors if the observed datatype is of type OcaUint64 or OcaUint64. An OcaNumericObserver instance and the property it observes are bound at the time the OcaNumericObserver instance is constructed. For static devices, construction will occur during manufacture, or possibly during a subsequent hardware configuration step. For reconfigurable devices, construction might be done by online controllers as part of device configuration sessions. This class is normally used for monitoring readings of sensor readings, but may be used equally well for watching workers’ parameter settings.
-
OcaNumericObserverList.
OnHysteresisChanged
¶ type: PropertyEvent.<number>
This event is emitted when the property Hysteresis changes in the remote object. The property
Hysteresis
is described in the AES70 standard as follows. Hysteresis that is used when observing the property value. This indicates which amount must be added/subtracted from the <b>Threshold </b>value to raise or re-enable the <b>Triggered </b>event of this <b>OcaObserver </b>object. The rules for hysteresis handling depend upon the configured <b>Operator </b>and <b>TwoWay </b>properties. The <b>Hysteresis </b>property is ignored if the <b>Operator </b>property is ‘Inequality’. If the State is <b>Not Triggered</b> it changes to <b>Triggered </b>if <u>any </u>of the ObservedProperties reaches the Threshold. If the State is <b>Triggered </b>it changes to <b>Not Triggered</b> only if <u>all </u>of the ObservedProperties no longer meet the ‘Threshold including Hysteresis’<b> .</b>
-
OcaNumericObserverList.
OnObservation
¶ type: Event
Event emitted to signal an asynchronous, periodic, or conditional-periodic observation. This event returns the complete list of values being observed, regardless of which one(s) may have triggered it in the first place. The order of values in the returned list is determined by the order of values set by SetObservedProperties, and is the same as the order of values returned by GetLastObservation, and the same as the order of object identifications returned by GetObservedProperties.
-
OcaNumericObserverList.
OnObservedPropertiesChanged
¶ type: PropertyEvent.<Array.<OcaProperty>>
This event is emitted when the property ObservedProperties changes in the remote object. The property
ObservedProperties
is described in the AES70 standard as follows. List of identifiers of the properties are being observed.
-
OcaNumericObserverList.
OnOperatorChanged
¶ type: PropertyEvent.<OcaRelationalOperator>
This event is emitted when the property Operator changes in the remote object. The property
Operator
is described in the AES70 standard as follows. Relational operator used when comparing the value of the observed property to the threshold value.
-
OcaNumericObserverList.
OnPeriodChanged
¶ type: PropertyEvent.<number>
This event is emitted when the property Period changes in the remote object. The property
Period
is described in the AES70 standard as follows. Repetition period or zero. If nonzero, the observer will retrieve the value and emit
-
OcaNumericObserverList.
OnStateChanged
¶ type: PropertyEvent.<OcaObserverState>
This event is emitted when the property State changes in the remote object. The property
State
is described in the AES70 standard as follows. State: triggered, not triggered
-
OcaNumericObserverList.
OnThresholdChanged
¶ type: PropertyEvent.<number>
This event is emitted when the property Threshold changes in the remote object. The property
Threshold
is described in the AES70 standard as follows. Comparison value for raising the <b>Triggered </b>event.
-
OcaNumericObserverList.
OnTwoWayChanged
¶ type: PropertyEvent.<boolean>
This event is emitted when the property TwoWay changes in the remote object. The property
TwoWay
is described in the AES70 standard as follows. True to emit a <b>Triggered </b>event upon crossing the threshold in either direction; false to emit only upon crossing in the primary direction (i.e. rising when <b>Operator </b>is set to <u>GreaterThan</u> or <u>GreaterThanOrEqual</u>; falling when <b>Operator </b>is set to <u>LessThan</u><b> </b>or <u>LessThanOrEqual</u>; equality when <b>Operator </b>is set to <u>Equality</u>; inequality when <b>Operator </b>is set to <u>Inequality</u>).
-
OcaNumericObserverList.
GetHysteresis
()¶ Gets the value of the Hysteresis property. The return value indicates whether the property was successfully retrieved.
- Returns
Promise.<number> – A promise which resolves to a single value of type
number
.
-
OcaNumericObserverList.
GetLastObservation
()¶ Gets the values of the observed property that were reported by the most recently emitted Observation event. If the numeric observer has never emitted an Observation event, returns a list of IEEE not-a-number values. The order of values in the returned list is determined by the order of values set by SetObservedProperties, and is the same as the order of values returned by the Observation event, and the same as the order of object identifications returned by GetObservedProperties. The return status indicates whether the value has been successfully returned.
- Returns
Promise.<Array.<number>> – A promise which resolves to a single value of type
number[]
.
-
OcaNumericObserverList.
GetObservedProperties
()¶ Gets the identifications of the properties that the observer observes. The order of property identifications in the returned list is determined by the order of property identifications set by SetObservedProperties, and is the same as the order of values returned by GetLastObservation and the Observation event. The return value indicates whether the identifications were successfully retrieved.
- Returns
Promise.<Array.<OcaProperty>> – A promise which resolves to a single value of type
OcaProperty[]
.
-
OcaNumericObserverList.
GetOperator
()¶ Gets the value of the Operator property. The return value indicates whether the property was successfully retrieved.
- Returns
Promise.<OcaRelationalOperator> – A promise which resolves to a single value of type
OcaRelationalOperator()
.
-
OcaNumericObserverList.
GetPeriod
()¶ Gets the value of the Period property. The return value indicates whether the property was successfully retrieved.
- Returns
Promise.<number> – A promise which resolves to a single value of type
number
.
-
OcaNumericObserverList.
GetState
()¶ Gets the observer’s state. The return value indicates whether the state was successfully retrieved.
- Returns
Promise.<OcaObserverState> – A promise which resolves to a single value of type
OcaObserverState()
.
-
OcaNumericObserverList.
GetThreshold
()¶ Gets the value of the Threshold property. The return value indicates whether the threshold value was successfully retrieved.
- Returns
Promise.<number> – A promise which resolves to a single value of type
number
.
-
OcaNumericObserverList.
GetTwoWay
()¶ Gets the value of the TwoWay property. The return value indicates whether the property was successfully retrieved.
- Returns
Promise.<boolean> – A promise which resolves to a single value of type
boolean
.
-
OcaNumericObserverList.
SetHysteresis
(hysteresis)¶ Sets the value of the Hysteresis property. The return value indicates whether the property was successfully set.
- Arguments
hysteresis (number) –
- Returns
Promise.<void> –
-
OcaNumericObserverList.
SetObservedProperties
(property)¶ Sets the identifications of the properties that the observer observes. The order of property identifications supplied determines the order of property identifications returned by GetObservedProperties and the order of values returned by GetLastObservation and the Observation event. The return value indicates whether the identifications were successfully set.
- Arguments
property (Array.<OcaProperty>) –
- Returns
Promise.<void> –
-
OcaNumericObserverList.
SetOperator
(_operator)¶ Sets the value of the Operator property. The return value indicates whether the operator was successfully set.
- Arguments
_operator (OcaRelationalOperator) –
- Returns
Promise.<void> –
-
OcaNumericObserverList.
SetPeriod
(period)¶ Sets the value of the Period property. The return value indicates whether the property was successfully set.
- Arguments
period (number) –
- Returns
Promise.<void> –
-
OcaNumericObserverList.
SetThreshold
(Threshold)¶ Sets the value of the Threshold property. The return value indicates whether the threshold value was successfully set.
- Arguments
Threshold (number) –
- Returns
Promise.<void> –
-
OcaNumericObserverList.
SetTwoWay
(twoWay)¶ Sets the value of the TwoWay property. The return value indicates whether the property was successfully set.
- Arguments
twoWay (boolean) –
- Returns
Promise.<void> –