diff --git a/src/slic3r/GUI/HMSPanel.cpp b/src/slic3r/GUI/HMSPanel.cpp index 51abe401d..8494faa83 100644 --- a/src/slic3r/GUI/HMSPanel.cpp +++ b/src/slic3r/GUI/HMSPanel.cpp @@ -188,11 +188,11 @@ HMSPanel::~HMSPanel() { } void HMSPanel::append_hms_panel(const std::string& dev_id, HMSItem& item) { - m_notify_item = new HMSNotifyItem(dev_id, m_scrolledWindow, item); wxString msg = wxGetApp().get_hms_query()->query_hms_msg(dev_id, item.get_long_error_code()); - if (!msg.empty()) - m_top_sizer->Add(m_notify_item, 0, wxALIGN_CENTER_HORIZONTAL); - else { + if (!msg.empty()) { + HMSNotifyItem *notify_item = new HMSNotifyItem(dev_id, m_scrolledWindow, item); + m_top_sizer->Add(notify_item, 0, wxALIGN_CENTER_HORIZONTAL); + } else { // debug for hms display error info // m_top_sizer->Add(m_notify_item, 0, wxALIGN_CENTER_HORIZONTAL); BOOST_LOG_TRIVIAL(info) << "hms: do not display empty_item"; diff --git a/src/slic3r/GUI/HMSPanel.hpp b/src/slic3r/GUI/HMSPanel.hpp index 4883bc867..098fb2293 100644 --- a/src/slic3r/GUI/HMSPanel.hpp +++ b/src/slic3r/GUI/HMSPanel.hpp @@ -47,13 +47,13 @@ class HMSPanel : public wxPanel protected: wxScrolledWindow *m_scrolledWindow; wxBoxSizer * m_top_sizer; - HMSNotifyItem * m_notify_item; + int last_status; void append_hms_panel(const std::string& dev_id, HMSItem &item); void delete_hms_panels(); - + public: HMSPanel(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxTAB_TRAVERSAL); ~HMSPanel(); diff --git a/src/slic3r/GUI/Monitor.cpp b/src/slic3r/GUI/Monitor.cpp index 325c4a8ba..775eb5173 100644 --- a/src/slic3r/GUI/Monitor.cpp +++ b/src/slic3r/GUI/Monitor.cpp @@ -439,6 +439,12 @@ void MonitorPanel::update_all() void MonitorPanel::update_hms_tag() { for (auto hmsitem : m_hms_panel->temp_hms_list) { + + if (!obj) { break;} + + const wxString &msg = wxGetApp().get_hms_query()->query_hms_msg(obj->dev_id, hmsitem.second.get_long_error_code()); + if (msg.empty()){ continue;} /*STUDIO-10363 it's hidden message*/ + if (!hmsitem.second.already_read) { //show HMS new tag m_tabpanel->GetBtnsListCtrl()->showNewTag(3, true);