( Solved ) Toggle Hal button

More
6 years 2 months ago #177640 by anfänger
Hi,

The actual Flood coolant is switched by a valve and woks well.
Till now I do it via s abut call button and a Madi script, but I forget to turn on the pump before I start start a program.
So I would like to change to a Hal button, so I can switch the pump on afterwards or even switch it of while a program is running.
I can't combine it withe the valve, cause I also use the pump to hose down the machine.
But the Hal button only switched on the pump as log as I press the button. Is there a way to get it to toggle? I managed to get the color to toggle but not the signal.

[img


And while I am here. I modified my offset page so I can write in some numbers to set the DRO to a certain value, which is Handy
I also have a subcall button which sets the DRO to half its value (quite handy if you want to finde the middle of something and I use it quite often) But is it possible to get qtpyvcp to write half the value to the line edit?
I tried by writing the parameter of the widget, but it's read only. Is there an easy work around?

[img



Thans Patrick

Please Log in to join the conversation.

More
6 years 2 months ago #177656 by KCJ
Replied by KCJ on topic ( Solved ) Toggle Hal button
Hello Patrick,

The HalButton will generate a checked hal pin that will be true whenever the button is checked.
You will of course need to make sure you have the button set as checkable in QtDesigner.

Attachment not found



Once you have set the button as checkable a halbutton.checked pin will be automatically generated.
(It used to be generated regardless, I have just made a change so it is only generated when the button is checkable to prevent confusion.)

Attachment not found




Regarding your second question, you should be able to write directly so the widget value. How are you trying to set the DRO value, from the python or from gcode?

Cheers,
Kurt

Please Log in to join the conversation.

More
6 years 2 months ago #177674 by anfänger
Thanks, I didn't take a look at the hal pins after I found checkable!

for the second question.
Is use G-Gode to set the DRO:

For the Value in the Lineedit:

G10 L20 P{ch[0]} X#<new_x_offset>

for half I use:
G10 L20 P0 X[#<_x>/2]

but I would like to write the value to the linedit first

I tried

#<new_x_offset>=[#<_x>/2]

but this doesn't work. I want to have it as kind of a double check before overwriting the WCS. Cause if this works I will do the same for zero.

Tanks Patrick

Please Log in to join the conversation.

More
6 years 2 months ago #177686 by KCJ
Replied by KCJ on topic ( Solved ) Toggle Hal button
You can access and set the VCP widgets directly from gcode.

Here is an example of how you could set the DRO value.
You will need to change the "my_dro" to the ObjectName of the DRO you want to change.

Code:
(DEBUG, EVAL[vcp.getWidget{"my_dro"}.setText{'%4.2f' % #<new_x_offset>}])

More info here:
www.qtpyvcp.com/plugins/notifications.html#notifications-plugin

Cheers,
Kurt

Please Log in to join the conversation.

More
6 years 2 months ago #177690 by anfänger
Damn I used this for the atc-widget, but to stupid to think about using it for other widgets too.

Is there a thread where others can show what they have done with qtpyvcp? Then I would post my changes there.

Many thanks Patrick

Please Log in to join the conversation.

More
6 years 2 months ago #177692 by tommylight

anfänger wrote: Is there a thread where others can show what they have done with qtpyvcp?

There is one on the github, but not here as far as i recall, so feel free to start one here under the "qtpyvcp" section of the forum.
Edit:
Do you also want this topic to be marked as solved ? It keeps changing the title, so i can stop it from doing that.

Please Log in to join the conversation.

More
6 years 2 months ago #177706 by anfänger
then I will open one in the next days after I made some last changes. I am not aktive on GitHub.

This thread ist solved, all my questions are successfully answered ich changes the Titel cause I thin k it helps the searching for answers.

Thanks Patrick

Please Log in to join the conversation.

More
6 years 2 months ago #177713 by tommylight
Thank you Patrick.
Marked as solved.

Please Log in to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum