Change feed override color in QtDragon?

More
04 Mar 2021 17:24 #201030 by turbostew
Well, I know I bug a lot lately, I really appreciate everybody's patience with me. Chris and Jim have been so helpful so bare with me a little longer....

I want the slider for feedrate override (or the feedrate display background color, whichever is easier) to change colors to red when feed is over 100%. I need it to really stand out when >100% somehow. I did not see any color attributes in the UI for slider or status. Any hints?

Thanks again,
Kent

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 19:05 #201035 by cmorley
I think this is a very useful idea.
This can be done in the handler but it's a bit awkward code wise.
Give me a bit and I'll push a change so you can do this with a stylesheet edit.

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 19:57 #201037 by persei8
I do the same thing with the DRO labels. If the axis is unhomed, the digits are red. Basically, you give the widget a dynamic property in the ui file and modify that property in the handler. The effect of changing the property is done in the stylesheet. A little vague, I know, but if you check the code for the DRO labels, you will see how it is done. Chris may come up with a more elegant method.
Jim

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 19:58 #201038 by turbostew
Thanks Chris,
One can argue same feature for spindle speed....

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 20:54 #201041 by cmorley
ok some code pushed...



This is just a sample of how to do the basic color change. - the slider can be styled in many ways to suit your preference.

The stylesheet additions would be for qtdragon, something ;like this (in fact the dark theme now has this):
/* warning colors for overrides if out of normal range*/

    #slider_spindle_ovr[alertState='over'] {
        background: red;
    }
    #slider_feed_ovr[alertState='over'] {
        background: red;
    }
    #slider_feed_ovr[alertState='under'] {
        background: yellow;
    }

The hi and low setting are 100 and 50 - I should make this more easily setable - someone remind me down the road when you can't atand the limitations :)
Attachments:

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 20:59 #201042 by cmorley

I do the same thing with the DRO labels. If the axis is unhomed, the digits are red. Basically, you give the widget a dynamic property in the ui file and modify that property in the handler. The effect of changing the property is done in the stylesheet. A little vague, I know, but if you check the code for the DRO labels, you will see how it is done. Chris may come up with a more elegant method.
Jim


I have since added this behavior to DRO widgets so you don;t need to code it in the handler file.
linuxcnc.org/docs/devel/html/gui/qtvcp_w...ml#_dro_label_widget

and the status indicators on buttons (scroll down a bit)
linuxcnc.org/docs/devel/html/gui/qtvcp_w...#_push_button_widget

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 21:27 #201048 by turbostew
Dumb question..... Where do i find new code?

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 21:35 #201050 by cmorley
you want to hand add the code i changed? or are you talking about the stylesheet required changes?

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 21:35 - 04 Mar 2021 21:37 #201051 by turbostew
When you say code is pushed....... pushed where?
Last edit: 04 Mar 2021 21:37 by turbostew.

Please Log in or Create an account to join the conversation.

More
04 Mar 2021 21:40 #201054 by cmorley
here shows the commits - does that help (click on one to see the code changes)?
github.com/LinuxCNC/linuxcnc/commits/master

maybe this is easier:
github.com/LinuxCNC/linuxcnc/blob/32552b...ets/status_slider.py

The style sheets can be edited with a dialog in qtdragon - hit f12

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.336 seconds
Powered by Kunena Forum