diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 730b8ca7a..871eb64af 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -2924,6 +2924,7 @@ void MachineObject::reset() BOOST_LOG_TRIVIAL(trace) << "reset dev_id=" << dev_id; last_update_time = std::chrono::system_clock::now(); m_push_count = 0; + m_full_msg_count = 0; is_220V_voltage = false; get_version_retry = 0; camera_recording = false; @@ -3028,7 +3029,7 @@ bool MachineObject::is_info_ready(bool check_version) const std::chrono::system_clock::time_point curr_time = std::chrono::system_clock::now(); auto diff = std::chrono::duration_cast(last_push_time - curr_time); - if (m_push_count > 0 && diff.count() < PUSHINFO_TIMEOUT) { + if (m_full_msg_count > 0 && m_push_count > 0 && diff.count() < PUSHINFO_TIMEOUT) { return true; } return false; @@ -3152,6 +3153,7 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) if (j_pre["print"]["msg"].get() == 0) { //all message BOOST_LOG_TRIVIAL(trace) << "static: get push_all msg, dev_id=" << dev_id; m_push_count++; + m_full_msg_count++; if (!printer_type.empty()) print_json.load_compatible_settings(printer_type, ""); print_json.diff2all_base_reset(j_pre); diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 33a7a58db..d6ac5fba9 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -891,6 +891,7 @@ public: std::vector stage_list_info; int stage_curr = 0; int m_push_count = 0; + int m_full_msg_count = 0; /*the full message count, there are full or diff messages from network*/ bool calibration_done { false }; bool is_axis_at_home(std::string axis); diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index 10d965f9f..58d48faa6 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -3030,6 +3030,7 @@ void AMSControl::CreateAmsDoubleNozzle() } if (m_ext_info.size() <= 1) { BOOST_LOG_TRIVIAL(trace) << "vt_slot empty!"; + assert(0); return; } AMSinfo ext_info;