tau tau

Previous topic

TauTimeScale

Next topic

TauTrendsSet

This Page

TauTrend

Inheritance diagram of TauTrend

class TauTrend(parent=None, designMode=False)

A TauPlot -derived widget specialised in plotting trends (i.e., evolution of parameters).

../../../../../_images/tautrend01.png

TauTrend inherits all the features from TauPlot (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 TauTrend User’s Interface Guide.

You can also see some code that exemplifies the use of TauTrend in the TauTrend coding examples

Note: if you pass a model that is a Tango SPECTRUM attribute (instead of a scalar), TauTrend will interpret it as a collection of scalar values and will plot a separate trend line for each.

applyConfig(configdict, **kwargs)

applies the settings stored in a configdict to the current plot.

Parameter:configdict (dict) –

See also

createConfig()

changeCurvesTitlesDialog(curveNamesList=None)

Shows a dialog to set the curves titles (it will change the current curves titles and the default curves titles)

Parameter:curveNamesList (string_sequence or 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:caselessDict <str, QString> or 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()

createConfig(names=None)

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(tauplot.createConfig())  #c is a string that can be stored
Parameter:names (sequence <str>) – a sequence of TrendSet names for which the configuration will be stored (all by default).
Return type:dict
Returns:configurations (which can be loaded with applyConfig)
curveDataChanged(name)

slot that is called whenever a curve emits a dataChanged signal

Emits:“dataChanged(const QString &)”
Parameter:name (str) – curve name
getMaxDataBufferSize()

returns the maximum number of events that can be plotted in the trend

Return type:int
Returns:
getTrendSet(name)

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 TauTrend.curves_lock reentrant lock.

Parameter:name (str) – the trend set name
Return type:TauTrendSet
Returns:the trend set object corresponding to name
getTrendSetNames()

returns the names of all TrendSets attached to this TauTrend.

Return type:list <str>
Returns:a copy of self.trendSets.keys()
getUseArchiving()

whether TauTrend is looking for data in the archiver when needed

Return type:bool
Returns:
maxDataBufferSize
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None
designable=True, scriptable=True, stored=True, user=False) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties.

resetMaxDataBufferSize()
Same as setUseArchiving(1048576) (i.e. 1M of events)
resetUseArchiving()
Same as setUseArchiving(True)
setEventFilters(filters=None, tsetnames=None)
propagates a list of tau filters to the curves given by curvenames. See TauBaseComponent.setEventFilters()
setMaxDataBufferSize(maxSize)

sets the maximum number of events that can be plotted in the trends

Parameter:maxSize (int) – the maximum limit

See also

TauTrendSet.setMaxDataBufferSize()

setPaused(paused=True)

Pauses itself and other listeners (e.g. the trendsets) depending on it

See also

TauBaseComponent.setPaused()

setTrendSetsTitles(basetitle, setNames=None)

Calls setTitleText(basetitle) for each Trend Set set in setNames

Parameters:
  • basetitle (str) – the base title
  • setNames (sequence <str> or iterator <str>) – names of the sets to be changed

See: TauTrendsSet.setTitleText

setUseArchiving(enable)

enables/disables looking up in the archiver for data stored before the Trend was started

Parameter:enable (bool) – if True, archiving values will be used if available
updateCurves(names)

Defines the curves that need to be plotted. For a TauTrend, the models can refer to:

  • PyTango.SCALARS: they are to be plotted in a trend
  • PyTango.SPECTRUM: each element of the spectrum is considered independently as in a)

Note that passing an attribute for X values makes no sense in this case

Internally, every curve is grouped in a TauTrendSet. 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.

Parameter:names (sequence <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.

useArchiving
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None
designable=True, scriptable=True, stored=True, user=False) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties.