LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slider Control With Defined Values

Solved!
Go to solution

Okay I gave you the solution, but here is some minor improvements.  This makes sure the minimum and maximum never swap sides, it allows for the Digital Display to be used as an increment and decrement, and this works with the mouse move on the pane, as well as the control so I think it works if your mouse moves outside the vertical spacing of the control.  I also limited the Mouse Move event to 1 so that if you move the mouse a bunch, and pile up 100s of events, only the last one is handled.  The only thing left is the pan on the center clicking but I am still very happy with having this working as well as it is.

0 Kudos
Message 11 of 16
(2,029 Views)

Very nice.  I'm not sure what it is doing and I'm too lazy to try to figure it out right now but it works very smooth....no flickering back and forth.  This might be a good candidate for an X-Control so that your BD is not congested with these events.  

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 12 of 16
(2,025 Views)

XControls for me only work well when there isn't much variation from control instances.  By that I mean is there fronts that need to change?  Then you need to sorta hack in the property nodes to set font style, size, boldness, etc.  What about the size or style of individual elements?  What kind of slider is it?  Silver, NXG, Classic, vertical, horizontal?  How big are the sliders?  How many sliders are there?  What data types are supported?  What colors are they?  What colors are the background?  Can it be a Control or Indicator?  Are there Digital Displays?  What is the display format?  Do these need font settings?  Which of these features need to be able to change at runtime?

 

The natural answer to this is to just start small and not have all of these features.  Just be a horizontal, slider of one style, one set of colors, one font type, and two sliders using the TimeStamp data types that show the Digital Display in the absolute time format.  And then you end up with a control that Hooovahh finds useful, but people with other UI needs don't like.  Fine, so then you just add the most requested features, add font settings, and color properties.  And still some needs aren't met.  So you start adding features in one at a time, which turns into a jumbled mess needing refactoring, and hacks just to get it to somewhat work.  I've made a handy graph of my experience from every XControl I've created.

The Problem With XControls.png

Is this a good candidate for an XControl? Sure.  Is the feature set so large that it is impractical to make it.  Yup.  Would I give kudos to someone that stuck it out past the point I usually give up?  You betcha.

 

Message 13 of 16
(2,010 Views)

Okay so I went down the road of trying to turn this into an XControl.  It got messy and it had odd performance problems for seemingly no reason.  So I looked into QControls and I'm thrilled with the results.

 

Attached is a QControl for this defined control which looks normal, but has defined values for dragging, allows for incrementing the minimum and maximum sliders, and other basic functionality.  The difference here is that with a QControl the control shown on the front panel is just a normal slider and can be manipulated in the same way a slider can.  It allows for all the normal properties and methods, as well as customizing and resizing parts of the control.  To use it you'll need OpenG array, and the QControl package.  And if you too hate the idea of having to install yet another random toolkit, then you aren't alone and should go vote for making QControls part of LabVIEW.

 

Untitled.png

Message 14 of 16
(1,937 Views)

Flow Rate Change VI.png

0 Kudos
Message 15 of 16
(1,309 Views)

Are you lost?  Make a new thread if you have an unrelated question.

0 Kudos
Message 16 of 16
(1,301 Views)