From dfd658c00c0b001bf24519fbf294d406c97bcb19 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Tue, 17 Jan 2023 17:38:41 +0800 Subject: [PATCH] Cherry pick some fixes from mainstream FIX: crush when slicer multi-color model the root cause is a mismatch between the dimensions of flush matrix and the number of extruders Change-Id: I3a4ca706cb24d9e5d33969b9e6f5b288e71bb8f2 (cherry picked from commit 7399037eaacdfd7d8407667a2e5a097757265254) FIX: fix crash when switch printer Change-Id: I7632689c5df07df0222a5fa529993e114d7c5b08 Signed-off-by: Stone Li ENH:close the amsmapping dialog when exit seletmachine dialog Change-Id: Ib49b1f9d08267c56b34d867edb40f287114479e1 ENH:no longer hide the unload button when connected to AMS Change-Id: I62c7195d590827bd189c6e6886e95c2cf755e203 FIX: fix the slicing result different issue when move volume in objects copied from other object the result is not correct Change-Id: Ieebc586f11c42429902d653e871c038d096783e8 FIX: support blocker not work on vertical+horizontal faces Jira: STUDIO-2088 Change-Id: I6803e8e90ebcc4c67d81473f60fdf97929011e12 (cherry picked from commit 738800c5af48ab8a2cde40b6f2b3c48a88bfee8b) FIX:fixed send print will crash when resources path is chinese path Change-Id: Ie4a5161f853dca691bd69e5695720d99148a0134 --- src/libslic3r/PresetBundle.cpp | 1 + src/libslic3r/Print.cpp | 2 ++ src/libslic3r/PrintObject.cpp | 2 +- src/slic3r/GUI/Jobs/SendJob.cpp | 7 +++++++ src/slic3r/GUI/Plater.cpp | 2 -- src/slic3r/GUI/SelectMachine.cpp | 3 +++ src/slic3r/GUI/StatusPanel.cpp | 14 +++++++++----- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 52a81e4111..da0ca312ca 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -2046,6 +2046,7 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool } this->update_compatible(PresetSelectCompatibleType::Never); + this->update_multi_material_filament_presets(); //BBS //const std::string &physical_printer = config.option("physical_printer_settings_id", true)->value; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 7b13b39505..2fa093c0e1 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1408,6 +1408,8 @@ void Print::process(bool use_cache) return false; if (model_volume1.mesh_ptr() != model_volume2.mesh_ptr()) return false; + if (!(model_volume1.get_transformation() == model_volume2.get_transformation())) + return false; has_extruder1 = model_volume1.config.has("extruder"); has_extruder2 = model_volume2.config.has("extruder"); if ((has_extruder1 != has_extruder2) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index ae510885c5..a58e14a288 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -2820,7 +2820,7 @@ void PrintObject::project_and_append_custom_facets( { // BBS: Approve adding enforcer support on vertical faces SlabSlicingConfig config; - config.isVertical = true; + config.isVertical = type == EnforcerBlockerType::ENFORCER ? true : false; for (const ModelVolume* mv : this->model_object()->volumes) if (mv->is_model_part()) { diff --git a/src/slic3r/GUI/Jobs/SendJob.cpp b/src/slic3r/GUI/Jobs/SendJob.cpp index d208558173..ebd4bce800 100644 --- a/src/slic3r/GUI/Jobs/SendJob.cpp +++ b/src/slic3r/GUI/Jobs/SendJob.cpp @@ -33,6 +33,13 @@ SendJob::SendJob(std::shared_ptr pri, Plater* plater, std::st void SendJob::prepare() { m_plater->get_print_job_data(&job_data); + if (&job_data) { + std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt"; + auto check_access_code_path = temp_file.c_str(); + BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path; + job_data._temp_path = fs::path(check_access_code_path); + } + } void SendJob::on_exception(const std::exception_ptr &eptr) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index ce14b127bb..0e213d8ff3 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6587,8 +6587,6 @@ void Plater::get_print_job_data(PrintPrepareData* data) data->plate_idx = p->m_print_job_data.plate_idx; data->_3mf_path = p->m_print_job_data._3mf_path; data->_3mf_config_path = p->m_print_job_data._3mf_config_path; - std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt"; - data->_temp_path = encode_path(temp_file.c_str()); } } diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index d7a0cda86b..884792b37e 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1933,6 +1933,9 @@ void SelectMachineDialog::init_timer() void SelectMachineDialog::on_cancel(wxCloseEvent &event) { + if (m_mapping_popup.IsShown()) + m_mapping_popup.Dismiss(); + if (m_print_job) { if (m_print_job->is_running()) { m_print_job->cancel(); diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 3160dfc320..6bc1bcfed8 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -1724,7 +1724,7 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj) { if (!obj) return; - if (obj->can_unload_filament()) { + /*if (obj->can_unload_filament()) { if (!m_button_unload->IsShown()) { m_button_unload->Show(); m_button_unload->GetParent()->Layout(); @@ -1734,7 +1734,7 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj) m_button_unload->Hide(); m_button_unload->GetParent()->Layout(); } - } + }*/ // update extruder icon update_extruder_status(obj); @@ -2212,8 +2212,11 @@ void StatusPanel::update_cloud_subtask(MachineObject *obj) if (is_task_changed(obj)) { reset_printing_values(); - BOOST_LOG_TRIVIAL(trace) << "monitor: change to sub task id = " << obj->subtask_->task_id; - if (web_request.IsOk()) web_request.Cancel(); + BOOST_LOG_TRIVIAL(info) << "monitor: change to sub task id = " << obj->subtask_->task_id; + if (web_request.IsOk() && web_request.GetState() == wxWebRequest::State_Active) { + BOOST_LOG_TRIVIAL(info) << "web_request: cancelled"; + web_request.Cancel(); + } m_start_loading_thumbnail = true; } @@ -2227,7 +2230,8 @@ void StatusPanel::update_cloud_subtask(MachineObject *obj) img = it->second; wxImage resize_img = img.Scale(m_bitmap_thumbnail->GetSize().x, m_bitmap_thumbnail->GetSize().y); m_bitmap_thumbnail->SetBitmap(resize_img); - task_thumbnail_state == ThumbnailState::TASK_THUMBNAIL; + task_thumbnail_state = ThumbnailState::TASK_THUMBNAIL; + BOOST_LOG_TRIVIAL(trace) << "web_request: use cache image"; } else { web_request = wxWebSession::GetDefault().CreateRequest(this, m_request_url); BOOST_LOG_TRIVIAL(trace) << "monitor: start request thumbnail, url = " << m_request_url;