08-12-2006 02:39 PM
08-13-2006 08:30 AM
I have attached a VI to select a portion of a wave.
Drag either cursor and it drags the "window", but keeps the duration constant.
Hold down SHIFT, and it drags only the one side, changing the duration.
Unfortunately, it's Windows only, because it uses the INPUT DEVICES functions.
If you do it with normal key-down events, it will miss a key-down or key-up even WHILE you're dragging the mouse.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-14-2006 12:52 PM
08-14-2006 01:17 PM
If you move the START past the END, your program gets confused. I suspect it's the control itself which is confused.
Anyway, thanks for more ideas.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-14-2006 01:44 PM
Right, the slider method is a little clunky (I'm not crazy about my method which is why I posted in the first place); probably there is a way to make sure end limit (slide) cannot go lower than start limit (slide). I will look at adding that code and re-posting. I think eventually Mike's VI will make its way to this discussion as well. In his method he showed at NI week, there was no cursor visible but I assume somehow he was doing it with cursors. The only thing you saw was the overlay window and he would mouse on that and move the window.
Don
08-14-2006 01:57 PM
Could you stretch and shrink it too?
I suppose you could do it by brute force, detecting clicks on a decoration or something on top of the graph, and moving / stretching / shrinking the decoration when the mouse moves. That's a lot of work, and you'd have to do a lot of coordinate transformation to get real data-coordinates out of it.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-14-2006 02:02 PM
It uses a MODIFIED copy of the standard PLOT WAVEFORM vi, modified only to bring out the SCALE FACTORS so I can use them later.
It's not very pretty.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-14-2006 02:16 PM
08-14-2006 02:34 PM
This version does some limit checking on the sliders so the end slider cannot be less than the start slider. It also now uses a 'value change' event rather than 'mouse up' event so that the overlay on the graph now slides while moving, shortening, or expanding. It may be in its optimized state right now so at this point, probably time to wait for Michael to post.
Don
08-14-2006 02:50 PM