Bases: PyQt4.QtCore.QObject, taurus.qt.qtgui.base.taurusbase.TaurusBaseComponent
A collection of TaurusCurves generated from a Taurus Attribute.
If the attribute is a scalar, The Trend Set consists of only one curve representing the evolution of the value of the attribute. If the attribute is a SPECTRUM, as many curves as the length of the spectrum are created, each representing the evolution of the value of a component of the array.
When an event is received, all curves belonging to a TaurusTrendSet are updated.
TaurusTrendSet objects can be considered as containers of (sorted) curves. As such, the curves contained by them can be accessed with item notation, as in the following example:
attrname = 'a/b/c/d' #consider this attribute is a SPECTRUM of 3 elements
ts=TaurusTrendSet(attrname)
... # wait for a Taurus Event arriving so that the curves are created
ncurves = len(ts) #ncurves will be 3 (assuming the event already arrived)
curve0 = ts[0] #you can access the curve by index
curve1 = ts['a/b/c/d[1]'] #and also by name
Note that internally each curve is treated as a RawData curve (i.e., it is not aware of events by itself, but it relies on the TaurusTrendSet object to update its values)
add a curve (with the given name) to the internal curves dictionary of this TaurusTrendSet
Parameters: |
|
---|
clears all stored data (buffers and copies of the curves data)
Parameters: | replot (:class:~`bool`) – do a replot after clearing |
---|
Return a base tile for a trend in whichs substitution of known placeholders has been performed.
Parameters: | basetitle (:class:~`str`) –
|
---|
Note that <trend_index> itself is not substituted!
Return type: | :class:~`str` |
---|---|
Returns: | the compiled base title. |
See also
Return a list of titles. Each title corresponds to a trend of the trendset (ordered). Substitution of known placeholders is performed.
Parameters: | basetitle (:class:~`str`) –
|
---|---|
Return type: | :class:~`string_list` |
Returns: | a list of title strings that correspond to the list of trends in the set. |
See also
Forces a read of the attribute and generates a fake event with it. By default it ignores the cache
Parameters: | cache (:class:~`bool`) – set to True to do cache’d reading (by default is False) |
---|
returns a list of the names of the curves associated to this TaurusTrendSet. The curve names will always be returned in the order they were added to the set
Return type: | :class:~`list` <:class:~`str`> |
---|---|
Returns: | the names of the curves |
returns an iterator of (curveName,curveObject) tuples associated to this TaurusTrendSet. The curves will always be returned in the order they were added to the set
Return type: | :class:~`iterator` <:class:~`str`, :class:~`TaurusCurve`> |
---|---|
Returns: |
see TaurusBaseComponent.getModelClass()
processes Change (and Periodic) Taurus Events: updates the data of all curves in the set according to the value of the attribute.
For documentation about the parameters of this method, see TaurusBaseComponent.handleEvent()
Returns the index in the trend for the given curve name. It gives an exception if the curve is not in the set.
Parameters: | curveName (:class:~`str`) – the curvename to find |
---|---|
Return type: | :class:~`int` |
Returns: | The index associated to the given curve in the TrendSet |
see TaurusBaseComponent.registerDataChanged()
Forces periodic reading of the subscribed attribute in order to show get new points even if no events are received. It will create fake events as needed with the read value. Note that setting a period may yield unwanted results when the x axis is set to show event numbers (xIsTime==False)since there is no way of distinguishing the real from the fake events.
Parameters: | msec (:class:~`int`) – period in milliseconds. Use msec<0 to stop the forced periodic reading |
---|
sets the maximum number of events that are stored in the internal buffers of the trend. Note that this sets the maximum amount of memory used by the data in this trend set to:
~(1+ntrends)*2*8*maxSize bytes
(the data is stored as float64, and two copies of it are kept: one at the x and y buffers and another at the QwtPlotCurve.data)
Parameters: | maxSize (:class:~`int`) – the maximum limit |
---|
Sets the title text of the trends this trendset. The name will be constructed by appending “[%i]” to the basetitle, where %i is the index position of the trend in the trendset. As a particular case, nothing is appended if the trendset consists of only one trend.
Parameters: | basetitle (:class:~`str`) – The title text to use as a base for constructing the title of each trend belonging to this trendset. It may contain placeholders as those used in TaurusCurve.setTitleText() |
---|
See also
see TaurusBaseComponent.unregisterDataChanged()