QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 槽 | Public 成员函数 | Protected 成员函数 | 所有成员列表
QwtSamplingThread类 参考abstract

A thread collecting samples at regular intervals. 更多...

#include <qwt_sampling_thread.h>

类 QwtSamplingThread 继承关系图:

class  PrivateData
 

Public 槽

void setInterval (double interval)
 Change the interval (in ms), when sample() is called.
 
void stop ()
 Terminate the collecting thread
 

Public 成员函数

double interval () const
 Get the interval (in ms), between 2 calls of sample()
 
double elapsed () const
 Get the time (in ms) since the thread was started
 

Protected 成员函数

 QwtSamplingThread (QObject *parent=nullptr)
 Constructor
 
virtual void run () override
 Run the thread
 
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.

参见
QwtPlotCurve, QwtPlotSeriesItem

构造及析构函数说明

◆ QwtSamplingThread()

QwtSamplingThread::QwtSamplingThread ( QObject *  parent = nullptr)
explicitprotected

Constructor

参数
parentParent object

Destructor

成员函数说明

◆ elapsed()

double QwtSamplingThread::elapsed ( ) const

Get the time (in ms) since the thread was started

返回
Elapsed time in milliseconds
参见
QThread::start(), run()

◆ interval()

double QwtSamplingThread::interval ( ) const

Get the interval (in ms), between 2 calls of sample()

返回
Interval in milliseconds
参见
setInterval()

◆ run()

void QwtSamplingThread::run ( )
overrideprotectedvirtual

Run the thread

Loop collecting samples started from QThread::start()

参见
stop()

◆ sample()

virtual void QwtSamplingThread::sample ( double  elapsed)
protectedpure virtual

Collect a sample

参数
elapsedTime since the thread was started in seconds
注解
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 )

参数
msecsInterval
参见
interval()

◆ stop

void QwtSamplingThread::stop ( )
slot

Terminate the collecting thread

参见
QThread::start(), run()

该类的文档由以下文件生成: