cut 3.3.0
Loading...
Searching...
No Matches
tauruscii.taurusciiattribute.OldbSubscription Class Reference

Interface implemenation for OLDB Subscriptions. More...

Public Member Functions

 __init__ (self, attribute)
 Initializes the OldbSubscription object.
 
 set_initial_value (self, Any initial_value, CiiOldbDpQuality initial_quality, int initial_timestamp)
 Stores the initial set of values as "last values" read.
 
 new_value (self, CiiOldbDpValue value, str uri)
 CiiOldbDpSubscription interface implementation #.
 
 dp_removed (self, str uri)
 This method is invoked by the OLDB client implementation when the subscribed data point is removed from the OLDB.
 
 value_stale (self, str uri)
 Callback method used by OLDB Client API to notify a subscription that the value has gone stale.
 
 value_changed (self, str uri)
 This method is invoked by the OLDB client implementation when the subscribed data point is marked as stale.
 
 value_fresh (self, str uri)
 Callback method used by OLDB Client API to notify a subscription that the value is no longer stale.
 

Detailed Description

Interface implemenation for OLDB Subscriptions.

An instance of this object can monitor one or multiple datapoints. The Taurus OLDB Plugin up to this version only support single datapoints, therefore for one datapoints, there is one OldbSubscription object.

Constructor & Destructor Documentation

◆ __init__()

tauruscii.taurusciiattribute.OldbSubscription.__init__ ( self,
attribute )

Initializes the OldbSubscription object.

Saves a weak reference to the attribute. Weak references do not increase reference counter and we can query if the reference object still exists. Since there is no assurance that new_value() and dp_removed() will not be called after we unsubscribe, we need a mechanism to avoid calling objects that are already destroyed.

Parameters
attribute(TaurusCiiAttribute) Attribute that is notified of the new value

Member Function Documentation

◆ dp_removed()

tauruscii.taurusciiattribute.OldbSubscription.dp_removed ( self,
str uri )

This method is invoked by the OLDB client implementation when the subscribed data point is removed from the OLDB.

CII OLDB Subscriptions requires to implement the CiiOldbDpSubscription interface. dp_removed is one of the methods.

Parameters
urithe URI of the datapoint removed.

◆ new_value()

tauruscii.taurusciiattribute.OldbSubscription.new_value ( self,
CiiOldbDpValue value,
str uri )

CiiOldbDpSubscription interface implementation #.

Handles new values comming from the OLDB server.

CII OLDB Subscriptions requires to implement the CiiOldbDpSubscription interface. new_value is one of the methods.

Parameters
value(CiiOldbDpValue) The new value.
uri(str) The URI of the new value.

◆ set_initial_value()

tauruscii.taurusciiattribute.OldbSubscription.set_initial_value ( self,
Any initial_value,
CiiOldbDpQuality initial_quality,
int initial_timestamp )

Stores the initial set of values as "last values" read.

Solves the initial read versus subscription problem. The staleness callbacks rely on the fact that the client is able to go back to the previous quality (it has to cache it). But there is a special case that happens when the client connects, and the datapoints are already stale. Then the subscription object will not have quality value to go back to.

The Attribute already has the values from the forced initial read. So this method allows the subcription object to have direct access to the values, before they are decoded by the decode method.

Parameters
initial_valueThe value as read from the OLDB. Any type supported by the OLDB.
initial_qualityThe quality as read from the OLDB. The OLDB still reports the original quality.
initial_timestampTimestamp of the read operation on the OLDB. it is in ns since
epoch

◆ value_changed()

tauruscii.taurusciiattribute.OldbSubscription.value_changed ( self,
str uri )

This method is invoked by the OLDB client implementation when the subscribed data point is marked as stale.

Parameters
uriURI as a string of the datapoint that is no longer stale.

◆ value_fresh()

tauruscii.taurusciiattribute.OldbSubscription.value_fresh ( self,
str uri )

Callback method used by OLDB Client API to notify a subscription that the value is no longer stale.

Parameters
uriURI as a string of the datapoint that is no longer stale.

◆ value_stale()

tauruscii.taurusciiattribute.OldbSubscription.value_stale ( self,
str uri )

Callback method used by OLDB Client API to notify a subscription that the value has gone stale.

Parameters
uriURI as a string that has gone stale.

The documentation for this class was generated from the following file: