FIX: [STUDIO-2940] prefer use remote tunnel for liveview

Change-Id: I23708989e6d5ab38724e5da2cff2fe9d648bf730
This commit is contained in:
chunmao.guo 2023-05-18 12:27:16 +08:00 committed by Lane.Wei
parent f8bc0fd2d2
commit 3dc94b6f12
3 changed files with 3 additions and 3 deletions

View File

@ -2373,7 +2373,7 @@ bool MachineObject::is_camera_busy_off()
int MachineObject::get_local_camera_proto() int MachineObject::get_local_camera_proto()
{ {
if (!is_function_supported(PrinterFunction::FUNC_REMOTE_TUNNEL)) return 0; if (!is_function_supported(PrinterFunction::FUNC_LOCAL_TUNNEL)) return 0;
return local_camera_proto; return local_camera_proto;
} }

View File

@ -411,7 +411,7 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
return; return;
} }
m_waiting_enable = false; m_waiting_enable = false;
if (m_local_support && !m_lan_ip.empty()) { 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; std::string url = "bambu:///local/" + m_lan_ip + ".?port=6000&user=" + m_lan_user + "&passwd=" + m_lan_passwd;
fs->SetUrl(url); fs->SetUrl(url);
return; return;

View File

@ -152,7 +152,7 @@ void MediaPlayCtrl::Play()
NetworkAgent *agent = wxGetApp().getAgent(); NetworkAgent *agent = wxGetApp().getAgent();
std::string agent_version = agent ? agent->get_version() : ""; std::string agent_version = agent ? agent->get_version() : "";
if (m_lan_proto && !m_disable_lan && !m_lan_ip.empty() && (!m_lan_mode || !m_lan_passwd.empty())) { if (m_lan_proto && (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 m_disable_lan = m_remote_support && !m_lan_mode; // try remote next time
if (m_lan_proto == 1) 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; m_url = "bambu:///local/" + m_lan_ip + ".?port=6000&user=" + m_lan_user + "&passwd=" + m_lan_passwd + "&device=" + m_machine + "&version=" + agent_version;