( Solved ) Toggle Hal button

More
07 Aug 2020 19:27 - 08 Aug 2020 16:22 #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.

File Attachment:


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?

File Attachment:



Thans Patrick
Last edit: 08 Aug 2020 16:22 by anfänger. Reason: Solved

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

More
07 Aug 2020 21:35 #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.



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.)




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
Attachments:

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

More
08 Aug 2020 06:07 - 08 Aug 2020 06:08 #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
Last edit: 08 Aug 2020 06:08 by anfänger.

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

More
08 Aug 2020 15:28 - 08 Aug 2020 15:28 #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.

(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
Last edit: 08 Aug 2020 15:28 by KCJ. Reason: Typo
The following user(s) said Thank You: anfänger

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

More
08 Aug 2020 16:21 #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 or Create an account to join the conversation.

More
08 Aug 2020 16:59 - 08 Aug 2020 17:01 #177692 by tommylight

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.
Last edit: 08 Aug 2020 17:01 by tommylight. Reason: More info
The following user(s) said Thank You: KCJ, anfänger

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

More
08 Aug 2020 19:57 #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
The following user(s) said Thank You: tommylight, KCJ

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

More
08 Aug 2020 20:34 #177713 by tommylight
Thank you Patrick.
Marked as solved.

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

Moderators: KCJLcvette
Time to create page: 0.126 seconds
Powered by Kunena Forum