Learning to work with new QTVCP screens and handler

More
14 Feb 2021 11:39 #198791 by Pro_El
I have new question
I am trying to show number on screen from code in py file
I connect lcdNumber widget to receive from slot1 in QTdesigner
I made def slot1(self): in py file to define it
What is the other commands so i can display some numbers in lcdNumber widget
The display numbers will be some float result in my code
I am open for suggestion for other approach to display numbers..
Thanks

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

More
14 Feb 2021 12:36 #198800 by cmorley
QLCDNumber will only display integers.

Probably a plain QLabel will work for you.

Add a QLabel to the screen with designer - no slot or signal needed.

in the handler use code similar to this to update the label:

self.w.LABELNAME.setText('Value = {:.4f}'.format(self.myVariable))
The following user(s) said Thank You: Pro_El

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

More
14 Feb 2021 19:37 - 14 Feb 2021 22:12 #198832 by Pro_El
Thanks is working good

I need some information where can i find list of all states i can use like state-on; state-off
I will need state for coolant-mist but i will want to now where can i find all the states i can use. For now i get error this signal not found even i can see coolant-mist in my HAl signal section

Example:
STATUS.connect('state-estop', self.say_estop)
STATUS.connect('state-on', self.on_state_on)
STATUS.connect('state-off', self.on_state_off)
STATUS.connect('jograte-changed', self.on_jograte_changed)
STATUS.connect('periodic', self.on_periodic)


Thanks Chris for best answers
Last edit: 14 Feb 2021 22:12 by Pro_El.

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

More
15 Feb 2021 01:39 #198891 by cmorley
This should have most of them:
linuxcnc.org/docs/2.8/html/gui/GStat.html

or look in lib/python/hal_glib.py

Chris
The following user(s) said Thank You: Pro_El

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

More
26 Aug 2021 23:11 #218837 by persei8
The documentation for GSTAT states that the status message jogincrement-changed returns a float. However, this is not the case. It returns a string which is whatever the jog increment widget is currently set to. To get around this, I do STATUS.get_jog_increment() which returns only the float value. Just thought I would mention it FYI. Regards.
Jim
 

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

More
27 Aug 2021 03:53 #218855 by cmorley
Hey Jim it actually should send both (from hal_glib)

self.emit('jogincrement-changed', self.current_jog_distance, self.current_jog_distance_text)

I wonder if your code (or mine) uses lambda to cut off the float?

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

More
27 Aug 2021 13:39 #218906 by persei8
You're right, that is exactly what happened. I should have clued in when it complained about the wrong number of arguments. Still, maybe the documentation could mention this to avoid future confusion?
Jim

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

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