ENH: remove the appended T cmd after change filament

Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: Id5da64626b7343a71dcb38c06f5b5caf43ec40e2
(cherry picked from commit 7da565f0582f470274d279e52daf0dd889f0de7d)
This commit is contained in:
qing.zhang
2024-06-13 16:03:24 +08:00
committed by Noisyfox
parent 95a5914c26
commit bba00b2e7a
4 changed files with 68 additions and 5 deletions

View File

@@ -1447,7 +1447,9 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
return;
BOOST_LOG_TRIVIAL(info) << boost::format("Will export G-code to %1% soon")%path;
GCodeProcessor::s_IsBBLPrinter = print->is_BBL_printer();
m_writer.set_is_bbl_machine(print->is_BBL_printer());
print->set_started(psGCodeExport);
// check if any custom gcode contains keywords used by the gcode processor to
@@ -6573,9 +6575,10 @@ std::string GCode::set_extruder(unsigned int extruder_id, double print_z, bool b
m_writer.reset_e();
}
// We inform the writer about what is happening, but we may not use the resulting gcode.
//BBS: don't add T[next extruder] if there is no T cmd on filament change
//We inform the writer about what is happening, but we may not use the resulting gcode.
std::string toolchange_command = m_writer.toolchange(extruder_id);
if (! custom_gcode_changes_tool(toolchange_gcode_parsed, m_writer.toolchange_prefix(), extruder_id))
if (!custom_gcode_changes_tool(toolchange_gcode_parsed, m_writer.toolchange_prefix(), extruder_id))
gcode += toolchange_command;
else {
// user provided his own toolchange gcode, no need to do anything