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.
attach markers to the plot
Parameters: | plot – the plot (typically, the TaurusPlot instance) |
---|
attach marker of max value to the plot
Parameters: | plot – the plot (typically, the TaurusPlot instance) |
---|
attach markers of min value to the plot
Parameters: | plot – the plot (typically, the TaurusPlot instance) |
---|
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:
|
---|---|
Return type: | :class:~`str` |
Returns: | a title string where the placeholders have been substituted by their corresponding values |
reimplemented from QwtPlotCurve. In addition to dettaching the curve, it dettaches the associated min/max markers.
detaches the min/max markers of this curve
detaches the max marker of this curve
detaches the min marker of this curve
Returns the appearance properties of the curve (color, symbol, width,...).
Return type: | :class:~`CurveAppearanceProperties` |
---|---|
Returns: |
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: |
See TaurusBaseComponent.getModelClass()
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: |
Returns the rawData
Return type: | :class:~`dict` or :class:~`None` |
---|---|
Returns: | a RawData dict or None if the curve is not RawData |
See also
See TaurusBaseComponent.getSignaller()
returns a dict containing several descriptive statistics of a region of the curve defined by the limits given by the keyword arguments. It also contains a copy of the data in the considered region. The keys of the returned dictionary correspond to:
-‘x’ : the abscissas for the considered points (numpy.array) -‘y’ : the ordinates for the considered points (numpy.array) -‘points’: number of considered points (int) -‘min’ : (x,y) pair of the minimum of the curve (float,float) -‘max’ : (x,y) pair of the maximum of the curve (float,float) -‘mean’ : arithmetic average of y (float) -‘std’ : (biased)standard deviation of y (float) -‘rms’ : root mean square of y (float)
Note that some of the values may be None if that cannot be computed.
Also,
Parameters: |
|
---|---|
Return type: | :class:~`dict` |
Returns: | A dict containing the stats. |
Returns X values using the XValuesBuilder.
Return type: | :class:~`sequence` |
---|---|
Returns: |
See also
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: |
Handles Taurus Events for this curve
See: TaurusBaseComponent.handleEvent()
returns True if non-possitive values are being discarded when plotting in log mode.
return: (bool)
See also
see TaurusBaseComponent.isReadOnly()
registers a listener to the DataChangedSignal of this curve
Parameters: |
|
---|
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`) – |
---|
Sets the X and Y data for the curve (possibly filtering non-possitive values if in log mode). Reimplemented from Qwt5.QwtPlotCurve.setData.
Parameters: |
|
---|
See also
Set whether non-possitive values should be discarded or not when plotting in log mode.
Parameters: | filtered (:class:~`bool`) – if True, filtering is done |
---|
Pauses itself and other listeners depending on it
See also
TaurusBaseComponent.setPaused()
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
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)))
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 |
---|
changes the Y axis to which the curve is associated
Parameters: | axis (:class:~`Qwt5.QwtPlot.Axis`) – the axis to which it should associate |
---|
Specififes if we want to show or not the max peak of the curve
Parameters: | show (:class:~`bool`) – |
---|
Specififes if we want to show or not the min peak of the curve.
Parameters: | show (:class:~`bool`) – |
---|
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 |
See also
unregisters the given listener and method from the DataChangedSignal of this curve
Parameters: |
|
---|
Updates the title of the curve, according to the titleText property