diff --git a/src/libslic3r/PrintBase.hpp b/src/libslic3r/PrintBase.hpp index 94c732c0b..dc3fb64e9 100644 --- a/src/libslic3r/PrintBase.hpp +++ b/src/libslic3r/PrintBase.hpp @@ -236,8 +236,8 @@ public: virtual void process() = 0; - struct Status { - Status(int percent, const std::string &text, unsigned int flags = 0) : percent(percent), text(text), flags(flags) {} + struct SlicingStatus { + SlicingStatus(int percent, const std::string &text, unsigned int flags = 0) : percent(percent), text(text), flags(flags) {} int percent; std::string text; // Bitmap of flags. @@ -247,16 +247,16 @@ public: // Bitmap of FlagBits unsigned int flags; }; - typedef std::function status_callback_type; + typedef std::function status_callback_type; // Default status console print out in the form of percent => message. void set_status_default() { m_status_callback = nullptr; } // No status output or callback whatsoever, useful mostly for automatic tests. - void set_status_silent() { m_status_callback = [](const Status&){}; } + void set_status_silent() { m_status_callback = [](const SlicingStatus&){}; } // Register a custom status callback. void set_status_callback(status_callback_type cb) { m_status_callback = cb; } // Calls a registered callback to update the status, or print out the default message. void set_status(int percent, const std::string &message, unsigned int flags = 0) { - if (m_status_callback) m_status_callback(Status(percent, message, flags)); + if (m_status_callback) m_status_callback(SlicingStatus(percent, message, flags)); else printf("%d => %s\n", percent, message.c_str()); } diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.hpp b/src/slic3r/GUI/BackgroundSlicingProcess.hpp index 9cfaa4317..652d85487 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.hpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.hpp @@ -20,11 +20,11 @@ class SLAPrint; class SlicingStatusEvent : public wxEvent { public: - SlicingStatusEvent(wxEventType eventType, int winid, const PrintBase::Status &status) : + SlicingStatusEvent(wxEventType eventType, int winid, const PrintBase::SlicingStatus &status) : wxEvent(winid, eventType), status(std::move(status)) {} virtual wxEvent *Clone() const { return new SlicingStatusEvent(*this); } - PrintBase::Status status; + PrintBase::SlicingStatus status; }; wxDEFINE_EVENT(EVT_SLICING_UPDATE, SlicingStatusEvent); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 9a9038505..2d8e3544a 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1022,7 +1022,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) background_process.select_technology(this->printer_technology); // Register progress callback from the Print class to the Platter. - auto statuscb = [this](const Slic3r::PrintBase::Status &status) { + auto statuscb = [this](const Slic3r::PrintBase::SlicingStatus &status) { wxQueueEvent(this->q, new Slic3r::SlicingStatusEvent(EVT_SLICING_UPDATE, 0, status)); }; print.set_status_callback(statuscb); @@ -1883,7 +1883,7 @@ void Plater::priv::on_slicing_update(SlicingStatusEvent &evt) { this->statusbar()->set_progress(evt.status.percent); this->statusbar()->set_status_text(_(L(evt.status.text)) + wxString::FromUTF8("…")); - if (evt.status.flags & PrintBase::Status::RELOAD_SCENE) { + if (evt.status.flags & PrintBase::SlicingStatus::RELOAD_SCENE) { switch (this->printer_technology) { case ptFFF: if (this->preview != nullptr)