|
cut 3.3.0
|
Public Member Functions | |
| encode (self, value) | |
| Taurus overriden methods. | |
| read (self, bool cache=False) | |
| Returns the current or default value of the attribute. | |
| decode (self, new_value, timestamp_src) | |
| Decodes a value that was received from MAL publisher into the expected representation. | |
| change_subscription_state (self, new_state) | |
| Subscribtion methods. | |
| push_event (self, new_value, timestamp_src) | |
| Takes a new TaurusAttrValue and generates the appropiate Change Event, which notifies listeners of the new value. | |
| set_throttling_rate (self, rate) | |
| Sets rate at which received data will be throtled. | |
| addListener (self, listener) | |
| API for listeners. | |
| removeListener (self, listener) | |
| Remove a TaurusListener from the listeners list. | |
| isUsingEvents (self) | |
| Indicates if the Attribute has succesfully subcribed to changes from the OLDB. | |
| SubscriptionState | getSubscriptionState (self) |
| Returns the SubscriptionState enumeration value. | |
Protected Member Functions | |
| _validate_struct (self) | |
| We try to get member variables of the struct. | |
| _from_mal_get_dimensions (self, attrib) | |
| Get data type from MAL member. | |
| (TaurusEventType, TaurusAttrValue) | _pushAttrEvent (self, new_value, timestamp_src) |
| Handler of events from MAL publisher. | |
| _convert_to_TAI (self, calendar_clock_timestamp) | |
| Convert calendar clock timestamp to TAI clock timestamp. | |
| _subscribe (self) | |
| Subscribes to mal topic. | |
. seealso:: :mod:tauruscii
.. warning:: In most cases this class should not be instantiated directly. Instead it should be done via the :meth:TaurusCiiFactory.getAttribute
|
protected |
Handler of events from MAL publisher.
It handles the subscription
| new_value | New value received from MAL publisher |
TaurusEventType (or None to indicate that there should not be notification to listeners). evt_value is a TaurusValue, an Exception, or None.
|
protected |
We try to get member variables of the struct.
Because the implementation covers simple data types, the struct must contain only one member. Otherwise an exception will be thrown
| taurusmalps.taurusmalpsattribute.TaurusMalPSAttribute.addListener | ( | self, | |
| listener ) |
API for listeners.
Add a TaurusListener object in the listeners list. If it is the first element and Polling is enabled starts the polling mechanism. If the listener is already registered nothing happens.
| SubscriptionState taurusmalps.taurusmalpsattribute.TaurusMalPSAttribute.getSubscriptionState | ( | self | ) |
Returns the SubscriptionState enumeration value.
| taurusmalps.taurusmalpsattribute.TaurusMalPSAttribute.isUsingEvents | ( | self | ) |
Indicates if the Attribute has succesfully subcribed to changes from the OLDB.
| taurusmalps.taurusmalpsattribute.TaurusMalPSAttribute.read | ( | self, | |
| bool | cache = False ) |
Returns the current or default value of the attribute.
In subscription mechanism, the function is necessary to set initial value of the attribute do that when new data arrives, change event could be triggered
| taurusmalps.taurusmalpsattribute.TaurusMalPSAttribute.removeListener | ( | self, | |
| listener ) |
Remove a TaurusListener from the listeners list.
If polling enabled and it is the last element the stop the polling timer. If the listener is not registered nothing happens.
| taurusmalps.taurusmalpsattribute.TaurusMalPSAttribute.set_throttling_rate | ( | self, | |
| rate ) |
Sets rate at which received data will be throtled.
E if rate is 10Hz, then within 1s approx 10 data samples should be pushed as new value, no matter what is the frequency of data publisher.
By default the rate is defined in tauruscustomsettings. If, by any reason, the rate cannot be found in tauruscustomsettings, it gets default value of 10 Hz which is defined in MalPSSubscription class.
| rate | throttling rate [Hz] |