LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DBL Slider - prevent update until done sliding

Much like a string where you can right click it and enable "update value while typing," is there a way to do the opposite on a DBL slider where it doesn't update until you've released it?

0 Kudos
Message 1 of 30
(4,642 Views)

Not that I know of.  Under what conditions would you say you are done sliding?  After a certain amount of time has passed since the last slide?

 

But suppose you use the timeout event to your advantage.  Wire a timeout value the current value of the slider into a shift register.  Set the timeout of the event structure.  When the timeout event occurs, you know some time as passed.  Use the last value of the slider from the shift register to do what you want.  Wire a -1 to the shift register to disable the timeout event of the event structure (until the next slider value change event occurs.)

Message 2 of 30
(4,636 Views)

I'd say you're done sliding when you "release" the slider.  So I guess it'd be a mouse event.  But it's the same thing as any other number.  How does LabVIEW know you're done entering a number?  You click outside of the control or press 'enter' (assuming enabled).

 

And I see where you're going with your suggestion.  Unfortunately, not doable in this application.  Too far down the rabbit hole.

0 Kudos
Message 3 of 30
(4,629 Views)

Often it helps to limit the number of events to 1. This won't do what you're asking for, but might solve the same problem. Usually the problem is handling the events take some time, and his causes a lag. So you move the slider around, and the events are handled unil long after your done. Limit the number of events, and you won't get this problem.

 

You might be able to misuse the mouse up event. Set a Boolean to true in the value change event, and if the Boolean is true, do your handling when you get a mouse up and set the Boolean to false. The Boolean trick also works with the mentioned time out event, if you need to handle more then one slider.

 

I think you should be able to use the flush events function, but can't test that on my tablet. It will have to wait to Monday.

Message 4 of 30
(4,625 Views)

[POST COLLISION!]

 

I was typing mine while weibe was posting his. But we are on the same page with Mouse Up purging the event queue!

 


 

Throwing out some ideas...

 

In recent version of LV you can purge the event queue. The event has a time stamp that may help.

 

Another approach would use mouse up and down on the slider and only get the slider value on a Mouse Up not on a Value change.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 30
(4,621 Views)

The simple, not quite exactly what you are requesting, is to just limit the number of events to have in the event queue.  You can set it in the Edit Event dialog.

 

If you are just polling the value via the terminal, then you cannot do anything.  Feel free to add it to the Idea Exchange.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 30
(4,594 Views)

@Ben wrote:

[POST COLLISION!]

 

I was typing mine while weibe was posting his. But we are on the same page with Mouse Up purging the event queue!

 


 

Throwing out some ideas...

 

In recent version of LV you can purge the event queue. The event has a time stamp that may help.

 

Another approach would use mouse up and down on the slider and only get the slider value on a Mouse Up not on a Value change.

 

Ben


This would also be difficult to do.  Consider this:

  • you mouse down on the control
  • move the mouse outside of the control
  • release the mouse outside of the control
  • event will not fire

I suppose there may be some way to lock the mouse coordinates to the bounds of the control while the mouse button is down, maybe using a call to user32.dll.  That would get quite messy. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 30
(4,589 Views)

@aputman wrote:

@Ben wrote:

[POST COLLISION!]

 

I was typing mine while weibe was posting his. But we are on the same page with Mouse Up purging the event queue!

 


 

Throwing out some ideas...

 

In recent version of LV you can purge the event queue. The event has a time stamp that may help.

 

Another approach would use mouse up and down on the slider and only get the slider value on a Mouse Up not on a Value change.

 

Ben


This would also be difficult to do.  Consider this:

  • you mouse down on the control
  • move the mouse outside of the control
  • release the mouse outside of the control
  • event will not fire

I suppose there may be some way to lock the mouse coordinates to the bounds of the control while the mouse button is down, maybe using a call to user32.dll.  That would get quite messy. 


I think there is also a "mouse leave" event.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 30
(4,586 Views)

You have to be careful about one thing with the Mouse Up event.

 

If you have moved the mouse off the slide at the time you Mouse Up, the mouse up event for the slide will not fire.  You will have effectively changed the value of the slide, but the mouse up event won't happen to detect that you are done moving the slide.

Message 9 of 30
(4,582 Views)

 


@RavensFan wrote:

You have to be careful about one thing with the Mouse Up event.

 

If you have moved the mouse off the slide at the time you Mouse Up, the mouse up event for the slide will not fire.  You will have effectively changed the value of the slide, but the mouse up event won't happen to detect that you are done moving the slide.


Good point well made. I forgot how annoying that is. Sure can make your head hurt from time to time.

0 Kudos
Message 10 of 30
(4,572 Views)