Modify HAL PIN from custom Gui
20 Apr 2015 05:07 #57914
by ww34ww34
Modify HAL PIN from custom Gui was created by ww34ww34
Hi all!
I have a simple question.
I wanna link my X home pin to a "and2" HAL component to disable X hardware switch at runtime.
my <name>.hal changed from:
To:
then i try to change value of the second "and2" PIN in the custom GUI:I recive this error.
"AttributeError: Pin 'and2.0.in1' does not exist".
What I miss?
There is a better way to modify pin Value from custom GUI?
Regards Salvatore.
Thanks
I have a simple question.
I wanna link my X home pin to a "and2" HAL component to disable X hardware switch at runtime.
my <name>.hal changed from:
net min-home-x <= parport.0.pin-13-in-not
To:
net and-x0 and2.0.in0 <= parport.0.pin-13-in-not
net min-home-x <= and2.0.out
then i try to change value of the second "and2" PIN in the custom GUI:
def on_tbtn_unlock_x_toggled(self, widget, data=None):
self.halcomp["and2.0.in1"] = widget.get_active()
"AttributeError: Pin 'and2.0.in1' does not exist".
What I miss?
There is a better way to modify pin Value from custom GUI?
Regards Salvatore.
Thanks
Please Log in or Create an account to join the conversation.
20 Apr 2015 10:54 #57922
by cmorley
Replied by cmorley on topic Modify HAL PIN from custom Gui
try:
Chris M
def on_tbtn_unlock_x_toggled(self, widget, data=None):
if widget.get_active():
self.halcomp.set_p('and2.0.in1',"true")
Chris M
Please Log in or Create an account to join the conversation.
20 Apr 2015 13:23 #57923
by ww34ww34
Replied by ww34ww34 on topic Modify HAL PIN from custom Gui
Thaks for fast reply.
No luck.
I recive
No luck.
I recive
AttributeError: Pin 'set_p' does not exist
Please Log in or Create an account to join the conversation.
20 Apr 2015 20:16 #57937
by ww34ww34
Replied by ww34ww34 on topic Modify HAL PIN from custom Gui
Solved by myself.
The error was in the hal component definition:
I had
Now i haveAnd all work
The error was in the hal component definition:
I had
self.halcomp = hal.component("custom_gui_player")
Now i have
import hal
....
self.halcomp = hal
Please Log in or Create an account to join the conversation.
Time to create page: 0.095 seconds