From 4bb8c6b373a037a03f66caf11428478b82b6eb79 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Tue, 30 Jan 2024 18:16:38 +0800 Subject: [PATCH] FIX: not load printer files when it's busy Change-Id: Ie5a58befcfc0d7fa0d4e587e8429c0b1bfeff72a Jira: STUDIO-6105 --- src/slic3r/GUI/MediaFilePanel.cpp | 7 +++++++ src/slic3r/GUI/MediaFilePanel.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/slic3r/GUI/MediaFilePanel.cpp b/src/slic3r/GUI/MediaFilePanel.cpp index fe6d3e32e..945c48f3a 100644 --- a/src/slic3r/GUI/MediaFilePanel.cpp +++ b/src/slic3r/GUI/MediaFilePanel.cpp @@ -209,6 +209,7 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj) m_lan_ip = obj->dev_ip; m_lan_passwd = obj->get_access_code(); m_dev_ver = obj->get_ota_version(); + m_device_busy = obj->is_camera_busy_off(); m_sdcard_exist = obj->has_sdcard(); m_local_support = obj->file_local; m_remote_support = obj->file_remote; @@ -219,6 +220,7 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj) m_lan_passwd.clear(); m_dev_ver.clear(); m_sdcard_exist = false; + m_device_busy = false; m_local_support = false; m_remote_support = false; m_model_download_support = false; @@ -445,6 +447,11 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr wfs) fs->SetUrl("0"); return; } + if (m_device_busy) { + m_image_grid->SetStatus(m_bmp_failed, _L("The printer is currently busy downloading. Please try again after it finishes.")); + fs->SetUrl("0"); + return; + } m_waiting_support = false; if ((m_lan_mode || !m_remote_support) && m_local_support && !m_lan_ip.empty()) { std::string url = "bambu:///local/" + m_lan_ip + ".?port=6000&user=" + m_lan_user + "&passwd=" + m_lan_passwd + diff --git a/src/slic3r/GUI/MediaFilePanel.h b/src/slic3r/GUI/MediaFilePanel.h index 295a0f1a3..baeeccc52 100644 --- a/src/slic3r/GUI/MediaFilePanel.h +++ b/src/slic3r/GUI/MediaFilePanel.h @@ -87,6 +87,7 @@ private: bool m_local_support = false; bool m_remote_support = false; bool m_model_download_support = false; + bool m_device_busy = false; bool m_waiting_enable = false; bool m_waiting_support = false;