qtdragon_hg probing macro

More
03 Nov 2023 14:57 #284462 by zieluch
Hi , 

I have following problem with using Versa probe on qt dragon. I like to add M64 P3 at the begining and M65 p3 at the end  to turn on/off probe before I execute any of the probe routine. I can't call right know exact file name but in qtdragon but i found some file in the python directory where gcode is generated in the routines. For some of them this was very simple to do just one line before after and thats it as it was concatenated text but for others not that simple. More over I did it once but after update my file was overwritten and all the changes were gone. (I forgot to add it to github repo). Are there any other possibilities to do this ? or other pace to execute code before ? 
thanks

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

More
04 Nov 2023 03:39 #284509 by cmorley
Replied by cmorley on topic qtdragon_hg probing macro
I'm think we work around this problem - but it will require a custom handler file.

In there we can patch two of the versa probe functions so as to add some MDI commands.

so in your config folder you will need to add some folders:
qtvcp/screens/qtdragon_hd

and in the qtdragon_hd folder add the handler file.

If this works then you should get some messages printed 'Before' and 'After' in the notify windows.

Then you can change the message commands to m codes.

Chris
Attachments:
The following user(s) said Thank You: zieluch

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

More
06 Nov 2023 21:14 - 07 Nov 2023 08:07 #284732 by zieluch
Replied by zieluch on topic qtdragon_hg probing macro
Hi Chris,

I am getting following error when trying to run linuxcnc:
Traceback (most recent call last):
File "/usr/bin/qtvcp", line 545, in <module>
_qtvcp = QTVCP()
^^^^^^^
File "/usr/bin/qtvcp", line 294, in __init__
window.handler_instance.initialized__()
File "/home/zieluch/linuxcnc/configs/qthd_sorotec_cl0604/qtvcp/screens/qtdragon_hd/qtdragon_hd_handler.py", line 182, in initialized__
self.init_utils()
File "/home/zieluch/linuxcnc/configs/qthd_sorotec_cl0604/qtvcp/screens/qtdragon_hd/qtdragon_hd_handler.py", line 482, in init_utils
self.ngcgui = NgcGui()
^^^^^^^^
File "/usr/lib/python3/dist-packages/qtvcp/lib/qt_ngcgui/ngcgui.py", line 480, in __init__
self.add_configd_tabs()
File "/usr/lib/python3/dist-packages/qtvcp/lib/qt_ngcgui/ngcgui.py", line 512, in add_configd_tabs
rtn = self.check_linuxcnc_paths(curr_fname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/qtvcp/lib/qt_ngcgui/ngcgui.py", line 822, in check_linuxcnc_paths
return self.check_linuxcnc_paths_fail(fname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zieluch/linuxcnc/configs/qthd_sorotec_cl0604/qtvcp/screens/qtdragon_hd/qtdragon_hd_handler.py", line 1157, in check_linuxcnc_paths_fail_override
self.add_status("NGCGUI Path {} not in linuxcnc's SUBROUTINE_PATH INI entry".format(fname), CRITICAL)
File "/home/zieluch/linuxcnc/configs/qthd_sorotec_cl0604/qtvcp/screens/qtdragon_hd/qtdragon_hd_handler.py", line 1249, in add_status
self.w.statusbar.setText(message)
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'QStatusBar' object has no attribute 'setText'



if I commented line 1249 error is limited only to:


Traceback (most recent call last):
File "/usr/bin/qtvcp", line 545, in <module>
_qtvcp = QTVCP()
^^^^^^^
File "/usr/bin/qtvcp", line 294, in __init__
window.handler_instance.initialized__()
File "/home/zieluch/linuxcnc/configs/qthd_sorotec_cl0604/qtvcp/screens/qtdragon_hd/qtdragon_hd_handler.py", line 237, in initialized__
if key == '' or INFO.get_ini_mdi_command(key) is None:
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Info' object has no attribute 'get_ini_mdi_command'


Errors seems to  be unrelated to Versa changes because when I copied regular handler from Github getting the same errors.


Edit:

I compared my version qtdragon_hd_handler.py from ./share/qtvcp/screens/qtdragon_hd/qtdragon_hd_handler.py vs one which you provide me and there are some differences. I copy over only part for versa probe and I am this seems to work .

I change two lines to
ACTION.CALL_MDI_WAIT("M64 P3") ACTION.CALL_MDI("M65 P3")


And everything is working for now. At first tried after second measurement I gut some fatal error but once I restarted everything is working for now. Thank you very much for help in the topic.
 
Last edit: 07 Nov 2023 08:07 by zieluch. Reason: last comment in code formatting section

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

More
06 Nov 2023 23:16 #284738 by cmorley
Replied by cmorley on topic qtdragon_hg probing macro
Seems your version of qtdragon is a little behind mine.

Can you post your original version of qtdragon_hd_handler.py?

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

More
07 Nov 2023 08:09 #284752 by zieluch
Replied by zieluch on topic qtdragon_hg probing macro
Attached file handler with versa modifications 
 

File Attachment:

File Name: qtdragon_h...ndler.py
File Size:71 KB
Attachments:

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

More
07 Nov 2023 08:56 #284758 by MarkoPolo
Replied by MarkoPolo on topic qtdragon_hg probing macro
1. If such error occurred,
"self.w.statusbar.setText(message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Object 'QStatusBar' does not have attribute 'setText',"
then the versions qtdragon_hd.ui and qtdragon_hd_handler.py are not compatible. The .ui file is too old.

2. The file you shared is not the file you use in your qtdragon_hd, "self.w.statusbar.setText(message)" does not appear in the shared file, and the error comes from this line.

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

More
07 Nov 2023 09:12 #284759 by zieluch
Replied by zieluch on topic qtdragon_hg probing macro
Hi Marco,

yes file which I shared is the one which is working and not causing error. I mention that in my previous message. When I used most recent Chris version i was getting error but once I change mine everything is working fine.
Cheers
Michal

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

More
08 Nov 2023 01:49 #284831 by cmorley
Replied by cmorley on topic qtdragon_hg probing macro
I see have have already added the code changes.
So do this now work for you?
In the future I will look at supporting pre and post commands.

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

More
08 Nov 2023 15:03 #284873 by zieluch
Replied by zieluch on topic qtdragon_hg probing macro
I just tested it for once but It was working exactly as i like to , Thank you. I will follow up over the weekend with more tests, in case of a problem I fllow up this topic. For now problem is solved. 

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

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