diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index c36fba9e0..f91e9bda6 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -374,14 +374,19 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename) ret += (boost::format("M73 P%1% R%2%\n") % std::to_string((line == First_Line_M73_Placeholder_Tag) ? 0 : 100) % std::to_string((line == First_Line_M73_Placeholder_Tag) ? time_in_minutes(machine.time) : 0)).str(); + } else if (machine.remaining_times_type == rtM73_Quiet) { + ret += (boost::format("M73 Q%1% S%2%\n") + % std::to_string((line == First_Line_M73_Placeholder_Tag) ? 0 : 100) + % std::to_string((line == First_Line_M73_Placeholder_Tag) ? time_in_minutes(machine.time) : 0)).str(); } else if (machine.remaining_times_type == rtM117) { - if((line == First_Line_M73_Placeholder_Tag)) - ret += (boost::format("M117 Time Left %1%h%2%m%3%s\n") + if ((line == First_Line_M73_Placeholder_Tag)) + ret += (boost::format("M117 Time Left %1%h%2%m%3%s\n") % std::to_string(int32_t(machine.time) / 3600) % std::to_string(int32_t(machine.time / 60) % 60) % std::to_string(int32_t(machine.time) % 60) ).str(); else ret += "M117 Time Left 0s\n"; } + //else none } } } @@ -439,6 +444,10 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename) export_line += (boost::format("M73 P%1% R%2%\n") % std::to_string(to_export.first) % std::to_string(to_export.second)).str(); + } else if (machine.remaining_times_type == rtM73_Quiet) { + export_line += (boost::format("M73 Q%1% S%2%\n") + % std::to_string(to_export.first) + % std::to_string(to_export.second)).str(); } else if (machine.remaining_times_type == rtM117) { export_line += (boost::format("M117 Time Left %1%h%2%m%3%s\n") % std::to_string(int32_t(machine.time - elapsed_time) / 3600) % std::to_string((int32_t(machine.time - elapsed_time) / 60) % 60) % std::to_string(int32_t(machine.time - elapsed_time) % 60) @@ -594,7 +603,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config) } m_time_processor.machines[static_cast(PrintEstimatedTimeStatistics::ETimeMode::Normal)].remaining_times_type = config.remaining_times_type.value; - m_time_processor.machines[static_cast(PrintEstimatedTimeStatistics::ETimeMode::Stealth)].remaining_times_type = config.remaining_times_type.value; + m_time_processor.machines[static_cast(PrintEstimatedTimeStatistics::ETimeMode::Stealth)].remaining_times_type = config.remaining_times_type.value == rtM73 ? rtM73_Quiet : rtNone; } @@ -794,7 +803,7 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) const ConfigOptionEnum* remaining_times_type = config.option>("remaining_times_type"); if (remaining_times_type) { m_time_processor.machines[static_cast(PrintEstimatedTimeStatistics::ETimeMode::Normal)].remaining_times_type = remaining_times_type->value; - m_time_processor.machines[static_cast(PrintEstimatedTimeStatistics::ETimeMode::Stealth)].remaining_times_type = remaining_times_type->value; + m_time_processor.machines[static_cast(PrintEstimatedTimeStatistics::ETimeMode::Stealth)].remaining_times_type = remaining_times_type->value == rtM73 ? rtM73_Quiet : rtNone; } } diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 0672cdced..a575f7a99 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -135,6 +135,8 @@ enum InfillConnection { enum RemainingTimeType { rtM117, rtM73, + rtM73_Quiet, + rtNone, }; enum SupportZDistanceType { @@ -342,7 +344,9 @@ template<> inline const t_config_enum_values& ConfigOptionEnum template<> inline const t_config_enum_values& ConfigOptionEnum::get_enum_values() { static const t_config_enum_values keys_map = { { "m117", rtM117 }, - { "m73", rtM73 } + { "m73", rtM73 }, + { "m73q", rtM73_Quiet }, + { "none", rtNone } }; return keys_map; }