FIX: remove duplicated filament change

1.Remove duplicated filament change after machine start GCode
2.Add missing filament change after machine start gcode

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I97e1a3e8dc1ad39c95f763469086c2e360807288
This commit is contained in:
xun.zhang 2025-03-11 11:44:31 +08:00 committed by lane.wei
parent 38e784dd49
commit d61d0c7231
1 changed files with 12 additions and 2 deletions

View File

@ -2342,8 +2342,18 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
//BBS: gcode writer doesn't know where the real position of extruder is after inserting custom gcode
m_writer.set_current_position_clear(false);
m_start_gcode_filament = GCodeProcessor::get_gcode_last_filament(machine_start_gcode);
// mark the first filament used in print
file.write_format(";VT%d\n",initial_extruder_id);
m_writer.init_extruder(initial_non_support_extruder_id);
// add the missing filament start gcode in machine start gcode
{
DynamicConfig config;
config.set_key_value("filament_extruder_id", new ConfigOptionInt((int)(initial_non_support_extruder_id)));
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
std::string filament_start_gcode = this->placeholder_parser_process("filament_start_gcode", print.config().filament_start_gcode.values.at(initial_non_support_extruder_id), initial_non_support_extruder_id);
file.writeln(filament_start_gcode);
// mark the first filament used in print
file.write_format(";VT%d\n", initial_extruder_id);
}
// Process filament-specific gcode.
/* if (has_wipe_tower) {