04-13-2012 08:23 AM
I have tried a few different ways to prevent my needle on the Gauge control from jumping from Range:Max to Range:Min (and vice versa) but no technique seems to work.
Here is a VI that I am am using for testing...
Its odd that disabling the control doesn't force the mouse to lose focus on the control...
Does anyone know of a good general method to prevent the Gauge Control from jumping from Range:Max to Range:Min - maybe by forcing the mouse to loose focus on the needle?
- DC
04-13-2012 10:30 AM
The control works fine if you just remove all the race condition code in your "value change" event and just wire the control straight to the indicator. What exactly are you trying to accomplish with all the extra code???
04-14-2012 01:48 PM
NIquist,
Yes, I understand I have a bunch of race conditions, but that is not what I am trying to accomplish (I don't believe my race conditions are causing the problem)...
What I am trying to avoid is the needle jump when the needle is active and selected by the mouse drag to prevent it from jumping from range:min to range:max (or from range:max to range:min). In the code you are seeing my (failed) attempts at disabling the control (by using the disable and gray out property for the Gauge control) when the mouse is moved over top the boolean control. There is some extra code that tries to update a value indicator and take some actions based on its value, but it should be as simple as deactivating the control when mousing over the Gauge control.
What I would like: When moving and dragging the needle with the mouse at the bottom of the gauge control, for the needle to be deselected automatically when the mouse is moved from the range Max to range Min condition. It almost does this (I'm detecting the Mouse into event on the boolean), but the Gauge is still updating values when it is apparently 'inactive and grayed out'. Does this make sense now?
You can see when you drag the needle across the boolean control the gauge control does get grayed out, BUT - this is the problem - the needle is still attached to the mouse drag state and is still updating values. I would have assumed this 'disable' state would have stopped the control from updating values...
I guess are there any better ideas? I guess I could detect the derivative and if there is a large dValue/dt condition disallow readings - but that seems overkill for some reason.
- Pat
04-14-2012 03:02 PM - edited 04-14-2012 03:05 PM
@DanielCorinth wrote:
Does anyone know of a good general method to prevent the Gauge Control from jumping from Range:Max to Range:Min - maybe by forcing the mouse to loose focus on the needle?
Open the properties of the dial and change the needle from "snap to mouse" to "lock at min/max".
No code needed! 😄

This is LabVIEW 2011. I assume that it also exists in your LabVIEW 2010.