QwtSamplingThread - A thread collecting samples at regular intervals.
Contents
Detailed Description
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.
Seealso:QwtPlotCurve, QwtPlotSeriesItemMember Function Documentation
doubleQwtSamplingThread::elapsed()constReturns:
Time (in ms) since the thread was started
Seealso:
QThread::start(), run()doubleQwtSamplingThread::interval()constReturns:
Interval (in ms), between 2 calls of sample()Seealso:setInterval()voidQwtSamplingThread::run()[protected],[virtual]
Loop collecting samples started from QThread::start()
Seealso:stop()virtualvoidQwtSamplingThread::sample(doubleelapsed)[protected],[purevirtual]
Collect a sample
Parameters:elapsed Time since the thread was started in milliseconds
voidQwtSamplingThread::setInterval(doubleinterval)[slot]
Change the interval (in ms), when sample() is called. The default interval is 1000.0 ( = 1s )
Parameters:interval Interval
Seealso:interval()voidQwtSamplingThread::stop()[slot]
Terminate the collecting thread
Seealso:
QThread::start(), run()Name
QwtSamplingThread - A thread collecting samples at regular intervals.
Synopsis
#include <qwt_sampling_thread.h>
Inherits QThread.
PublicSlots
void setInterval (double interval)
void stop ()
PublicMemberFunctions
virtual ~QwtSamplingThread ()
Destructor.
double interval () const
double elapsed () const
ProtectedMemberFunctionsQwtSamplingThread (QObject *parent=NULL)
Constructor.
virtual void run ()
virtual void sample (double elapsed)=0
