FIX: fix the error wipe path

jira: none
Change-Id: I34af54711531b208049cbbc3883bca92328b9b5a
This commit is contained in:
zhimin.zeng 2025-03-20 15:16:33 +08:00 committed by lane.wei
parent 8e0bfca31e
commit da3819f52f
1 changed files with 4 additions and 2 deletions

View File

@ -688,6 +688,8 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
end_filament_gcode_str = nozzle_change_gcode_trans + end_filament_gcode_str;
}
end_filament_gcode_str = toolchange_retract_str + end_filament_gcode_str;
if (! change_filament_gcode.empty()) {
DynamicConfig config;
int old_filament_id = gcodegen.writer().filament() ? (int)gcodegen.writer().filament()->id() : -1;
@ -855,8 +857,6 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
std::string toolchange_unretract_str = gcodegen.unretract();
check_add_eol(toolchange_unretract_str);
toolchange_gcode_str = toolchange_retract_str + toolchange_gcode_str + toolchange_unretract_str;
gcodegen.placeholder_parser().set("current_extruder", new_filament_id);
gcodegen.placeholder_parser().set("retraction_distance_when_cut", gcodegen.m_config.retraction_distances_when_cut.get_at(new_filament_id));
gcodegen.placeholder_parser().set("long_retraction_when_cut", gcodegen.m_config.long_retractions_when_cut.get_at(new_filament_id));
@ -872,6 +872,8 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
check_add_eol(start_filament_gcode_str);
}
start_filament_gcode_str = start_filament_gcode_str + toolchange_unretract_str;
// Insert the end filament, toolchange, and start filament gcode into the generated gcode.
DynamicConfig config;
config.set_key_value("filament_end_gcode", new ConfigOptionString(end_filament_gcode_str));