From b1d020b5e80b792a08d68708f99912a196f09016 Mon Sep 17 00:00:00 2001 From: tao wang Date: Mon, 10 Feb 2025 19:46:33 +0800 Subject: [PATCH] ENH:disable printing when mapping is invalid jira:[STUDIO-10250] Change-Id: Ie14e601db9c844e7b23fd0f1e1fd688c03999144 (cherry picked from commit 2c433396fabd6239e9fbe6053f4b2fcd79a0d241) --- src/slic3r/GUI/SelectMachine.cpp | 18 ++++++++++++++---- src/slic3r/GUI/SelectMachine.hpp | 3 ++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index bfb873a766..d2f7d68aab 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1767,6 +1767,8 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector 0) @@ -3224,6 +3226,17 @@ void SelectMachineDialog::update_show_status() } } + + // disable print when there is no mapping + if (obj_->m_extder_data.total_extder_count > 1) { + for (auto mres : m_ams_mapping_result) { + if (mres.ams_id.empty() && mres.slot_id.empty()) { + show_status(PrintDialogStatus::PrintStatusInvalidMapping); + return; + } + } + } + // no ams if (!obj_->has_ams() || m_checkbox_list["use_ams"]->getValue() != "on") { if (!has_tips(obj_)) { @@ -3250,10 +3263,6 @@ void SelectMachineDialog::update_show_status() return; } - //if (m_ams_mapping_result.empty()) { - // do_ams_mapping(obj_); - //} - const auto& full_config = wxGetApp().preset_bundle->full_config(); size_t nozzle_nums = full_config.option("nozzle_diameter")->values.size(); @@ -4499,6 +4508,7 @@ std::string SelectMachineDialog::get_print_status_info(PrintDialogStatus status) case PrintStatusUnsupportedPrinter: return "PrintStatusUnsupportedPrinter"; case PrintStatusTimelapseNoSdcard: return "PrintStatusTimelapseNoSdcard"; case PrintStatusNotSupportedPrintAll: return "PrintStatusNotSupportedPrintAll"; + case PrintStatusInvalidMapping: return "PrintStatusInvalidMapping"; } return "unknown"; } diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 62e1e87d79..301cbe9d89 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -103,7 +103,8 @@ enum PrintDialogStatus { PrintStatusTimelapseWarning, PrintStatusMixAmsAndVtSlotWarning, PrintStatusPublicInitFailed, - PrintStatusPublicUploadFiled + PrintStatusPublicUploadFiled, + PrintStatusInvalidMapping };