Skip to content

Commit

Permalink
Update PurgeLinesAndUnload.py
Browse files Browse the repository at this point in the history
Change the comment line location from the end of data[1] to the first line of the "moves".

Update PurgeLinesAndUnload.py

Move the "start from" comment from the end of data[1] to the first line of the "moves" list.

Update PurgeLinesAndUnload.py

Change the comment line location from the end of data[1] to the first line of the "moves".
  • Loading branch information
GregValiant committed Jan 8, 2025
1 parent e754603 commit 28f8e2a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def execute(self, data):
else:
msg_text = "Open the Gcode file for preview in Cura. Make sure the 'Purge Lines' don't run underneath something else and are acceptable."
Message(title="[Purge Lines and Unload]", text=msg_text).show()
data[1] += self.data_str
return data

def _get_real_start_point(self, first_section: str) -> tuple:
Expand Down Expand Up @@ -327,8 +326,8 @@ def _move_to_location(self, location_name: str, location: tuple) -> str:
# Extract components
start_side, start_depth = self.end_purge_location
target_side, target_depth = location

moves = [f";MESH:NONMESH---------[Move to {location_name}]\nG0 F600 Z2 ; Move up\n"]
# Start of the moves and a comment to highlight the move
moves = [f";MESH:NONMESH---------[Circle around to {location_name}] Start from: {str(start_side)} {str(start_depth)} Go to: {target_side} {target_depth}\nG0 F600 Z2 ; Move up\n"]

# Helper function to add G-code for moves
def add_move(axis: str, position: float) -> None:
Expand All @@ -353,8 +352,6 @@ def add_move(axis: str, position: float) -> None:
add_move("X", self.machine_right)
else:
add_move("X", self.machine_left)
# Add a comment to highlight the move
self.data_str = "; start_side: " + str(start_side) + " | Start Depth: " + str(start_depth) + " | target_side: " + str(target_side) + " | target depth: " + str(target_depth) + "\n"
# Compare positions
if start_depth != target_depth:
if target_depth == Location.REAR:
Expand Down

0 comments on commit 28f8e2a

Please sign in to comment.