From 1520215d996eea932353d3f2255808c61e185ab6 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Wed, 5 Jul 2023 11:00:49 +0800 Subject: [PATCH] FIX: delay start tunnel mqtt when deivce is busy Change-Id: Ied28a74a35d9be54aa55f157aff8352160d85535 --- src/slic3r/GUI/DeviceManager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 00c441609..bc9712461 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -2572,7 +2572,7 @@ bool MachineObject::is_support_print_with_timelapse() bool MachineObject::is_camera_busy_off() { - if (printer_type == "C11") + if (printer_type == "C11" || printer_type == "C12") return is_in_prepare() || is_in_upgrading(); return false; } @@ -4121,12 +4121,16 @@ int MachineObject::parse_json(std::string payload) } catch (...) {} - if (m_active_state == Active && !module_vers.empty() && check_version_valid()) { + if (m_active_state == Active && !module_vers.empty() && check_version_valid() + && !is_camera_busy_off()) { m_active_state = UpdateToDate; parse_version_func(); if (is_support_tunnel_mqtt && connection_type() != "lan") { m_agent->start_subscribe("tunnel"); } + } else if (m_active_state == UpdateToDate && is_camera_busy_off()) { + m_active_state = Active; + m_agent->stop_subscribe("tunnel"); } parse_state_changed_event();