diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 7eda94083..0de0ee4bb 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -2245,6 +2245,31 @@ GUI_App::~GUI_App() BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": exit"); } +bool GUI_App::is_blocking_printing(MachineObject *obj_) +{ + DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager(); + if (!dev) return true; + std::string target_model; + if (obj_ == nullptr) { + auto obj_ = dev->get_selected_machine(); + target_model = obj_->printer_type; + } else { + target_model = obj_->printer_type; + } + + PresetBundle *preset_bundle = wxGetApp().preset_bundle; + std::string source_model = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle); + + if (source_model != target_model) { + std::vector compatible_machine = dev->get_compatible_machine(target_model); + vector::iterator it = find(compatible_machine.begin(), compatible_machine.end(), source_model); + if (it == compatible_machine.end()) { + return true; + } + } + return false; +} + // If formatted for github, plaintext with OpenGL extensions enclosed into
. // Otherwise HTML formatted for the system info dialog. std::string GUI_App::get_gl_info(bool for_github) diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 7c3b2edac..b2bc97bbd 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -331,6 +331,7 @@ public: void show_message_box(std::string msg) { wxMessageBox(msg); } EAppMode get_app_mode() const { return m_app_mode; } Slic3r::DeviceManager* getDeviceManager() { return m_device_manager; } + bool is_blocking_printing(MachineObject *obj_ = nullptr); Slic3r::TaskManager* getTaskManager() { return m_task_manager; } HMSQuery* get_hms_query() { return hms_query; } NetworkAgent* getAgent() { return m_agent; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f35790405..72914fdeb 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -15655,14 +15655,11 @@ bool Plater::is_same_printer_for_connected_and_selected() } if (!check_printer_initialized(obj,true)) return false; - std::string machine_print_name = obj->printer_type; - PresetBundle *preset_bundle = wxGetApp().preset_bundle; - std::string target_model_id = preset_bundle->printers.get_selected_preset().get_printer_type(preset_bundle); Preset * machine_preset = get_printer_preset(obj); if (!machine_preset) return false; - if (machine_print_name != target_model_id) { + if (wxGetApp().is_blocking_printing()) { auto printer_name = get_selected_printer_name_in_combox(); // wxString(obj->get_preset_printer_model_name(machine_print_name)) pop_warning_and_go_to_device_page(printer_name, PrinterWarningType::INCONSISTENT, _L("Synchronize AMS Filament Information")); return false;