Fix duplicate G29 preparation time (#15274)

The time estimate added 260 s for every G29 on non-Bambu printers. Prusa MK4, MK4S and CORE One start G-code splits bed leveling across six G29 commands, so those printers showed about 26 extra minutes. The 260 s is now added once per G-code processing run. Bambu printers still only count a G29 inside an M622 J1 block, and their estimates are unchanged.

Fixes #15088
This commit is contained in:
TheLegendTubaGuy
2026-10-13 11:03:43 -05:00
committed by GitHub
parent 5c8a287b5e
commit 84feeaa587
3 changed files with 57 additions and 13 deletions
+7 -9
View File
@@ -3730,6 +3730,7 @@ void GCodeProcessor::reset()
m_detect_layer_based_on_tag = false;
m_seams_count = 0;
m_g29_time_added = false;
m_preheat_time = 0.f;
m_preheat_steps = 1;
}
@@ -6131,15 +6132,12 @@ void GCodeProcessor::process_G4(const GCodeReader::GCodeLine& line)
//BBS
void GCodeProcessor::process_G29(const GCodeReader::GCodeLine& line)
{
//BBS: hardcode 260 seconds for G29
//Todo: use a machine related setting when we have second kind of BBL printer
const float value_s = 260.0;
if (s_IsBBLPrinter){
if(m_measure_g29_time)
simulate_st_synchronize(value_s);
}
else{
simulate_st_synchronize(value_s);
// Firmware may split one bed-leveling sequence across multiple G29 subcommands.
constexpr float g29_time = 260.0f;
const bool should_add_time = !s_IsBBLPrinter || m_measure_g29_time;
if (should_add_time && !m_g29_time_added) {
simulate_st_synchronize(g29_time);
m_g29_time_added = true;
}
}