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";