diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 7506a105d7..70e8a9d91d 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -4943,14 +4943,14 @@ void GCodeProcessor::run_post_process() // found an invalid value, clamp it to a valid one tool_number = std::clamp(0, m_extruder_temps_config.size() - 1, tool_number); // emit warning - std::string warning = _u8L("GCode Post-Processor encountered an invalid toolchange, maybe from a custom gcode:"); + std::string warning = "GCode Post-Processor encountered an invalid toolchange, maybe from a custom gcode:"; warning += "\n> "; warning += gcode_line; - warning += _u8L("Generated M104 lines may be incorrect."); + warning += "Generated M104 lines may be incorrect."; BOOST_LOG_TRIVIAL(error) << warning; // Orca todo - // if (m_print != nullptr) - // m_print->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, warning); + if (m_print != nullptr) + m_print->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, warning); } } export_lines.insert_lines( diff --git a/src/libslic3r/PrintBase.hpp b/src/libslic3r/PrintBase.hpp index aecef8a238..b680ac274e 100644 --- a/src/libslic3r/PrintBase.hpp +++ b/src/libslic3r/PrintBase.hpp @@ -583,7 +583,16 @@ public: bool is_step_done(PrintStepEnum step) const { return m_state.is_done(step, this->state_mutex()); } PrintStateBase::StateWithTimeStamp step_state_with_timestamp(PrintStepEnum step) const { return m_state.state_with_timestamp(step, this->state_mutex()); } PrintStateBase::StateWithWarnings step_state_with_warnings(PrintStepEnum step) const { return m_state.state_with_warnings(step, this->state_mutex()); } - + // Add a slicing warning to the active Print step and send a status notification. + // This method could be called multiple times between this->set_started() and this->set_done(). + void active_step_add_warning(PrintStateBase::WarningLevel warning_level, const std::string &message, + PrintStateBase::SlicingNotificationType message_id = PrintStateBase::SlicingDefaultNotification) + { + std::pair active_step = m_state.active_step_add_warning(warning_level, message, (int)message_id, this->state_mutex()); + if (active_step.second) + // Update UI. + this->status_update_warnings(static_cast(active_step.first), warning_level, message, nullptr, message_id); + } protected: bool set_started(PrintStepEnum step) { return m_state.set_started(step, this->state_mutex(), [this](){ this->throw_if_canceled(); }); } PrintStateBase::TimeStamp set_done(PrintStepEnum step) { @@ -605,16 +614,6 @@ protected: bool is_step_started_unguarded(PrintStepEnum step) const { return m_state.is_started_unguarded(step); } bool is_step_done_unguarded(PrintStepEnum step) const { return m_state.is_done_unguarded(step); } - // Add a slicing warning to the active Print step and send a status notification. - // This method could be called multiple times between this->set_started() and this->set_done(). - void active_step_add_warning(PrintStateBase::WarningLevel warning_level, const std::string &message, - PrintStateBase::SlicingNotificationType message_id = PrintStateBase::SlicingDefaultNotification) - { - std::pair active_step = m_state.active_step_add_warning(warning_level, message, (int)message_id, this->state_mutex()); - if (active_step.second) - // Update UI. - this->status_update_warnings(static_cast(active_step.first), warning_level, message, nullptr, message_id); - } private: PrintState m_state;