问题描述:

hello every one i want to ask that how can i plot a moving graph using qwt as i am new to qwt so i dont have any idea

like i want a curve. my data is continuously coming. that is i want two adjacent points to gradually join by curved line hope you people understands what i am trying to say

is there any way to do this

kindly help me i will be very thank full to you people

网友答案:

Create a timer with 50ms period (25Hz frequency) and update the plot data on timers timeout signal.

EDIT: I looked at the QwtPlot closer. I assume that you use it with QwtPlotCurve. I think you can use its SetRawData method and every 50 miliseconds (or longer, depends on what you need) update your data arrays, then replot your graph with the replot method. Don't know if you have to invoke SetRawData on every update, according to Set Data description, you don't.

Or you can use AutoReplot. If you enable it with QwtPlot::setAutoReplot, invoking QwtPlotCurve::SetData with new data set should replot it automatically.

相关阅读:
Top