Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ShamanTcler/FreeCAD_Masso i…
Browse files Browse the repository at this point in the history
…nto main
  • Loading branch information
ShamanTcler committed Jan 3, 2025
2 parents 57687f0 + 66f92c3 commit 2d644a2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Mod/CAM/Path/Post/UtilsParse.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,9 @@ def parse_a_path(values: Values, gcode: Gcode, pathobj) -> None:

# Check to see if values["TOOL_BEFORE_CHANGE"] is set and value is true
# doing it here to reduce the number of times it is checked
swap_tool_change_order= False
if ( "TOOL_BEFORE_CHANGE" in values and values["TOOL_BEFORE_CHANGE"] ):
swap_tool_change_order= True
swap_tool_change_order = False
if "TOOL_BEFORE_CHANGE" in values and values["TOOL_BEFORE_CHANGE"]:
swap_tool_change_order = True
current_location.update(Path.Command("G0", {"X": -1, "Y": -1, "Z": -1, "F": 0.0}).Parameters)
adaptive_op_variables = determine_adaptive_op(values, pathobj)

Expand Down Expand Up @@ -729,13 +729,18 @@ def parse_a_path(values: Values, gcode: Gcode, pathobj) -> None:

if command_line:
if command in ("M6", "M06") and swap_tool_change_order:
swapped_command_line = [command_line[1], command_line[0]] # swap the order of the commands
swapped_command_line = [
command_line[1],
command_line[0],
] # swap the order of the commands
# Add a line number to the front and a newline to the end of the command line
gcode += f"{linenumber(values)}{format_command_line(values, swapped_command_line)}{nl}"
gcode += (
f"{linenumber(values)}{format_command_line(values, swapped_command_line)}{nl}"
)
else:
# Add a line number to the front and a newline to the end of the command line
gcode += f"{linenumber(values)}{format_command_line(values, command_line)}{nl}"

check_for_tlo(values, gcode, command, c.Parameters)
check_for_machine_specific_commands(values, gcode, command)

Expand Down

0 comments on commit 2d644a2

Please sign in to comment.