FIX: Should not sync when machine types are inconsistent
jira: none Change-Id: If769fe0d19fb06c4a70e616416bf28f194ebcd45
This commit is contained in:
parent
14ceceb3d7
commit
8360bd2473
|
@ -2048,9 +2048,22 @@ void Sidebar::sync_extruder_list()
|
||||||
p->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)
|
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();
|
sync_extruder_list();
|
||||||
|
|
||||||
std::map<int, DynamicPrintConfig> filament_ams_list = build_filament_ams_list(obj);
|
std::map<int, DynamicPrintConfig> filament_ams_list = build_filament_ams_list(obj);
|
||||||
|
|
|
@ -151,6 +151,7 @@ public:
|
||||||
std::map<int, DynamicPrintConfig> build_filament_ams_list(MachineObject* obj);
|
std::map<int, DynamicPrintConfig> build_filament_ams_list(MachineObject* obj);
|
||||||
void sync_ams_list();
|
void sync_ams_list();
|
||||||
void sync_extruder_list();
|
void sync_extruder_list();
|
||||||
|
bool should_sync_extruder_list(MachineObject* obj);
|
||||||
|
|
||||||
ObjectList* obj_list();
|
ObjectList* obj_list();
|
||||||
ObjectSettings* obj_settings();
|
ObjectSettings* obj_settings();
|
||||||
|
|
Loading…
Reference in New Issue