From 5e8272b0cb1acfe571a3c371338edd0f877613e5 Mon Sep 17 00:00:00 2001 From: "xun.zhang" Date: Wed, 14 May 2025 13:08:37 +0800 Subject: [PATCH] FIX: support flush params in machine start GCode jira: NONE Signed-off-by: xun.zhang Change-Id: I7566b960421b088f1d122936d9bc3974057a1e6b (cherry picked from commit dd796026b3f869cfc40e8d9c5769c2a40e565441) --- src/libslic3r/GCode.cpp | 12 ++++++++++++ src/libslic3r/PrintConfig.cpp | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index dcb4b9a85e..005f0f5011 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2518,6 +2518,18 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato this->placeholder_parser().set("retraction_distances_when_ec", new ConfigOptionFloatsNullable(m_config.retraction_distances_when_ec)); this->placeholder_parser().set("long_retractions_when_ec",new ConfigOptionBoolsNullable(m_config.long_retractions_when_ec)); + auto flush_v_speed = m_config.filament_flush_volumetric_speed.values; + auto flush_temps = m_config.filament_flush_temp.values; + for (size_t idx = 0; idx < flush_v_speed.size(); ++idx) { + if (flush_v_speed[idx] == 0) + flush_v_speed[idx] = m_config.filament_max_volumetric_speed.get_at(idx); + } + for (size_t idx = 0; idx < flush_temps.size(); ++idx) { + if (flush_temps[idx] == 0) + flush_temps[idx] = m_config.nozzle_temperature_range_high.get_at(idx); + } + this->placeholder_parser().set("flush_volumetric_speeds", new ConfigOptionFloats(flush_v_speed)); + this->placeholder_parser().set("flush_temperatures", new ConfigOptionInts(flush_temps)); //Set variable for total layer count so it can be used in custom gcode. this->placeholder_parser().set("total_layer_count", m_layer_count); // Useful for sequential prints. diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index e8a614e051..341d2ae55c 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2178,7 +2178,7 @@ void PrintConfigDef::init_fff_params() def = this->add("filament_flush_temp", coInts); def->label = L("Flush temperature"); - def->tooltip = L("temperature when flushing filament"); + def->tooltip = L("temperature when flushing filament. 0 indicates the upper bound of the recommended nozzle temperature range"); def->mode = comAdvanced; def->nullable = true; def->min = 0; @@ -2187,7 +2187,7 @@ void PrintConfigDef::init_fff_params() def = this->add("filament_flush_volumetric_speed", coFloats); def->label = L("Flush volumetric speed"); - def->tooltip = L("Volumetric speed when flushing filament"); + def->tooltip = L("Volumetric speed when flushing filament. 0 indicates the max volumetric speed"); def->mode = comAdvanced; def->nullable = true; def->min = 0;