A thread collecting samples at regular intervals.
更多...
#include <qwt_sampling_thread.h>
|
| 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
|
| |
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
- 参数
-
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 |
◆ 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
- 参数
-
| elapsed | Time 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 )
- 参数
-
- 参见
- interval()
◆ stop
| void QwtSamplingThread::stop |
( |
| ) |
|
|
slot |
Terminate the collecting thread
- 参见
- QThread::start(), run()
该类的文档由以下文件生成:
- /home/runner/work/QWT/QWT/src/plot/qwt_sampling_thread.h
- /home/runner/work/QWT/QWT/src/plot/qwt_sampling_thread.cpp