mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 10:02:12 +00:00
Fix initial filament loading (#11350)
* Fix initial filament loading for non-bbl printers (SoftFever/OrcaSlicer#11218) * Add missing initial PA for bbl printers * Reset APA after toolchange https://github.com/SoftFever/OrcaSlicer/pull/5609#issuecomment-3532029620
This commit is contained in:
@@ -2810,16 +2810,25 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||||||
m_writer.set_current_position_clear(false);
|
m_writer.set_current_position_clear(false);
|
||||||
m_start_gcode_filament = GCodeProcessor::get_gcode_last_filament(machine_start_gcode);
|
m_start_gcode_filament = GCodeProcessor::get_gcode_last_filament(machine_start_gcode);
|
||||||
|
|
||||||
m_writer.init_extruder(initial_non_support_extruder_id);
|
if (is_bbl_printers) {
|
||||||
// add the missing filament start gcode in machine start gcode
|
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)));
|
DynamicConfig config;
|
||||||
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
config.set_key_value("filament_extruder_id", new ConfigOptionInt((int)(initial_non_support_extruder_id)));
|
||||||
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,&config);
|
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
||||||
file.writeln(filament_start_gcode);
|
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,&config);
|
||||||
// mark the first filament used in print
|
file.writeln(filament_start_gcode);
|
||||||
file.write_format(";VT%d\n", initial_extruder_id);
|
// mark the first filament used in print
|
||||||
|
file.write_format(";VT%d\n", initial_extruder_id);
|
||||||
|
}
|
||||||
|
// Orca: add missing PA settings for initial filament
|
||||||
|
if (m_config.enable_pressure_advance.get_at(initial_non_support_extruder_id)) {
|
||||||
|
file.write(m_writer.set_pressure_advance(m_config.pressure_advance.get_at(initial_non_support_extruder_id)));
|
||||||
|
// Orca: Adaptive PA
|
||||||
|
// Reset Adaptive PA processor last PA value
|
||||||
|
m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(initial_non_support_extruder_id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//flush FanMover buffer to avoid modifying the start gcode if it's manual.
|
//flush FanMover buffer to avoid modifying the start gcode if it's manual.
|
||||||
@@ -7352,6 +7361,9 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo
|
|||||||
|
|
||||||
if (m_config.enable_pressure_advance.get_at(new_filament_id)) {
|
if (m_config.enable_pressure_advance.get_at(new_filament_id)) {
|
||||||
gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id));
|
gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id));
|
||||||
|
// Orca: Adaptive PA
|
||||||
|
// Reset Adaptive PA processor last PA value
|
||||||
|
m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(new_filament_id));
|
||||||
}
|
}
|
||||||
//Orca: tool changer or IDEX's firmware may change Z position, so we set it to unknown/undefined
|
//Orca: tool changer or IDEX's firmware may change Z position, so we set it to unknown/undefined
|
||||||
m_last_pos_defined = false;
|
m_last_pos_defined = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user