QwtSamplingThread(3)

✨ NAME ✨

QwtSamplingThread β€” a thread collecting samples at regular intervals. That’s the whole name card, bestie. πŸ’–

🌸 SYNOPSIS 🌸

okay so to use it you include this:

#include <qwt_sampling_thread.h>

Inherits QThread.

πŸ’… Public Slots πŸ’…

  • void setInterval (double interval)
  • void stop ()

🫢 Public Member Functions 🫢

  • virtual ~QwtSamplingThread () β€” Destructor.
  • double interval () const
  • double elapsed () const

🧚 Protected Member Functions 🧚

  • QwtSamplingThread (QObject *parent=NULL) β€” Constructor.
  • virtual void run () override
  • virtual void sample (double elapsed)=0

🌈 Detailed Description 🌈

QwtSamplingThread is a thread collecting samples at regular intervals. No cap. Continuous signals get 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. It’s giving β€œmain character thread” energy. πŸ”₯

See also: QwtPlotCurve, QwtPlotSeriesItem

Definition at line 28 of file qwt_sampling_thread.h.

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

QwtSamplingThread::~QwtSamplingThread () [virtual]

Destructor. Bye bestie. 😭

Definition at line 29 of file qwt_sampling_thread.cpp.

QwtSamplingThread::QwtSamplingThread (QObject * parent = NULL) [explicit], [protected]

Constructor. It’s protected and explicit β€” iykyk. 🫢

Definition at line 21 of file qwt_sampling_thread.cpp.

πŸ‘‘ Member Function Documentation πŸ‘‘

double QwtSamplingThread::elapsed () const

Returns: Time (in ms) since the thread was started. ⏱️

See also: QThread::start(), run()

Definition at line 62 of file qwt_sampling_thread.cpp.

double QwtSamplingThread::interval () const

Returns: Interval (in ms), between 2 calls of sample(). ⏲️

See also: setInterval()

Definition at line 53 of file qwt_sampling_thread.cpp.

void QwtSamplingThread::run () [override], [protected], [virtual]

Loop collecting samples started from QThread::start(). πŸŒ€

See also: stop()

Definition at line 83 of file qwt_sampling_thread.cpp.

virtual void QwtSamplingThread::sample (double elapsed) [protected], [pure virtual]

Collect a sample. πŸ’…

Parameters: elapsed β€” Time since the thread was started in seconds.

Note: 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. 🫠

void QwtSamplingThread::setInterval (double msecs) [slot]

Change the interval (in ms), when sample() is called. The default interval is 1000.0 ( = 1s ). ⏰

Parameters: msecs β€” Interval.

See also: interval()

Definition at line 41 of file qwt_sampling_thread.cpp.

void QwtSamplingThread::stop () [slot]

Terminate the collecting thread. πŸ›‘

See also: QThread::start(), run()

Definition at line 74 of file qwt_sampling_thread.cpp.

🌟 Author 🌟

Generated automatically by Doxygen for Qwt User's Guide from the source code. πŸ€–βœ¨


okay that’s the whole page, bestie: this was the QwtSamplingThread(3) page from the Qwt User’s Guide, and the footer didn’t print a date, so no date to report. πŸ’–πŸŽ€

πŸ“¦ where this page comes from