Jump to content
Neil Pate

High CPU Usage to display a slider

Recommended Posts

Take a look at the attached control, all it is is a slider (which I think I modified from the flatline controls from drjdpowell)

When I just open this in LabVIEW, not even anything running, my CPU usage jumps from about zero to nearly pegging one of the cores of my PC.

Weird...

Slider_Test.ctl

Share this post


Link to post
Share on other sites

Confirm. But I have seen such things happen with corrupted controls once or twice across the years. My wild speculation was that there is an underlying event loop which goes foul for some reason.

  • Like 1

Share this post


Link to post
Share on other sites

So weird. I have replaced it with a system control and everything is now behaving as expected.

Share this post


Link to post
Share on other sites

If you replace with an unmodified slider direct from Flatline does the problem come back?

Share this post


Link to post
Share on other sites
6 minutes ago, drjdpowell said:

If you replace with an unmodified slider direct from Flatline does the problem come back?

Will check it out. I am on a new laptop so need to install the Flatline controls again.

Edit: no everything seems to be behaving now. One strange thing, I see the latest Flatline slider has a round grab handle; has it always been like this? If so then I have no idea where I got my slider from as mine has a rectangular grab handle.

Anyway, for now just going to use the system control (which is not ideal as I would like to be able to colour the grab handle to match some other colours on my GUI).

Edited by Neil Pate

Share this post


Link to post
Share on other sites

I investigated, and it is because you made the two incr/decr arrows transparent.  I've had suspicions in the past that there is something buggy about colouring things transparent.  

  • Thanks 1

Share this post


Link to post
Share on other sites
20 minutes ago, drjdpowell said:

I investigated, and it is because you made the two incr/decr arrows transparent.  I've had suspicions in the past that there is something buggy about colouring things transparent.  

Thanks James. I may be able to fix this then by colouring those arrows to be the same as my background colour rather than transparent.

Edit: even more strangely, colouring them a colour and then back to transparent causes the problem to go away

Edit2: LabVIEW is now behaving but the exe displays the same problem. I am going to leave this for now and just use the system control. If I get a moment I will try and fix it but for now I am moving on.

Edited by Neil Pate

Share this post


Link to post
Share on other sites

You can either use a transparent PNG (there is one in "<vi.lib>\JDP Science\Flatline Controls\Transparencies\Full Transparent.png") which, strangely, is not the same as colouring something transparent.   But the best option, if you don't want the User to be able to click on those arrows, is just to make them very small and hide them behind the main body of the slider.

Share this post


Link to post
Share on other sites

I can also confirm, I get about 25% CPU load on a quad core i5

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.