OcaNumericObserver#
This document describes the device side implementation of OcaNumericObserver. This class is documented in the AES70 standard as:
Observer of a scalar numeric or boolean property ("target property") of a specified object. Does not work for array, list, map, struct, or string properties.
OcaNumericObserver emits an Observation event under certain conditions. There are three kinds of conditions:
Numeric comparison. The 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 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. 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 threshold 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 OcaInt64.
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 sensor readings, but may be used equally well for watching workers' parameter settings.
Overview#
- ClassID: 1.2.4
- Header:
aes70/device/OcaNumericObserver.hpp
- Namespace:
aes70::device
- Inheritance: aes70::device::OcaAgent, aes70::device::OcaRoot, aes70::device::object
Class Declaration#
The device side implementation has the following signature.
namespace aes70::device
{
template <class Implementation>
class OcaNumericObserver : public OcaAgent<Implementation>
{
};
}
The template argument Implementation
may implement the following methods.
Note
The signatures given here are just one possibility and that most methods are optional. Implement only those methods which make sense in the context of your device. See the documentation in Implementing AES70 Classes for more details.
class MyOcaNumericObserverImplementation
{
// Methods defined by OcaNumericObserver
OcaFloat64 GetLastObservation();
OcaObserverState GetState();
OcaProperty GetObservedProperty();
void SetObservedProperty(OcaProperty property);
OcaFloat64 GetThreshold();
void SetThreshold(OcaFloat64 Threshold);
OcaRelationalOperator GetOperator();
void SetOperator(OcaRelationalOperator operator);
OcaBoolean GetTwoWay();
void SetTwoWay(OcaBoolean twoWay);
OcaFloat64 GetHysteresis();
void SetHysteresis(OcaFloat64 hysteresis);
OcaTimeInterval GetPeriod();
void SetPeriod(OcaTimeInterval period);
// Methods defined by OcaAgent
OcaString GetLabel();
void SetLabel(OcaString Label);
OcaONo GetOwner();
std::tuple<OcaRolePath,OcaONoPath> GetPath();
// Methods defined by OcaRoot
OcaBoolean GetLockable();
void SetLockNoReadWrite();
void Unlock();
OcaString GetRole();
void SetLockNoWrite();
OcaLockState GetLockState();
};