NEW:support displaying new HMS error message

jira:[hms ]

Change-Id: I99c2877eba5476f2f5ee25636ebea2923c6aafdb
(cherry picked from commit 512ac4b6c18a3623a4197213c8e879b450023cf9)
(cherry picked from commit d4187d91e7b5f1b1da24b1e9331a140c58dd2702)
This commit is contained in:
tao wang 2024-12-12 21:16:19 +08:00 committed by Noisyfox
parent fa7e866730
commit 5be8b62cd4
3 changed files with 72 additions and 24 deletions

View file

@ -6675,6 +6675,21 @@ bool DeviceManager::set_selected_machine(std::string dev_id, bool need_disconnec
auto my_machine_list = get_my_machine_list();
auto it = my_machine_list.find(dev_id);
/*update hms file*/
try {
Slic3r::GUI::wxGetApp().CallAfter([=] {
if (Slic3r::GUI::wxGetApp().get_hms_query()) {
std::string dev_type = dev_id.substr(0, 3);
if (!Slic3r::GUI::wxGetApp().get_hms_query()->check_local_file(dev_type)) {
Slic3r::GUI::wxGetApp().get_hms_query()->check_hms_info(dev_type);
}
else {
Slic3r::GUI::wxGetApp().get_hms_query()->check_hms_info_from_local(dev_type);
}
};
});
} catch (...) {}
// disconnect last
auto last_selected = my_machine_list.find(selected_machine);
if (last_selected != my_machine_list.end()) {