mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Final adjustments to V2
- Add condition to check for self.start_y before appending undefined/non to the gcode - Move self.start_x and self.start_y def to the init()
This commit is contained in:
parent
e9f1be7b6b
commit
20847a0b33
1 changed files with 3 additions and 3 deletions
|
@ -56,6 +56,8 @@ class PurgeLinesAndUnload_V2(Script):
|
||||||
self.machine_right = self.machine_width - 1.0
|
self.machine_right = self.machine_width - 1.0
|
||||||
self.machine_front = 1.0
|
self.machine_front = 1.0
|
||||||
self.machine_back = self.machine_depth - 1.0
|
self.machine_back = self.machine_depth - 1.0
|
||||||
|
self.start_x = None
|
||||||
|
self.start_y = None
|
||||||
|
|
||||||
def initialize(self) -> None:
|
def initialize(self) -> None:
|
||||||
super().initialize()
|
super().initialize()
|
||||||
|
@ -352,7 +354,7 @@ class PurgeLinesAndUnload_V2(Script):
|
||||||
add_move("Y", self.machine_back)
|
add_move("Y", self.machine_back)
|
||||||
else:
|
else:
|
||||||
add_move("Y", self.machine_front)
|
add_move("Y", self.machine_front)
|
||||||
if len(moves) <= 1:
|
if len(moves) == 1 and self.start_y:
|
||||||
moves.append(f"G0 F{self.speed_travel} Y{self.start_y} ; Move to start Y\n")
|
moves.append(f"G0 F{self.speed_travel} Y{self.start_y} ; Move to start Y\n")
|
||||||
# Combine moves into a single G-code string or return a comment if no movement is needed
|
# Combine moves into a single G-code string or return a comment if no movement is needed
|
||||||
return "".join(moves) if len(moves) > 1 else f";----------[Already at {location_name}, No Moves necessary]\n"
|
return "".join(moves) if len(moves) > 1 else f";----------[Already at {location_name}, No Moves necessary]\n"
|
||||||
|
@ -707,8 +709,6 @@ class PurgeLinesAndUnload_V2(Script):
|
||||||
|
|
||||||
# Travel moves around the bed periphery to keep strings from crossing the footprint of the model.
|
# Travel moves around the bed periphery to keep strings from crossing the footprint of the model.
|
||||||
def _move_to_start(self, data: str) -> str:
|
def _move_to_start(self, data: str) -> str:
|
||||||
self.start_x = None
|
|
||||||
self.start_y = None
|
|
||||||
move_str = None
|
move_str = None
|
||||||
layer = data[2].split("\n")
|
layer = data[2].split("\n")
|
||||||
for line in layer:
|
for line in layer:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue