FIX: Should not sync when machine types are inconsistent

jira: none
Change-Id: If769fe0d19fb06c4a70e616416bf28f194ebcd45
(cherry picked from commit 8360bd24735073f5882ab014cd80a30d93238ebc)
This commit is contained in:
zhimin.zeng 2024-09-27 19:49:21 +08:00 committed by Noisyfox
parent 454002d65c
commit b0329ac88d
2 changed files with 15 additions and 1 deletions

View file

@ -2025,9 +2025,22 @@ void Sidebar::sync_extruder_list()
p->sync_extruder_list();
}
bool Sidebar::should_sync_extruder_list(MachineObject *obj)
{
if (obj && obj->is_connected() && obj->is_multi_extruders() && wxGetApp().plater()->is_multi_extruder_ams_empty()) {
std::string machine_print_name = obj->printer_type;
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
std::string target_model_id = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
if (machine_print_name == target_model_id) {
return true;
}
}
return false;
}
void Sidebar::load_ams_list(std::string const &device, MachineObject* obj)
{
if (obj && obj->is_connected() && obj->is_multi_extruders() && wxGetApp().plater()->is_multi_extruder_ams_empty())
if (should_sync_extruder_list(obj))
sync_extruder_list();
std::map<int, DynamicPrintConfig> filament_ams_list = build_filament_ams_list(obj);

View file

@ -163,6 +163,7 @@ public:
std::map<int, DynamicPrintConfig> build_filament_ams_list(MachineObject* obj);
void sync_ams_list();
void sync_extruder_list();
bool should_sync_extruder_list(MachineObject* obj);
// Orca
void show_SEMM_buttons(bool bshow);
void update_dynamic_filament_list();