Bases: taurus.qt.qtgui.plot.taurusplot.TaurusPlot
A TaurusPlot -derived widget specialised in plotting trends (i.e., evolution of parameters).
TaurusTrend inherits all the features from TaurusPlot (zooming, exporting/importing, data inspection,...) and also provides some specific features (e.g. fixed-range X scale mode and Archiving support).
For an overview of the features from an user point of view, see the TaurusTrend User’s Interface Guide.
You can also see some code that exemplifies the use of TaurusTrend in the TaurusTrend coding examples
Note: if you pass a model that is a Tango SPECTRUM attribute (instead of a scalar), TaurusTrend will interpret it as a collection of scalar values and will plot a separate trend line for each.
Note 2: As an special case, you can pass a model of the type scan://doorname. This will link the TaurusTrend to the given Taurus door and will listen to it for scan record events, which will be plotted.
applies the settings stored in a configdict to the current plot.
Parameters: | configdict (:class:~`dict`) – |
---|
See also
Shows a dialog to set the curves titles (it will change the current curves titles and the default curves titles)
Parameters: | curveNamesList (:class:~`string_sequence` or :class:~`string_iterator`) – names of the curves to which the title will be changed (if None given , it will apply to all the TrendsSets and it will also be used as default for newly created ones) |
---|---|
Return type: | :class:~`caselessDict` <:class:~`str`, :class:~`QString`> or :class:~`None` |
Returns: | The return value will be None if curveNamesList is None. Otherwise it will be a dictionary with key=curvename and value=newtitle. |
See also
setCurvesTitle(), setDefaultCurvesTitle()
clears the buffers of existing trend sets (note that this does not remove the models, it simply removes all stored data)
resets the curves associated to the given scan
Parameters: | scanname (:class:~`str`) – the scan model name (e.g. “scan://a/b/c”) |
---|
Returns a pickable dictionary containing all relevant information about the current plot. For Tango attributes it stores the attribute name and the curve properties For raw data curves, it stores the data as well.
Hint: The following code allows you to serialize the configuration dictionary as a string (which you can store as a QSetting, or as a Tango Attribute):
import pickle
c = pickle.dumps(taurusplot.createConfig()) #c is a string that can be stored
Parameters: | names (:class:~`sequence` <:class:~`str`>) – a sequence of TrendSet names for which the configuration will be stored (all by default). |
---|---|
Return type: | :class:~`dict` |
Returns: | configurations (which can be loaded with applyConfig) |
slot that is called whenever a curve emits a dataChanged signal
Emits: | “dataChanged(const QString &)” |
---|---|
Parameters: | name (:class:~`str`) – curve name |
calls replot() only if there is new data to be plotted
returns the forced reading period for the given trend (or the general period if None is given)
Parameters: | tsetname (:class:~`str` or :class:~`None`) – name of the trend set for which the forced reading should be returned. If None passed, the default period for all curves is returned |
---|
reimplemented from TaurusPlot. Returns the title of a curve from a trendset
Parameters: |
|
---|---|
Return type: | :class:~`str` |
Returns: | the title |
returns the forced reading period for the given trend (or the general period if None is given)
Parameters: | tsetname (:class:~`str` or :class:~`None`) – name of the trend set for which the forced reading should be returned. If None passed, the default period for all curves is returned |
---|
returns the maximum number of events that can be plotted in the trend
Return type: | :class:~`int` |
---|---|
Returns: |
Returns pertinent information in order to be able to build a valid QtDesigner widget plugin
Return type: | :class:~`dict` |
---|---|
Returns: | a map with pertinent designer information |
returns the value of the scroll step
Return type: | :class:~`float` |
---|---|
Returns: |
gets a trend set object by name.
Important: Note that the TrendSet object is not thread safe. Therefore, if you access it you must do it protected by the TaurusTrend.curves_lock reentrant lock.
Parameters: | name (:class:~`str`) – the trend set name |
---|---|
Return type: | :class:~`TaurusTrendSet` |
Returns: | the trend set object corresponding to name |
returns the names of all TrendSets attached to this TaurusTrend.
Return type: | :class:~`list` <:class:~`str`> |
---|---|
Returns: | a copy of self.trendSets.keys() |
whether TaurusTrend is looking for data in the archiver when needed
Return type: | :class:~`bool` |
---|---|
Returns: |
See also
whether TaurusTrend is looking for data in the PollingBuffer
Return type: | :class:~`bool` |
---|---|
Returns: |
See also
reimplemented from TaurusPlot.showEvent() so that the replot timer is active only when needed
checks if it makes sense to activate the replot timer. The following conditions must be met:
Parameters: | checkMinimized (:class:~`bool`) – whether to include the check of minimized (True by default) |
---|---|
Return type: | :class:~`bool` |
Returns: |
returns the maximum number of events that can be plotted in the trend
Return type: | :class:~`int` |
---|---|
Returns: |
calculates the replotting frequency based on the time axis range. It assumes that it is unnecessary to replot with a period less than the time per pixel.
Parameters: |
|
---|
Equivalent to setForcedReadingPeriod(msec=-1, tsetnames=None)
Same as setMaxDataBufferSize(self.DEFAULT_MAX_BUFFER_SIZE)
equivalent to setScrollStep(0.2)
Same as setUseArchiving(True)
Same as setUsePollingBuffer(True)
reimplemented from TaurusPlot.resizeEvent() so that the replot timer is active only when needed
returns the value of the scroll step
Return type: | :class:~`float` |
---|---|
Returns: |
propagates a list of taurus filters to the trendsets given by tsetnames. See TaurusBaseComponent.setEventFilters()
Sets the forced reading period for the trend sets given by tsetnames.
Parameters: |
|
---|
sets the maximum number of events that can be plotted in the trends
Parameters: | maxSize (:class:~`int` or :class:~`None`) – the maximum limit. If None is passed, the user is prompted for a value. |
---|
See also
TaurusTrendSet.setMaxDataBufferSize()
Pauses itself and other listeners (e.g. the trendsets) depending on it
See also
TaurusBaseComponent.setPaused()
sets the door to which TaurusTrend will listen for scans. This removes any previous scan set using this method, but respects scans set with setModel
sets whether the trend sets associated to scans should be reset every time a data_desc packet is received from the door.
Parameters: | enable (:class:~`bool`) – |
---|
See also
Note
This method is deprecated. Please use setScansXDataKey() instead
sets whether the trend sets associated to scans should use the point number from the data record for the abscissas (default).
Parameters: | enable (:class:~`bool`) – |
---|
selects the source for the data to be used as abscissas in the scan plot.
Parameters: |
|
---|
See also
the constructor of ScanTrendsSet
Sets the scroll step when in Dynamic X mode. This is used to avoid excessive replotting, which may be a problem when plotting a lot of points.
Parameters: | scrollStep (:class:~`float`) – portion of the current range that will be added when scrolling. For example, 0.1 means that 10% of the current range will be added when scrolling. A value of 0 means that no extra space will be added (thus the scroll is not in “steps”). Large scroll steps mean rough scrolls, but also less CPU usage. |
---|
See also
setXDynScale()
Calls setTitleText(basetitle) for each Trend Set set in setNames
Parameters: |
|
---|
See: TaurusTrendsSet.setTitleText
enables/disables looking up in the archiver for data stored before the Trend was started
Parameters: | enable (:class:~`bool`) – if True, archiving values will be used if available |
---|
enables/disables looking up in the PollingBuffer for data
Parameters: | enable (:class:~`bool`) – if True, PollingBuffer values will be used if available |
---|
Reimplemented from TaurusPlot.setXIsTime()
shows a dialog warning of the potential isuues with archiving performance. It offers the user to disable archiving retrieval
reimplemented from TaurusPlot.showEvent() so that the replot timer is active only when needed
Defines the curves that need to be plotted. For a TaurusTrend, the models can refer to:
Note that passing an attribute for X values makes no sense in this case
Internally, every curve is grouped in a TaurusTrendSet. For each SPECTRUM attribute, a TrendSet is created, containing as many curves as the lenght of the spectrum For eacha SCALAR attribute, a TrendSet containing just one curve is created.
Parameters: | names (:class:~`sequence` <:class:~`str`>) – a sequence of model names |
---|
Note
Adding/removing a model will add/remove a whole set. No sub-set adding/removing is allowed. Still, each curve will be independent regarding its properties, and can be hidden/shown independently.
See also
whether TaurusTrend is looking for data in the archiver when needed
Return type: | :class:~`bool` |
---|---|
Returns: |
See also
whether TaurusTrend is looking for data in the PollingBuffer
Return type: | :class:~`bool` |
---|---|
Returns: |
See also