diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 9b7ab6123..799f3e30e 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1376,10 +1376,10 @@ void MachineObject::parse_version_func() is_support_remote_tunnel = true; is_support_tunnel_mqtt = (ota_version->second.sw_ver.compare("01.04.01.04") >= 0 || (rv1126_version != module_vers.end() && rv1126_version->second.sw_ver.compare("00.00.20.30") >= 0)); - local_camera_proto = (local_rtsp_url.empty() || local_rtsp_url == "disable") ? 0 - : boost::algorithm::starts_with(local_rtsp_url, "rtsps") ? 2 : 3; - file_proto = 2; } + local_camera_proto = local_rtsp_url.empty() ? -1 : local_rtsp_url == "disable" ? 0 + : boost::algorithm::starts_with(local_rtsp_url, "rtsps") ? 2 : 3; + file_proto = 2; } } else if (printer_type == "C11") { is_cloud_print_only = true; diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 943099123..b838036ef 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -697,7 +697,7 @@ public: std::string camera_resolution = ""; bool xcam_first_layer_inspector { false }; int xcam_first_layer_hold_count = 0; - int local_camera_proto = 0; + int local_camera_proto = -1; int file_proto = 0; std::string local_rtsp_url; std::string tutk_state; diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index 9937bc19c..9853b248a 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -89,7 +89,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj) } else { m_camera_exists = false; m_lan_mode = false; - m_lan_proto = 0; + m_lan_proto = -1; m_lan_ip.clear(); m_lan_passwd.clear(); m_tutk_state.clear(); @@ -154,7 +154,7 @@ void MediaPlayCtrl::Play() NetworkAgent *agent = wxGetApp().getAgent(); std::string agent_version = agent ? agent->get_version() : ""; - if (m_lan_proto && (m_lan_mode ||!m_remote_support) && !m_disable_lan && !m_lan_ip.empty()) { + if (m_lan_proto > 0 && (m_lan_mode ||!m_remote_support) && !m_disable_lan && !m_lan_ip.empty()) { m_disable_lan = m_remote_support && !m_lan_mode; // try remote next time if (m_lan_proto == 1) m_url = "bambu:///local/" + m_lan_ip + ".?port=6000&user=" + m_lan_user + "&passwd=" + m_lan_passwd + "&device=" + m_machine + "&version=" + agent_version; @@ -185,16 +185,16 @@ void MediaPlayCtrl::Play() m_failed_code = 1; if (m_lan_mode) { - Stop(m_lan_passwd.empty() - ? _L("Initialize failed (Not supported with LAN-only mode)!") - : _L("Initialize failed (Not accessible in LAN-only mode)!")); + Stop(m_lan_proto < 0 + ? _L("Initialize failed (Not supported on the current printer version)!") + : _L("Initialize failed (Not accessible in LAN-only mode)!")); return; } if (!m_remote_support) { // not support tutk Stop(m_lan_ip.empty() ? _L("Initialize failed (Missing LAN ip of printer)!") - : _L("Initialize failed (Not supported on the current printer version)!")); + : wxString()); return; } @@ -284,7 +284,7 @@ void MediaPlayCtrl::Stop(wxString const &msg) m_url.clear(); ++m_failed_retry; - if (m_failed_code != 0 && (!m_remote_support || m_lan_mode) && (m_failed_retry > 1 || m_user_triggered)) { + if (m_failed_code != 0 && last_state != wxMEDIASTATE_PLAYING && (!m_remote_support || m_lan_mode) && (m_failed_retry > 1 || m_user_triggered)) { m_next_retry = wxDateTime(); // stop retry if (wxGetApp().show_modal_ip_address_enter_dialog(_L("LAN Connection Failed (Failed to start liveview)"))) { m_failed_retry = 0; diff --git a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp index 0ac441e61..0378cc4ee 100644 --- a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp +++ b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp @@ -31,7 +31,8 @@ wxDEFINE_EVENT(EVT_FILE_CALLBACK, wxCommandEvent); static wxBitmap default_thumbnail; static std::map error_messages = { - {PrinterFileSystem::FILE_TYPE_ERR, L("Not supported on the current printer version.")} + {PrinterFileSystem::FILE_TYPE_ERR, L("Not supported on the current printer version.")}, + {PrinterFileSystem::STORAGE_UNAVAILABLE, L("Storage unavailable, insert SD card.")} }; struct StaticBambuLib : BambuLib { diff --git a/src/slic3r/GUI/Printer/PrinterFileSystem.h b/src/slic3r/GUI/Printer/PrinterFileSystem.h index 592cfc5b7..8caf720ce 100644 --- a/src/slic3r/GUI/Printer/PrinterFileSystem.h +++ b/src/slic3r/GUI/Printer/PrinterFileSystem.h @@ -51,6 +51,7 @@ public: FILE_READ_ERR = 14, FILE_CHECK_ERR = 15, FILE_TYPE_ERR = 16, + STORAGE_UNAVAILABLE = 17, };