A thread collecting samples at regular intervals.
More...
#include <qwt_sampling_thread.h>
|
|
virtual | ~QwtSamplingThread () |
| | Destructor.
|
| |
| double | interval () const |
| |
| double | elapsed () const |
| |
|
|
| QwtSamplingThread (QObject *parent=NULL) |
| | Constructor.
|
| |
| virtual void | run () QWT_OVERRIDE |
| | Loop collecting samples started from QThread::start()
|
| |
| virtual void | sample (double elapsed)=0 |
| | Collect a sample.
|
| |
A thread collecting samples at regular intervals.
Continuous signals are converted into a discrete signal by collecting samples at regular intervals. A discrete signal can be displayed by a QwtPlotSeriesItem on a QwtPlot widget.
QwtSamplingThread starts a thread calling periodically sample(), to collect and store ( or emit ) a single sample.
- See also
- QwtPlotCurve, QwtPlotSeriesItem
◆ elapsed()
| double QwtSamplingThread::elapsed |
( |
| ) |
const |
- Returns
- Time (in ms) since the thread was started
- See also
- QThread::start(), run()
◆ interval()
| double QwtSamplingThread::interval |
( |
| ) |
const |
◆ run()
| void QwtSamplingThread::run |
( |
| ) |
|
|
protectedvirtual |
Loop collecting samples started from QThread::start()
- See also
- stop()
◆ sample()
| virtual void QwtSamplingThread::sample |
( |
double |
elapsed | ) |
|
|
protectedpure virtual |
Collect a sample.
- Parameters
-
| elapsed | Time since the thread was started in seconds |
- Note
- Due to a bug in previous version elapsed was passed as seconds instead of miliseconds. To avoid breaking existing code we stay with seconds for now.
◆ setInterval
| void QwtSamplingThread::setInterval |
( |
double |
msecs | ) |
|
|
slot |
Change the interval (in ms), when sample() is called.
The default interval is 1000.0 ( = 1s )
- Parameters
-
- See also
- interval()
◆ stop
| void QwtSamplingThread::stop |
( |
| ) |
|
|
slot |
Terminate the collecting thread.
- See also
- QThread::start(), run()
The documentation for this class was generated from the following files:
- /home/runner/work/QWT/QWT/src/qwt_sampling_thread.h
- /home/runner/work/QWT/QWT/src/qwt_sampling_thread.cpp