PDA

View Full Version : Bode example modification to enable zooming support for every range?



umituzun84
19th March 2010, 09:08
Hi All,

I want to enable zooming and panning for plotter which has to many realtime data so my range is not limited and as a result not static. I have looked bode, refreshtest and ossilascope examples in details. My plotter has 2 scrolling (control) type. Automatic and manual.

In automatic mode plotter plots my curve in QwtPlotDirectPainter like refreshtest or ossicaliton example. In manualscroll I give the control plotter. I can change scrolling mode between each other. So my zoombase need to be updated after I enter the manualscroll mode to achieve zooming in all range.

So I implement necessary d_zoomer[0]->setZoomBase(); slot by triggered panner's panned signal, so when I panned I update my zoom base so I can zoom current range. But there is a problem as you could see, every setZoomBase funtion clears zoom rectange stack, so my zooming stack disapper after panned. To deactivate this problem I add setMousePattern(QwtEventPattern::MouseSelect2, Qt::MidButton); pattern to zoomer. So I return zoom(0) before panned my canvas? I have implemented same mechanism for bode example, If there is no problem could you add this changing to svn Uwe? Because same problem existing in bode. When I panned my canvas out of 0, 100 range I can't zoom in or out(I mean I can zoom but there is nothing zoomed such as grid and other markers)? Or do you think how should I handle this situation?

I have attached necessary changing for bode example.
Thanks so much.
Regards.

Uwe
19th March 2010, 13:36
The basic design problem is, that there should be a navigation stack for a plot instead of a local stack inside the zoomer. Introducing such a thing is on my TODO list, but won't make it into Qwt 6.0. In the meantime you have to use QwtPlotZoomer::zoomStack() and QwtPlotZoomer::setZoomStack() if you want to add, remove or replace rectangles manually.

Uwe