From 47f7e09e84fffdbaef034046a800177b0f0f40c2 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Thu, 16 Jul 2026 15:21:35 +0800 Subject: [PATCH] Block TPU on the left extruder without firmware support --- resources/printers/O1D.json | 3 ++- resources/printers/O1E.json | 3 ++- src/slic3r/GUI/DeviceCore/DevConfigUtil.h | 1 + src/slic3r/GUI/DeviceManager.cpp | 4 +++ src/slic3r/GUI/DeviceManager.hpp | 1 + src/slic3r/GUI/PrePrintChecker.hpp | 1 + src/slic3r/GUI/SelectMachine.cpp | 30 +++++++++++++++++++++++ 7 files changed, 41 insertions(+), 2 deletions(-) diff --git a/resources/printers/O1D.json b/resources/printers/O1D.json index de3a16635f..809231736a 100644 --- a/resources/printers/O1D.json +++ b/resources/printers/O1D.json @@ -75,7 +75,8 @@ "support_extrusion_cali": false, "support_user_preset": false, "support_refresh_nozzle": true, - "support_ams_ext_mix_print": true + "support_ams_ext_mix_print": true, + "support_print_check_firmware_for_tpu_left": true }, "model_id": "O1D", "support_wrapping_detection": true, diff --git a/resources/printers/O1E.json b/resources/printers/O1E.json index 84e0806186..b5d332192b 100644 --- a/resources/printers/O1E.json +++ b/resources/printers/O1E.json @@ -75,7 +75,8 @@ "support_extrusion_cali": false, "support_user_preset": false, "support_refresh_nozzle": true, - "support_ams_ext_mix_print": true + "support_ams_ext_mix_print": true, + "support_print_check_firmware_for_tpu_left": true }, "model_id": "O1E", "auto_pa_cali_thumbnail_image": "fd_calibration_auto_multi_extruders", diff --git a/src/slic3r/GUI/DeviceCore/DevConfigUtil.h b/src/slic3r/GUI/DeviceCore/DevConfigUtil.h index f8f9b21199..1cb8e97a6e 100644 --- a/src/slic3r/GUI/DeviceCore/DevConfigUtil.h +++ b/src/slic3r/GUI/DeviceCore/DevConfigUtil.h @@ -103,6 +103,7 @@ public: /*print check*/ static bool support_print_check_extension_fan_f000_mounted(const std::string& type_str) { return get_value_from_config(type_str, "print", "support_print_check_extension_fan_f000_mounted"); } + static bool support_print_check_firmware_for_tpu_left(const std::string& type_str) { return get_value_from_config(type_str, "print", "support_print_check_firmware_for_tpu_left"); } public: template diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index ee81846e28..7508750fe1 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -5169,6 +5169,10 @@ void MachineObject::parse_new_info(json print) is_support_pa_mode = (get_flag_bits_no_border(fun2, 3) == 1); is_support_remote_dry = (get_flag_bits_no_border(fun2, 5) == 1); is_support_check_track_switch_match_slice_printer = get_flag_bits_no_border(fun2, 19) == 1; + + if (DevPrinterConfigUtil::support_print_check_firmware_for_tpu_left(printer_type)) { + m_firmware_support_print_tpu_left = get_flag_bits_no_border(fun2, 7) == 1; + } } /*aux*/ diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index cbff5228b2..98ab9947e3 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -639,6 +639,7 @@ public: bool is_support_remote_dry = false; bool is_support_check_track_switch_match_slice_printer{false}; bool is_support_pa_mode{false}; + std::optional m_firmware_support_print_tpu_left; bool installed_upgrade_kit{false}; int bed_temperature_limit = -1; diff --git a/src/slic3r/GUI/PrePrintChecker.hpp b/src/slic3r/GUI/PrePrintChecker.hpp index 61fb036439..199f97a1a0 100644 --- a/src/slic3r/GUI/PrePrintChecker.hpp +++ b/src/slic3r/GUI/PrePrintChecker.hpp @@ -48,6 +48,7 @@ enum PrintDialogStatus : unsigned int { PrintStatusConnecting, PrintStatusReconnecting, PrintStatusInUpgrading, + PrintStatusFirmwareNotSupportTpuAtLeft, PrintStatusModeNotFDM, PrintStatusInSystemPrinting, PrintStatusInPrinting, diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 77446f93fe..0fdeb93bf4 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -2104,6 +2104,10 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vectorprinter_type)) { + bool has_tpu_left = false; + for (const auto& fila : m_ams_mapping_result) { + const auto& ams_id = fila.ams_id; + const auto& slot_id = fila.slot_id; + if (!obj_->contains_tray(ams_id, slot_id)) { + show_status(PrintDialogStatus::PrintStatusAmsMappingInvalid); + return; + } + + if (obj_->get_extruder_id_by_ams_id(ams_id) == DEPUTY_EXTRUDER_ID && + obj_->get_tray(ams_id, slot_id).get_filament_type() == "TPU") { + has_tpu_left = true; + break; + } + } + + if (has_tpu_left && !obj_->m_firmware_support_print_tpu_left.value_or(false)) { + show_status(PrintDialogStatus::PrintStatusFirmwareNotSupportTpuAtLeft, + {_L("Your current firmware version cannot start this print job. Please update to the latest version and try again.")}); + return; + } + } + // filaments check for black list for (auto i = 0; i < m_ams_mapping_result.size(); i++) { const auto &ams_id = m_ams_mapping_result[i].get_ams_id();