From 8cf5061fec5573d5fba592cf0135952e4109b1e8 Mon Sep 17 00:00:00 2001 From: tao wang Date: Sat, 2 Mar 2024 16:36:58 +0800 Subject: [PATCH] FIX:Fixed HMS issue jira:[STUDIO-6344 STUDIO-6310 STUDIO-6356 STUDIO-6348] Change-Id: I9d6660e7c349775004b69bfe41b651bfa8b359b7 --- src/slic3r/GUI/HMSPanel.cpp | 11 +++++++---- src/slic3r/GUI/Monitor.cpp | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/HMSPanel.cpp b/src/slic3r/GUI/HMSPanel.cpp index fbe462e1b..88afb2a45 100644 --- a/src/slic3r/GUI/HMSPanel.cpp +++ b/src/slic3r/GUI/HMSPanel.cpp @@ -225,9 +225,9 @@ void HMSPanel::update(MachineObject *obj) } } - for (auto thms : temp_hms_list) { - auto key = thms.second.get_long_error_code(); - auto inr = false; + for (auto it = temp_hms_list.begin(); it != temp_hms_list.end(); ) { + auto key = it->second.get_long_error_code(); + bool inr = false; for (auto hms : obj->hms_list) { if (hms.get_long_error_code() == key) { inr = true; @@ -236,7 +236,10 @@ void HMSPanel::update(MachineObject *obj) } if (!inr) { - temp_hms_list.erase(key); + it = temp_hms_list.erase(it); + } + else { + ++it; } } diff --git a/src/slic3r/GUI/Monitor.cpp b/src/slic3r/GUI/Monitor.cpp index 8a365cf1b..e56644825 100644 --- a/src/slic3r/GUI/Monitor.cpp +++ b/src/slic3r/GUI/Monitor.cpp @@ -391,6 +391,8 @@ void MonitorPanel::update_all() if (!obj) { show_status((int)MONITOR_NO_PRINTER); + m_hms_panel->clear_hms_tag(); + m_tabpanel->GetBtnsListCtrl()->showNewTag(3, false); return; } @@ -416,7 +418,7 @@ void MonitorPanel::update_all() m_status_info_panel->update(obj); } - if (m_hms_panel->IsShown() || obj->hms_list.size() > 0) { + if (m_hms_panel->IsShown() || (obj->hms_list.size() != m_hms_panel->temp_hms_list.size())) { m_hms_panel->update(obj); }