diff --git a/src/slic3r/GUI/HMS.cpp b/src/slic3r/GUI/HMS.cpp index 63ce64cb21..e5fc020a3f 100644 --- a/src/slic3r/GUI/HMS.cpp +++ b/src/slic3r/GUI/HMS.cpp @@ -150,9 +150,12 @@ wxString HMSQuery::query_hms_msg(std::string long_error_code) if (m_hms_json.contains("device_hms")) { if (m_hms_json["device_hms"].contains(lang_code)) { for (auto item = m_hms_json["device_hms"][lang_code].begin(); item != m_hms_json["device_hms"][lang_code].end(); item++) { - if (item->contains("ecode") && (*item)["ecode"].get() == long_error_code) { - if (item->contains("intro")) { - return wxString::FromUTF8((*item)["intro"].get()); + if (item->contains("ecode")) { + std::string temp_string = (*item)["ecode"].get(); + if (boost::to_upper_copy(temp_string) == long_error_code) { + if (item->contains("intro")) { + return wxString::FromUTF8((*item)["intro"].get()); + } } } } diff --git a/src/slic3r/GUI/HMSPanel.cpp b/src/slic3r/GUI/HMSPanel.cpp index 07e0bdce5e..ab5ea78a67 100644 --- a/src/slic3r/GUI/HMSPanel.cpp +++ b/src/slic3r/GUI/HMSPanel.cpp @@ -148,7 +148,13 @@ HMSPanel::~HMSPanel() { void HMSPanel::append_hms_panel(HMSItem& item) { m_notify_item = new HMSNotifyItem(m_scrolledWindow, item); - m_top_sizer->Add(m_notify_item, 0, wxALIGN_CENTER_HORIZONTAL); + wxString msg = wxGetApp().get_hms_query()->query_hms_msg(item.get_long_error_code()); + if (!msg.empty()) + m_top_sizer->Add(m_notify_item, 0, wxALIGN_CENTER_HORIZONTAL); + else { + // debug for hms display error info + m_top_sizer->Add(m_notify_item, 0, wxALIGN_CENTER_HORIZONTAL); + } } void HMSPanel::delete_hms_panels() {