LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about decimation and zoom in graphs

I am currently developing an application in which the size of the signals I have to display in different graphs is quite large (8 Mbs of DBLs, for example). I was thinking about reducing the amount of memory used when I found a document at National Instruments Developer Zone (http://zone.ni.com/devzone/conceptd.nsf/webmain/6A56C174EABA7BBD86256E58005D9712?opendocument), and inside that paper there was a paragrpah, "Fast Data Display with Decimation", that was perfectly suitable to me.

However, there is a drawback. If the user uses the zoom tools inside the Graph Palette to enlarge the decimated signal, and I do not take care of that situation in some way, doing so will result in an incorrect view since he will not be worki
ng with the original signal. Through events I am not able to know when the user has specifically zoomed the signal, not only touched the graph, so here are the questions: does anyone know a way to detect when the user has used the Graph Palette or the other items of the Waveform graph as the Scale Legend, for example? In general, is there a way that you can reduce the amount of points showed in a graph and still work with zooming tools without problems?

Thanks in advance and have a nice day,

spj
0 Kudos
Message 1 of 5
(3,032 Views)
when the graph is zoomed in or out, the minimum and maximum scale of the graph are changed. Monitor these values would give you a rough idea how to subset data (need to know the decimation rate and the x-scale multiplier value) from the original signal (assume the original data is still there!) when the zoom level changes.

-Joe
0 Kudos
Message 2 of 5
(3,032 Views)
The things you say in your comment are right. In fact, that was what I had to do to fix the problem. Let me explain myself a little further.

I needed to reduce the memory, so I decimated the signal. To take care of the zoom bussiness, in my Diagram Block I put an event case to warn me when the mouse left the graph in order to do exactly what you have mentioned: with the original signal and the new limits, being aware of the x-multiplier, re-decimate the signal if necessary.

But that is when my problem arises. I am not able to distinguish when the user is really zooming the signal or merely touching the graph, without zooming anything. Now you can see the reason of my questions.

Thanks for your interest, Joe, and have a nice day,

spj
0 Kudos
Message 3 of 5
(3,032 Views)
In such case I normally do not monitor the mouse event using event structure. I compare the old and new values of the x-scale maximum and minimum value. If you are using event case, then it is likely going to be inside the timeout event (yep, don't forget wiring the timeout value). This way even if user zoomed in by adjusting the scale manually (without using mouse), the changes are still being monitored.

-Joe
0 Kudos
Message 4 of 5
(3,032 Views)
As it is often said, the best solution is the simplest solution. I was so focused on events that I did not think about the old comparing method.

Thanks for your tip, Joe, and have a nice week.

spj
0 Kudos
Message 5 of 5
(3,032 Views)