A thread collecting samples at regular intervals. More...
#include <qwt_sampling_thread.h>
Classes | |
class | PrivateData |
Public Slots | |
void | setInterval (double interval) |
void | stop () |
Public Member Functions | |
double | elapsed () const |
double | interval () const |
virtual | ~QwtSamplingThread () |
Destructor. | |
Protected Member Functions | |
QwtSamplingThread (QObject *parent=NULL) | |
Constructor. | |
virtual void | run () |
virtual void | sample (double elapsed)=0 |
Private Attributes | |
PrivateData * | d_data |
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.
Definition at line 19 of file qwt_sampling_thread.h.
QwtSamplingThread::~QwtSamplingThread | ( | ) | [virtual] |
Destructor.
Definition at line 33 of file qwt_sampling_thread.cpp.
QwtSamplingThread::QwtSamplingThread | ( | QObject * | parent = NULL | ) | [explicit, protected] |
Constructor.
Definition at line 24 of file qwt_sampling_thread.cpp.
double QwtSamplingThread::elapsed | ( | ) | const |
Definition at line 66 of file qwt_sampling_thread.cpp.
double QwtSamplingThread::interval | ( | ) | const |
Definition at line 57 of file qwt_sampling_thread.cpp.
void QwtSamplingThread::run | ( | ) | [protected, virtual] |
Loop collecting samples started from QThread::start()
Definition at line 87 of file qwt_sampling_thread.cpp.
virtual void QwtSamplingThread::sample | ( | double | elapsed | ) | [protected, pure virtual] |
Collect a sample
elapsed | Time since the thread was started in milliseconds |
void QwtSamplingThread::setInterval | ( | double | interval | ) | [slot] |
Change the interval (in ms), when sample() is called. The default interval is 1000.0 ( = 1s )
interval | Interval |
Definition at line 45 of file qwt_sampling_thread.cpp.
void QwtSamplingThread::stop | ( | ) | [slot] |
Terminate the collecting thread
Definition at line 78 of file qwt_sampling_thread.cpp.
PrivateData* QwtSamplingThread::d_data [private] |
Definition at line 46 of file qwt_sampling_thread.h.