From cd5566aee5b859c27369bee4e7638cf31f3b3277 Mon Sep 17 00:00:00 2001 From: hemai Date: Wed, 9 Jul 2025 19:27:03 +0800 Subject: [PATCH] FIX: disable multi-color with ext when ams enable Jira: [STUDIO-13290] Change-Id: I36f83a90959ba759e0616afe7b515dbd716b1020 (cherry picked from commit 5a4ec1f3a4175a927c37cea1577e6b276daa0f3c) --- src/slic3r/GUI/SelectMachine.cpp | 50 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 37c5971101..8aad2b4b56 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -2266,8 +2266,32 @@ void SelectMachineDialog::update_option_opts(MachineObject *obj) update_options_layout(); } +static bool _HasExt(const std::vector &ams_mapping_result) { + if (ams_mapping_result.empty()) { + return true; + }; + + for (const auto &info : ams_mapping_result) { + if (info.ams_id == VIRTUAL_AMS_MAIN_ID_STR || info.ams_id == VIRTUAL_AMS_DEPUTY_ID_STR && !info.ams_id.empty()) { + return true; + } + } + + return false; +} + +static bool _HasAms(const std::vector &ams_mapping_result) { + for (const auto &info : ams_mapping_result) { + if (info.ams_id != VIRTUAL_AMS_MAIN_ID_STR && info.ams_id != VIRTUAL_AMS_DEPUTY_ID_STR && !info.ams_id.empty()) { + return true; + } + } + + return false; +} + bool SelectMachineDialog::is_enable_external_change_assist(std::vector& ams_mapping_result) { - if (m_print_job && m_print_job->task_use_ams) return false; + if (_HasAms(ams_mapping_result)) return false; std::map v_ams_map; v_ams_map[VIRTUAL_AMS_MAIN_ID_STR] = 0; @@ -2339,30 +2363,6 @@ void SelectMachineDialog::Enable_Auto_Refill(bool enable) m_ams_backup_tip->Refresh(); } -static bool _HasExt(const std::vector &ams_mapping_result) { - if (ams_mapping_result.empty()) { - return true; - }; - - for (const auto &info : ams_mapping_result) { - if (info.ams_id == VIRTUAL_AMS_MAIN_ID_STR || info.ams_id == VIRTUAL_AMS_DEPUTY_ID_STR && !info.ams_id.empty()) { - return true; - } - } - - return false; -} - -static bool _HasAms(const std::vector &ams_mapping_result) { - for (const auto &info : ams_mapping_result) { - if (info.ams_id != VIRTUAL_AMS_MAIN_ID_STR && info.ams_id != VIRTUAL_AMS_DEPUTY_ID_STR && !info.ams_id.empty()) { - return true; - } - } - - return false; -} - void SelectMachineDialog::on_send_print() { BOOST_LOG_TRIVIAL(info) << "print_job: on_ok to send";