From 5e0e675f7d35c76135612b2d9c5dc279a7ad1c60 Mon Sep 17 00:00:00 2001 From: Dmytro Chystiakov Date: Fri, 12 Jan 2024 14:54:52 +0200 Subject: [PATCH] add: support gcode estimated printing time for klipper --- src/libslic3r/GCode/GCodeProcessor.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 0e634e750..61ea8226e 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -478,13 +478,18 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st PrintEstimatedStatistics::ETimeMode mode = static_cast(i); if (mode == PrintEstimatedStatistics::ETimeMode::Normal || machine.enabled) { char buf[128]; - //sprintf(buf, "; estimated printing time (%s mode) = %s\n", - // (mode == PrintEstimatedStatistics::ETimeMode::Normal) ? "normal" : "silent", - // get_time_dhms(machine.time).c_str()); - sprintf(buf, "; model printing time: %s; total estimated time: %s\n", - get_time_dhms(machine.time - machine.prepare_time).c_str(), - get_time_dhms(machine.time).c_str()); - ret += buf; + if (!print.is_BBL_Printer()) { + // Klipper estimator + sprintf(buf, "; estimated printing time (normal mode) = %s\n", + get_time_dhms(machine.time)); + ret += buf; + } else { + // BBS estimator + sprintf(buf, "; model printing time: %s; total estimated time: %s\n", + get_time_dhms(machine.time - machine.prepare_time).c_str(), + get_time_dhms(machine.time).c_str()); + ret += buf; + } } } }