Improve filament change time estimation for CC & CC2 printers and add purge length statistics. (#14663)

* Improve filament change time estimation for CC & CC2 printers and add purge length statistics.

* fix(gcode): route elegoo M6211 handling
This commit is contained in:
anjis
2026-07-08 20:48:32 +08:00
committed by GitHub
parent cab62070b5
commit cf86f20ae1
4 changed files with 209 additions and 1 deletions

View File

@@ -1839,7 +1839,8 @@ void GCodeProcessor::register_commands()
{"VM104", [this](const GCodeReader::GCodeLine& line) { process_VM104(line); }},
{"VM109", [this](const GCodeReader::GCodeLine& line) { process_VM109(line); }},
{"M622", [this](const GCodeReader::GCodeLine& line) { process_M622(line);}},
{"M623", [this](const GCodeReader::GCodeLine& line) { process_M623(line);}}
{"M623", [this](const GCodeReader::GCodeLine& line) { process_M623(line);}},
{"M6211", [this](const GCodeReader::GCodeLine& line) { process_M6211(line); }}
};
std::unordered_set<std::string>early_quit_commands = {
@@ -1863,6 +1864,12 @@ void GCodeProcessor::register_commands()
}
}
void GCodeProcessor::process_M6211(const GCodeReader::GCodeLine& line)
{
if (boost::algorithm::istarts_with(m_printer_model, "elegoo"))
process_elegoo_M6211(line);
}
bool GCodeProcessor::check_multi_extruder_gcode_valid(const int extruder_size,
const Pointfs plate_printable_area,
const double plate_printable_height,
@@ -2027,6 +2034,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
m_parser.apply_config(config);
m_flavor = config.gcode_flavor;
m_printer_model = config.printer_model.value;
m_single_extruder_multi_material = config.single_extruder_multi_material;
@@ -2213,6 +2221,10 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
if (printer_settings_id != nullptr)
m_result.settings_ids.printer = printer_settings_id->value;
const ConfigOptionString* printer_model = config.option<ConfigOptionString>("printer_model");
if (printer_model != nullptr)
m_printer_model = printer_model->value;
// BBS
m_result.filaments_count = config.option<ConfigOptionFloats>("filament_diameter")->values.size();