From 4b655f06d45310ddefc6ba2a9bfeba761e24e20b Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Thu, 10 Nov 2022 16:37:51 +0800 Subject: [PATCH] FIX: fix the total progress not correct issue Change-Id: I18b9d5034726b45c7331f1dae5e2b24c5e5bd170 (cherry picked from commit ba8c691a2c94f7a2f2ff0ce7f195de20a6c22573) --- src/BambuStudio.cpp | 17 +++++++++-------- src/slic3r/GUI/GUI_App.cpp | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/BambuStudio.cpp b/src/BambuStudio.cpp index 7899bc1db..caa57b25d 100644 --- a/src/BambuStudio.cpp +++ b/src/BambuStudio.cpp @@ -132,6 +132,7 @@ std::map cli_errors = { {CLI_EXPORT_3MF_ERROR, "Export 3mf error"}, {CLI_NO_SUITABLE_OBJECTS, "Found no objects in print volume to slice"}, {CLI_VALIDATE_ERROR, "Validate print error"}, + {CLI_OBJECTS_PARTLY_INSIDE, "Objects partly inside"}, {CLI_SLICING_ERROR, "Slice error"} }; @@ -193,9 +194,9 @@ typedef struct _cli_callback_mgr { //notify_message = "Plate "+ std::to_string(m_plate_index) + "/" +std::to_string(m_plate_count)+ ": Percent " + std::to_string(m_progress) + ": "+m_message; char pipe_message[PIPE_BUFFER_SIZE] = {0}; - strncpy(pipe_message, notify_message.c_str(), PIPE_BUFFER_SIZE); + sprintf(pipe_message, "%s\n", notify_message.c_str()); - int ret = write(m_pipe_fd, pipe_message,PIPE_BUFFER_SIZE); + int ret = write(m_pipe_fd, pipe_message, strlen(pipe_message)); BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ": write returns "<setup(debug_argc, debug_argv))*/ if (!this->setup(argc, argv)) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index d698e983a..16de370f5 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1753,14 +1753,23 @@ void GUI_App::init_networking_callbacks() GUI_App::~GUI_App() { - if (app_config != nullptr) + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": enter"); + if (app_config != nullptr) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": destroy app_config"); delete app_config; + } - if (preset_bundle != nullptr) + if (preset_bundle != nullptr) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": destroy preset_bundle"); delete preset_bundle; + } - if (preset_updater != nullptr) + if (preset_updater != nullptr) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": destroy preset updater"); delete preset_updater; + } + + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": exit"); } // If formatted for github, plaintext with OpenGL extensions enclosed into
. @@ -3271,7 +3280,7 @@ std::string GUI_App::handle_web_request(std::string cmd) CallAfter([this] { wxGetApp().request_user_logout(); }); - } + } else if (command_str.compare("homepage_modeldepot") == 0) { CallAfter([this] { wxGetApp().open_mall_page_dialog();