Overloading QwtPlot replot() to replot every 100 msec
Hi,
I am using QwtPlot to display large amounts of data, that comes in fas (every 1 msec). I decided i will not be refreshing the plot every time data new data comes and will rather do it every 100 msec. So I'm using a QTimer that times out every 100msec. When that happens QwtPlot::replot() is called.
Code:
void EWOSubPlot2D::replotTimerTimeout() {
lock_guard<mutex> replotLock(replotMutex);
if (replotFlag) {
replotFlag = false;
}
}
void EWOSubPlot2D::replot() {
lock_guard<mutex> replotLock(replotMutex);
replotFlag = true;
}
I am using a zoomer, magnifier and a panner.
When I overload replot() method like shown above, zommer does not draw rectangles as i draw them and
when i press keyboard combination for zoom out, axis labels are not displayed yet. It seems to me that QwtPlot::replot() does other things than just replotting, so it cant be "put in queue" and executed later?
I'm using Qwt 6.1.2
BR, f0orz4h
Re: Overloading QwtPlot replot() to replot every 100 msec
I see that no response to my question has been made yet, while some other questions have been responded to. Have I not been clear enough with the question or is there something else?
I would really apreciate help for my problem.
br, f0orz4h
Re: Overloading QwtPlot replot() to replot every 100 msec
You can use QTimer to call QwtPlot::replot() every 100ms. See documentation of QTimer
Re: Overloading QwtPlot replot() to replot every 100 msec
I am using QTimer to do that. But if im reploting only once per 100ms zoomer rectangle does not draw itself, nor zooming applies when mouse is released. And also axis labels are not displayed when zoomed out
Re: Overloading QwtPlot replot() to replot every 100 msec
Zooming is nothing else, than selecting axes ranges interactively and then setting them with setAxisScale. When changing the axis at the same time every 100ms you probably revert it.
Uwe
Re: Overloading QwtPlot replot() to replot every 100 msec
Quote:
Originally Posted by
Uwe
When changing the axis at the same time every 100ms you probably revert it.
Uwe
Im not sure I understand what you are saying. Basically the only modification from the working code is only that Qwt::replot() is called in callback function on timer timeout. I really don't understand the symptoms.