how to make my own custom page for qtdragon_hd?

More
26 Apr 2023 05:03 #269947 by rodw

Qtvcp/panels/belts/

Not
Qtvcp/belts/

Man, I looked at that about 6 times and still didn't see it!

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

More
26 Apr 2023 07:05 #269951 by rodw
I am almost done!
But I have one more issue.
I made 4 general hal inputs on the panel
The status pins are updating in halshow but they are not updating in the display.
The nice green status LED is working.
Is there a trick here?
Can you apply a number format in Designer?
I've attached the .ui. If I can get this sorted it will be time to tackle the handler as I need som eon click events to enable/disable buttons

 

 
Attachments:

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

More
26 Apr 2023 09:28 #269961 by rodw
AHhh, I think I should have used a HalLabel. I thought thats what I initially used.

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

More
26 Apr 2023 13:08 #269975 by rodw

AHhh, I think I should have used a HalLabel. I thought thats what I initially used.

Well, the panel should be done now subject to testing tomorrow.
I have a handler file loading but it does not do anything yet.

I want to react to Belt button keypresses. I think i need to react to any hal button pressed  in the processed_key_event, and call another function that parses and acts on the button click. but I have no idea how that event is defined. If you could have a look at the attachment and get one button working for me, or a bit more guidance, that would really be appreciated. There is nothing outling how to build a panel so it has been hard work

The final  stage will be to save some data in the preferences file. If you can help me get ther, we'll end up with a complete example panel that perhaps could be included in QTdragon.

 
Attachments:

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

More
26 Apr 2023 13:57 #269980 by cmorley
couple options, you can use slots and signals:
linuxcnc.org/docs/2.9/html/gui/qtvcp.htm...qtvcp:designer-slots

you could try Call Python Commands On State:
linuxcnc.org/docs/2.9/html/gui/qtvcp-wid...:indicatedpushbutton
each would call a function in the handler file to process the events.
maybe with a true state command such as:
INSTANCE.frontBeltSelected(1)
for front buttons use 1- 4
INSTANCE.backBeltSelected(5)
for buttons 5 - 8

in the handlerfile:

def frontBeltSelected(self, number):
print('front',number)
def backBeltSelected(self, number):
print('back',number)

just for a start.

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

More
26 Apr 2023 20:03 #269997 by rodw
Thanks Chris.

Something like this?
 
    #######################
    # CALLBACKS FROM FORM #
    #######################

    def frontBeltSelected(self, number):
        print('front',number)

    def backBeltSelected(self, number):
        print('back',number) 
 
I am not seeing it respond to the handler
I am still getting exceptions on keybindings everytime I press a key. COuld that be obscuring the action?w
[QTvcp.QTVCP.LIB.KEYBINDINGS][DEBUG]  Exception in KEYBINDING: no function name conversion for QT Event: '<unknown - 16777251>' (keybindings.py:279)
How do we get rid of that?
Attachments:

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

More
26 Apr 2023 20:50 #270005 by rodw
Actually digging throught the log, I now see
[QTvcp.QTVCP.WIDGETS.SIMPLE_WIDGETS][ERROR]  (pushbutton_b3 called exec in error:'VCPWindow' object has no attribute 'frontBeltSelected' (simple_widgets.py:617)
[QTvcp.QTVCP.WIDGETS.SIMPLE_WIDGETS][WARNING]     Command was INSTANCE.frontBeltSelected(3) (simple_widgets.py:618)
Must be getting close!

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

More
26 Apr 2023 21:17 #270011 by cmorley
I forgot to mention you must set the 'python_command_option' property too.

the keybinding messages is because you are in debugging mode and don't have hotkey programmed.

I made a sample to show the buttons working. sorry i didn't find your latest files so they are the best i could do.
Attachments:

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

More
26 Apr 2023 21:32 #270012 by cmorley
Well testing my sample by it's self works but embeded does not - looking into it.

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

More
26 Apr 2023 22:00 #270014 by cmorley
ok you must use the panels embed name in the python command:

INSTANCE.Spindle_Extras.backBeltSelected(5)

I will have to think on how to make that easier in the future.
The following user(s) said Thank You: rodw

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

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