SYNOPSIS

#include <qwt_sampling_thread.h>

Public Slots

void setInterval (double interval)

void stop ()

Public Member Functions

virtual ~QwtSamplingThread ()

double interval () const

double elapsed () const

Protected Member Functions

QwtSamplingThread (QObject *parent=NULL)

virtual void run ()

virtual void sample (double elapsed)=0

Detailed Description

A thread collecting samples at regular intervals.

Contiounous 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 perodically sample(), to collect and store ( or emit ) a single sample.

See also:

QwtPlotCurve, QwtPlotSeriesItem

Constructor & Destructor Documentation

QwtSamplingThread::~QwtSamplingThread ()\fC [virtual]\fP

Destructor.

QwtSamplingThread::QwtSamplingThread (QObject *parent = \fCNULL\fP)\fC [explicit, protected]\fP

Constructor.

Member Function Documentation

double QwtSamplingThread::elapsed () const \fBReturns:\fP

Time (in ms) since the thread was started

See also:

QThread::start(), run()

double QwtSamplingThread::interval () const \fBReturns:\fP

Interval (in ms), between 2 calls of sample()

See also:

setInterval()

void QwtSamplingThread::run ()\fC [protected, virtual]\fP Loop collecting samples started from QThread::start()

See also:

stop()

virtual void QwtSamplingThread::sample (doubleelapsed)\fC [protected, pure virtual]\fP Collect a sample

Parameters:

elapsed Time since the thread was started in miliseconds

void QwtSamplingThread::setInterval (doubleinterval)\fC [slot]\fP Change the interval (in ms), when \fBsample()\fP is called. The default interval is 1000.0 ( = 1s )

Parameters:

interval Interval

See also:

interval()

void QwtSamplingThread::stop ()\fC [slot]\fP Terminate the collecting thread

See also:

QThread::start(), run()

Author

Generated automatically by Doxygen for Qwt User's Guide from the source code.