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

Addition of CAM postprocessor for the Masso controller #18845

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ShamanTcler
Copy link

The Masso G3 want the order of a tool change to be tool number then tool change command. FreeCAD by default wants tool change command then tool number. For example Masso wants "T5 M6" whereas the linuccnc controller is just fine with "M6 T5".

The new addition is called refactored_masso_g3_post.py. It is a copy and modification of the refactored_linuxcnc_post.py. (Both codes have reference to each other in the comments now). The "refactored" line of post processors is the newest approach to post processors and was written by Larry Woestman. Larrry has been consulted throughout this process.

This modification introduces the TOOL_BEFORE_CHANGE configuration option. Setting TOOL_BEFORE_CHANGE to True triggers the command swap. This swap happens in File:UtilsParse.py Routine:parse_a_path lines 729-736. This seemed to be the least intrusive way to swap the command in the current GCode buffer.

A test module called TestRefactoredMassoG3Post.py was added to TestCAMApp.py. Therefor running "freecadcmd  -t TestCAMApp >TestCAMApp.txt 2>&1" runs the testing module.

In the output the test is listed under CAMTests.TestRefactoredMassoG3Post.TestRefactoredMassoG3Post. Test 80 is the test to check for tool order. Test 80 is the only test modified from the linuxcnc test routine. All other tests were maintained.

I have actually used the output of this routine on a Masso G3 in my basement.

As this is my first PR with FreeCAD, please pardon any negligence.

Regards and Thank you
Carl

@github-actions github-actions bot added the Mod: CAM Related to the CAM/Path Workbench label Jan 3, 2025
@maxwxyz maxwxyz requested a review from sliptonic January 3, 2025 13:04
@@ -22,6 +23,11 @@
# * *
# ***************************************************************************

# ***************************************************************************
# * Note: refactored_masso_g3_Post.py is a modified clone of this file *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint: fix end of line asterisk

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 3-4 places where the asterisk is not uniform do you mind fixing these ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, of course I will make the changes. However, when I look at the code in my editor it looks fine. I am assuming I have a tab vs space substitution.

Is see "lint" is the tool you used to find the issues. Would you mind giving me the command line arguments, so I can generate the issues myself?

In my defense, I did search the web for "FreeCAD Pull Request procedure" and came up pretty empty. I did look at the Developers Handbook. I did see the mention of "Black" as a Python formatter ... I am a C++ kinda guy, so it is a new tool to me. Running Visual Studio Code, I see there is an extension for "Black" ... is this what is used? I ask because I know how out of date the wiki can be.

Thank you for your time and patience.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok updated 4 files with corrected comment alignment, and check it all back in again.

Did a clean build and re-ran the test framework. Only error from the Framework was for an area I never touched.

FAIL: test01 (CAMTests.TestPathToolController.TestPathToolController.test01)
Verify ToolController template roundtrip.

I am afraid that is an issue for Sliptonic.

Copy link
Contributor

@LarryWoestman LarryWoestman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed these changes and they look good to me. I have also been working with Carl as he developed this code.

@LarryWoestman
Copy link
Contributor

We usually "squash" multiple commits in a PR down to one commit to make managing the PR easier. I forgot to check for that during my review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mod: CAM Related to the CAM/Path Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CAM: Add support for the Masso G3 controller (solution proposed)
3 participants