Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gmoccapy - remove AUTOMATIC_G43 #3113

Open
wants to merge 41 commits into
base: master
Choose a base branch
from

Conversation

zz912
Copy link
Contributor

@zz912 zz912 commented Sep 14, 2024

Gmoccapy had automatic activation of tool offsets using the G43 command after a tool change. The automatic G43 caused "race condition problems" in some configurations. That's why it was removed. Automatic G43 should be implemented by LCNC remap functionality not GUI.

This PR fix many bugs:
#2489
#2613
#2453
......

Here rmu75 explain why automatic_G43 is not good in GUI:
#2841 (comment)

Here Norbert allow me remove automatic_G43 from Gmoccapy:
#2841 (comment)

Sorry that this PR contains a lot of commits. I can only use Github in a web browser.

Unfortunately, this patch produced, or rather pointed out, more bugs:

  1. bug:
    using M61 disable MDI window [SOLVED - this bug is not related with this PR]
  2. bug:
    remap broke these configurations: lathe_macros.ini, xyzac-trt.ini [SOLVED]

I would like ask for help.

Gmoccapy had automatic activation of tool offsets using the G43 command after a tool change. The automatic G43 caused "race condition problems" in some configurations. That's why it was removed. Automatic G43 should be implemented by LCNC remap functionality not GUI.
Added python code for M61 in
/configs/sim/gmoccapy/python/stdglue.py
My fault - i cannot remove commit from Github
@Sigma1912
Copy link
Contributor

Since the bug with M61 disabling MDI mode is not related to this PR I would suggest to remove this particular issue from the description of this pull request and file it in the 'Issues' list.
Thanks for working on this.

@Sigma1912
Copy link
Contributor

as for the broken configs, try these modifications:

in 'configs/sim/gmoccapy/lathe_configs/lathe_macros.ini'

replace this line:
SUBROUTINE_PATH = macros:./
with this:
SUBROUTINE_PATH = ../macros:./

in configs/sim/gmoccapy/non_trivial_kinematics/table-rotary-tilting/xyzac-trt.ini
remove these two lines:
SUBROUTINE_PATH = ./examples
SUBROUTINE_PATH = ../../macros
and replace with this:
SUBROUTINE_PATH = ./examples:../../macros

@Sigma1912
Copy link
Contributor

Could you edit the initial comment with the bug description and remove everything regarding the M61 bug and move that over to the issue you opened about this #3120

This way it would be much clearer that the two are not related.

@zz912
Copy link
Contributor Author

zz912 commented Sep 16, 2024

After solving the bugs I will mark them [SOLVED]. I'll test your solution suggestions tonight. I hope it's clearer now.

@Sigma1912
Copy link
Contributor

Sigma1912 commented Sep 16, 2024

My apologies, I was under the impression that the m61 bug was not related to your changes to the ini file.
Now I made a mess, I'm sorry.

[edit]
Actually it seems that the M61 bug is indeed unrelated to this PR

@Sigma1912
Copy link
Contributor

Testing 'configs/sim/gmoccapy/lathe_configs/lathe_macros.ini' with my suggested SUBROUTINE_PATH = ../macros:./

I actually get errors:

[Gmoccapy][ERROR]  g-file-error-quark: Failed to open file “/home/user/git/linuxcnc-zz/configs/sim/gmoccapy/lathe_configs/macros/images/i_am_lost.png”: No such file or directory (4) (gmoccapy:803)
[Gmoccapy][ERROR]  could not resolve the image path '/home/user/git/linuxcnc-zz/configs/sim/gmoccapy/lathe_configs/macros/images/i_am_lost.png' given for button 'macro_0' (gmoccapy:805)
[Gmoccapy][ERROR]  g-file-error-quark: Failed to open file “/home/user/git/linuxcnc-zz/configs/sim/gmoccapy/lathe_configs/macros/images/goto_x_y_z.png”: No such file or directory (4) (gmoccapy:803)
[Gmoccapy][ERROR]  could not resolve the image path '/home/user/git/linuxcnc-zz/configs/sim/gmoccapy/lathe_configs/macros/images/goto_x_y_z.png' given for button 'macro_4' (gmoccapy:805)

the issue here is that the original
SUBROUTINE_PATH = macros:./
does actually not point to an existing 'macros' folder as that is actually located in the parent directory.

So this is really something that was already broken in all the configs inside a sub folder of 'configs/sim/gmoccapy'. In none of those configs can we use for example 'o<i_am_lost>call'.

Fixing this seems to be somewhat tricky because of this path that is used inside the macro ngc files:

(IMAGE, ./macros/images/i_am_lost.png)

So I would suggest to move your two new ngc files into a new 'subroutines' folder and then to add that to the 'SUBROUTINE_PATH' as either ':subroutines' or ':../subroutines' depending on whether the .ini file is located in the 'configs/sim/gmoccapy' folder or a subfolder.

new folder

repaired SUBROUTINE_PATH = ./examples:../../macros
@zz912
Copy link
Contributor Author

zz912 commented Sep 16, 2024

Thank you for explain lathe_macros.ini bug.
BUT i prefer this solution:

Use SUBROUTINE_PATH = ../macros:./
and remove all [MACROS] in INI file.
The behavior will be the same as before.

I want these macros together:
macros

@zz912 zz912 marked this pull request as ready for review September 16, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants