FIX: support flush params in machine start GCode

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I7566b960421b088f1d122936d9bc3974057a1e6b
(cherry picked from commit dd796026b3f869cfc40e8d9c5769c2a40e565441)
This commit is contained in:
xun.zhang
2025-05-14 13:08:37 +08:00
committed by Noisyfox
parent 465f634988
commit 5e8272b0cb
2 changed files with 14 additions and 2 deletions

View File

@@ -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.

View File

@@ -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;