diff options
author | Vojtech Bubnik <bubnikv@gmail.com> | 2021-04-12 12:06:09 +0300 |
---|---|---|
committer | Vojtech Bubnik <bubnikv@gmail.com> | 2021-04-12 12:06:09 +0300 |
commit | 978c3a6c8984bdf7d852bd071718e70ee11e0063 (patch) | |
tree | 5e62926a8c962c7b6d5ccb1c1a1c2c525bafe4a9 /src/libslic3r/PrintBase.cpp | |
parent | 580d739d6f377fcf76456051e1816aae2fb35bad (diff) | |
parent | fcabe8a0f47807bb7efff3fdcecf35c49d02556b (diff) |
Merge tag 'version_2.3.0' into stable
version_2.3.0
Diffstat (limited to 'src/libslic3r/PrintBase.cpp')
-rw-r--r-- | src/libslic3r/PrintBase.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libslic3r/PrintBase.cpp b/src/libslic3r/PrintBase.cpp index 81affe04d..fb5e102c1 100644 --- a/src/libslic3r/PrintBase.cpp +++ b/src/libslic3r/PrintBase.cpp @@ -1,3 +1,4 @@ +#include "Exception.hpp" #include "PrintBase.hpp" #include <boost/filesystem.hpp> @@ -68,7 +69,7 @@ std::string PrintBase::output_filename(const std::string &format, const std::str filename = boost::filesystem::change_extension(filename, default_ext); return filename.string(); } catch (std::runtime_error &err) { - throw std::runtime_error(L("Failed processing of the output_filename_format template.") + "\n" + err.what()); + throw Slic3r::PlaceholderParserError(L("Failed processing of the output_filename_format template.") + "\n" + err.what()); } } @@ -88,6 +89,14 @@ std::string PrintBase::output_filepath(const std::string &path, const std::strin return path; } +void PrintBase::status_update_warnings(ObjectID object_id, int step, PrintStateBase::WarningLevel /* warning_level */, const std::string &message) +{ + if (this->m_status_callback) + m_status_callback(SlicingStatus(*this, step)); + else if (! message.empty()) + printf("%s warning: %s\n", (object_id == this->id()) ? "print" : "print object", message.c_str()); +} + tbb::mutex& PrintObjectBase::state_mutex(PrintBase *print) { return print->state_mutex(); @@ -98,4 +107,9 @@ std::function<void()> PrintObjectBase::cancel_callback(PrintBase *print) return print->cancel_callback(); } +void PrintObjectBase::status_update_warnings(PrintBase *print, int step, PrintStateBase::WarningLevel warning_level, const std::string &message) +{ + print->status_update_warnings(this->id(), step, warning_level, message); +} + } // namespace Slic3r |