Block TPU on the left extruder without firmware support

This commit is contained in:
SoftFever
2026-07-16 15:21:35 +08:00
parent e8f8a4bb7d
commit 47f7e09e84
7 changed files with 41 additions and 2 deletions

View File

@@ -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,

View File

@@ -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",

View File

@@ -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<bool>(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<bool>(type_str, "print", "support_print_check_firmware_for_tpu_left"); }
public:
template<typename T>

View File

@@ -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*/

View File

@@ -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<bool> m_firmware_support_print_tpu_left;
bool installed_upgrade_kit{false};
int bed_temperature_limit = -1;

View File

@@ -48,6 +48,7 @@ enum PrintDialogStatus : unsigned int {
PrintStatusConnecting,
PrintStatusReconnecting,
PrintStatusInUpgrading,
PrintStatusFirmwareNotSupportTpuAtLeft,
PrintStatusModeNotFDM,
PrintStatusInSystemPrinting,
PrintStatusInPrinting,

View File

@@ -2104,6 +2104,10 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
// Extra-waste warning: allow Send.
Enable_Refresh_Button(true);
Enable_Send_Button(true);
} else if (status == PrintDialogStatus::PrintStatusFirmwareNotSupportTpuAtLeft) {
// Firmware can't print TPU on the left extruder: block Send.
Enable_Refresh_Button(true);
Enable_Send_Button(false);
} else if (status == PrintDialogStatus::PrintStatusFilaSwitcherError) {
// Missing or un-set-up switch required by the slice: block Send.
Enable_Refresh_Button(true);
@@ -4161,6 +4165,32 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
// runs after the AMS-validity check and before the per-nozzle blacklist loop (which needs the result).
if (!CheckErrorSyncNozzleMappingResultV0(obj_)) return;
// H2-series firmware gate: block Send when TPU is mapped to the left (deputy) extruder on firmware
// that can't print it. Inert unless the printer JSON opts in via support_print_check_firmware_for_tpu_left.
if (DevPrinterConfigUtil::support_print_check_firmware_for_tpu_left(obj_->printer_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();