Qtpyvcp - Widget Rules guidance?

More
3 years 7 months ago #266331 by spumco
Qtpyvcp - Widget Rules guidance? was created by spumco
Im guessing this is fairly simple, but I'm struggling.

I've added a Halledindicator to my screen
Edited the resulting hal pin name and connected it in postgui hal.
Figured out how to get the led state (on/off) to match the physical input & signal

Stumbling point: I'd like to use widget rules to make it blink when the input signal is low and stay steady-state when signal is high.

Having it blink red when off and steady green when on would be a bonus, but not necessary.

I've read the qtpyvcp site on widget rules and watched the nice vid from KCJ, but there seem to be some underlying assumptions about knowledge-level that are leaving me a bit lost.

Anyone care to walk me through this?

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

More
3 years 7 months ago #266350 by Lcvette
Replied by Lcvette on topic Qtpyvcp - Widget Rules guidance?
it sounds like you have a lot of the work to do in QTdesigner to setup the led for all the various states. once those are defined the widget rules really wouldn't be necessary i don't think. you would just be changing the appearance based on the style settings you make and the input connection in halui. i have not done a blinking led before, but if it is an option available inside the properties editor for the widget than you could make it do that. if it is not then you would have to add that functionality to the widget.py file either hard coded for that widget or add a property to the py file that would make that option available in qtdesigners properties editor. (this method would be something we could do a pull request on and add to qtpyvcp, hard coding we wuld not as it removes the base functionality with no user selectability.

The rules editor is more for tying widgets to existing predefined status or settings that are predefined between linuxcnc and python. you can change subtle things like text or enable/disable, but that is really no different then halui handling the enable disable state so kind of to many chefs in the kitchen situation.

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

More
3 years 7 months ago #266352 by Lcvette
Replied by Lcvette on topic Qtpyvcp - Widget Rules guidance?
so it appears there is a "flashing" option in the properties editor, so you could just set it to flash in the off state maybe and be green in the on state and define those in the style sheet.

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

More
3 years 7 months ago #266353 by Lcvette
Replied by Lcvette on topic Qtpyvcp - Widget Rules guidance?
hmm this may be one of those special fancy widgets that requires some additional work in the py file.  but play with it and see if you can sort what the style sheet does.  you can get some ideas by checking in the qss file in the probe basic directory, there are a few buttons etc that have multiple appearances for different states such as hover, pressed, clicked, toggled, off etc

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

More
3 years 7 months ago #266357 by spumco
Replied by spumco on topic Qtpyvcp - Widget Rules guidance?
I was able to choose flash, on, or off in the style sheet, as well as set the blink rate and the startup state.

While I can set the color, I can't figure out how to set an "off" color (or flash/not).  If I can set the 'off' color, I could set that to green, make it a flashing LED, and reverse the input state logic.

Any idea how to set the off color?

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

More
3 years 7 months ago #266358 by Lcvette
Replied by Lcvette on topic Qtpyvcp - Widget Rules guidance?
The flash and rate and color was a property defined in the py file to a user settable property.  The stylesheet is the yellow portion where you add customized lines of code per the qt stylesheet guidelines. 

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

Moderators: KCJ, Lcvette
Time to create page: 0.145 seconds
Powered by Kunena Forum