Error in tool_offsetview.py

More
07 Jul 2022 14:41 #246808 by hottabich
Hello! Please tell me how to add a tool image to the tool_offsetview .py widget. As well as switching the image through the tool selection dialog. Thank you!
Attachments:

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

More
07 Jul 2022 17:54 - 07 Jul 2022 18:20 #246820 by MarkoPolo
this is just experimental fun but it works pretty well. Chris once mentioned that he wanted to add tool image options. Chris will do it right.
I did it like this:
For the pictures to be displayed in the tools of the tool_offsetview.py in the file tool_offsetview.py, make such a change
, do the image files in the directory: 
in the qtdragon.ui file, you need to enlarge the space for the tool image  

In order for the images to update in the preview, you need to add such entries in the qtdragon_handler.py file
   

unfortunately the second set of vertical images in the catalog 
Attachments:
Last edit: 07 Jul 2022 18:20 by MarkoPolo.

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

More
07 Jul 2022 19:15 #246825 by hottabich
Thank you very much for your attention and help! Here is my version of qtdragon, you may be interested.
Attachments:

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

More
13 Jul 2022 13:47 #247235 by hottabich
Switching the tool with the command M61 or Reload Tool changes the image of the tool, but not through the dialog. Who knows how to fix it please tell me. Thank you!
Attachments:

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

More
14 Jul 2022 04:35 #247273 by cmorley
Replied by cmorley on topic Error in tool_offsetview.py
use the STATUS message 'tool-in-spindle-changed' to call a function, to change the image.

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

More
14 Jul 2022 17:40 #247307 by hottabich
Sorry, but I don't understand how to implement this. Thank you!

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

More
15 Jul 2022 03:52 #247351 by cmorley
Replied by cmorley on topic Error in tool_offsetview.py
In the handler file something like this:
        STATUS.connect('tool-in-spindle-changed', lambda w, t: self.update_tool_image(t))
def update_tool_image(self, toolnumber):
     command1 = "[{}]".format(toolnumber)
     self.w.lbl_tool_image.setPixmap(QtGui.QPixmap(":/images/images/" + str(command1) + ".png"))
The following user(s) said Thank You: hottabich

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

More
16 Jul 2022 13:06 #247459 by hottabich
Thank you so much! Works great. I spread the handler with changes for my previous files.
Attachments:

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

More
12 Aug 2022 18:44 - 12 Aug 2022 19:20 #249611 by MarkoPolo
not much is happening, so I made some minor adjustments in the setup tab, because the buttons didn't look right.  Two other problems:1. With manual movements of the A axis, the "fast/slow" switch does not toggle the value.2. In the "setup" tab, the link to local files in lcnc installed in the virtual machine works normally, but on a normal computer this link does not work for me, I cannot find the reason. Does it do the same for you?
Marek

The problem with the "fast / slow" switch fixed, I am sending an updated .ui file

Marek
Attachments:
Last edit: 12 Aug 2022 19:20 by MarkoPolo.

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

More
12 Aug 2022 19:00 - 12 Aug 2022 19:09 #249613 by hottabich
To switch in the designer, you need to add a signal slot or an attached file. linuxcnc installed in  computer.
Attachments:
Last edit: 12 Aug 2022 19:09 by hottabich.

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

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