taurus taurus

Previous topic

TaurusArrayEditor

Next topic

TaurusCurveMarker

This Page

TaurusCurve

Inheritance diagram of TaurusCurve

class TaurusCurve(name, xname=None, parent=None, rawData=None, optimized=False)

Bases: PyQt4.Qwt5.Qwt.QwtPlotCurve, taurus.qt.qtgui.base.taurusbase.TaurusBaseComponent

Taurus-enabled custom version of QwtPlotCurve.

TaurusCurves are attached to TaurusPlot objects for displaying 1D data sets.

A TaurusCurve is more complex than simple QwtPlotCurve in that:

  • It is taurus-aware (i.e., it is associated to a taurus model (an attribute) and listens to Taurus events to update its data
  • They may have an associated TaurusXValues object that controls the values for its abscissas.
  • It uses a CurveAppearanceProperties object to manage how it looks

Important:

The TaurusPlot is in charge of attaching and detaching its TaurusCurves, and keeps information about which TaurusCurves are attached. Therefore the programmer should never attach/detach a TaurusCurve manually.

attachMarkers(plot)

attach markers to the plot

Parameters:plot – the plot (typically, the TaurusPlot instance)
attachMaxMarker(plot)

attach marker of max value to the plot

Parameters:plot – the plot (typically, the TaurusPlot instance)
attachMinMarker(plot)

attach markers of min value to the plot

Parameters:plot – the plot (typically, the TaurusPlot instance)
compileTitleText(titletext)

Substitutes the known placeholders by the current equivalent values for a titleText.

Note: Some placeholders may not make sense for certain curves (e.g. <label> for a RawData curve). In these cases, they are left unprocessed (without warning).

Parameters:titletext (:class:~`str`) –

A string which can contain any of the following predefined placeholders:

  • <label> the attribute label (default)
  • <model> the model name
  • <attr_name> attribute name
  • <attr_fullname> full attribute name (for backwards compatibility, <attr_full_name> is also accepted)
  • <dev_alias> device alias
  • <dev_name> device name
  • <dev_fullname> full device name (for backwards compatibility, <dev_full_name> is also accepted)
  • <current_title> The current title
Return type::class:~`str`
Returns:a title string where the placeholders have been substituted by their corresponding values
detach()

reimplemented from QwtPlotCurve. In addition to dettaching the curve, it dettaches the associated min/max markers.

detachMarkers()

detaches the min/max markers of this curve

detachMaxMarker()

detaches the max marker of this curve

detachMinMarker()

detaches the min marker of this curve

getAppearanceProperties()

Returns the appearance properties of the curve (color, symbol, width,...).

Return type::class:~`CurveAppearanceProperties`
Returns:
getCurveName()

Returns the name of the curve (in the case of non RawDataCurves, it is the same as the model name)

Return type::class:~`str`
Returns:
getModelClass()

See TaurusBaseComponent.getModelClass()

getParentTaurusComponent()

Searches the closest ancestor (in the Qt parenting hyerarchy) that is which inherits from TaurusBaseComponent. It returns None if None found.

Return type::class:~`widget` or :class:~`None`
Returns:
getRawData()

Returns the rawData

Return type::class:~`dict` or :class:~`None`
Returns:a RawData dict or None if the curve is not RawData
getSignaller()

See TaurusBaseComponent.getSignaller()

getXValues()

Returns X values using the XValuesBuilder.

Return type::class:~`sequence`
Returns:
getYAxisStatus()

returns either None (if the curve is not visible) or its yAxis (if it is visible)

Return type::class:~`Qwt5.QwtPlot.Axis` or :class:~`None`
Returns:
handleEvent(src, evt_type, val)

Handles Taurus Events for this curve

See: TaurusBaseComponent.handleEvent()

isFilteredWhenLog()

returns True if non-possitive values are being discarded when plotting in log mode.

return: (bool)

isReadOnly()

see TaurusBaseComponent.isReadOnly()

registerDataChanged(listener, meth)

registers a listener to the DataChangedSignal of this curve

Parameters:
  • listener (:class:~`QWidget`) – listener object
  • meth (:class:~`callable`) – callback method
safeSetData()

Calls setData with x= self._xValues and y=self._yValues

See also

setData()

setAppearanceProperties(prop)

Applies the given CurveAppearanceProperties object (prop) to the curve. If a given property is set to None, it is not applied

Parameters:prop (:class:~`CurveAppearanceProperties`) –
setData(x, y)

Sets the X and Y data for the curve (possibly filtering non-possitive values if in log mode). Reimplemented from Qwt5.QwtPlotCurve.setData.

Parameters:
  • x (:class:~`sequence`) – X values
  • y (:class:~`sequence`) – Y values
setFilteredWhenLog(filtered=True)

Set whether non-possitive values should be discarded or not when plotting in log mode.

Parameters:filtered (:class:~`bool`) – if True, filtering is done
setPaused(paused=True)

Pauses itself and other listeners depending on it

See also

TaurusBaseComponent.setPaused()

setTitleText(titletext)

Sets the title text for this curve.

Parameters:titletext (:class:~`str`) – A string which can contain predefined placeholders (which make sense in the case of non-rawdata curves)

See Also : compileTitleText

setXValuesBuilder(fn=None)

Sets the callback to be used for creating the ‘X’ array values for a curve. If None given, the default is that the abscissas are int indexes (from 0 to len(Y)).

Parameters:fn (:class:~`callable`) – a callable that gets the Y values as a parameter and returns X values

E.g., the default:

curve.setXValuesBuilder()

is equivalent to:

curve.setXValuesBuilder(lambda yVals: numpy.arange(len(yVals)))
setXYFromModel(value)

sets the X (self._xValues) and Y (self._yValues) values from the given model. This method can be reimplemented by subclasses of Taurusplot that behave differently (e.g. TaurusTrend)

Parameters:value (:class:~`PyTango.DeviceAttribute`) – the value object from the model
setYAxis(axis)

changes the Y axis to which the curve is associated

Parameters:axis (:class:~`Qwt5.QwtPlot.Axis`) – the axis to which it should associate
showMaxPeak(show)

Specififes if we want to show or not the max peak of the curve

Parameters:show (:class:~`bool`) –
showMinPeak(show)

Specififes if we want to show or not the min peak of the curve.

Parameters:show (:class:~`bool`) –
titleText(compiled=False)

Returns the titleText string. If compiled == True, the returned string will be processed through compileTitleText

Parameters:compiled (:class:~`bool`) – Whether to process the return value or not (default is compiled=False)
Return type::class:~`basestring`
Returns:the title
unregisterDataChanged(listener, meth)

unregisters the given listener and method from the DataChangedSignal of this curve

Parameters:
  • listener (:class:~`QWidget`) – listener object
  • meth (:class:~`callable`) – callback method
updateTitle()

Updates the title of the curve, according to the titleText property