Warn when a filament will switch extruders mid-print

This commit is contained in:
SoftFever
2026-07-16 14:58:58 +08:00
parent 5f3f892a6b
commit c7581e590c
3 changed files with 29 additions and 0 deletions

View File

@@ -111,6 +111,7 @@ enum PrintDialogStatus : unsigned int {
PrintStatusFilamentWarningUnknownHighChamberTempSoft,
PrintStatusWarningExtFilamentNotMatch,
PrintStatusFilamentWarningNozzleHRC,
PrintStatusFilamentCrossExtruderWarning,
PrintStatusFilamentWarningEnd,
PrintStatusWarningEnd,//->end error<-

View File

@@ -1875,6 +1875,22 @@ bool SelectMachineDialog::check_sdcard_for_timelpase(MachineObject* obj)
return false;
}
bool SelectMachineDialog::CheckWarningFilamentCrossExtruder(MachineObject* obj_)
{
if (!obj_ || m_print_type != PrintFromType::FROM_NORMAL) return true;
if (obj_->GetExtderSystem()->GetTotalExtderCount() != 2) return true;
for (const auto& fila : m_ams_mapping_result) {
std::set<int> used_extruder_ids;
for (const auto& [pos_id, nozzle] : get_mapped_nozzles(fila.id)) {
if (!nozzle.IsEmpty()) { used_extruder_ids.insert(nozzle.GetExtruderId()); }
}
if (used_extruder_ids.size() >= 2) { return false; }
}
return true;
}
void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxString> params, wxString wiki_url)
{
wxString msg;
@@ -2115,6 +2131,10 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
// Advisory rack inventory shortfalls: allow Send.
Enable_Refresh_Button(true);
Enable_Send_Button(true);
} else if (status == PrintDialogStatus::PrintStatusFilamentCrossExtruderWarning) {
// Advisory only: per-nozzle K can't follow a filament across extruders.
Enable_Refresh_Button(true);
Enable_Send_Button(true);
}
/*enter perpare mode*/
@@ -4247,6 +4267,11 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
// return;
}
}
if (!CheckWarningFilamentCrossExtruder(obj_)) {
wxString warning_msg = _L("Some filaments may switch between extruders during printing. Manual K-value calibration cannot be applied throughout the entire print, which "
"may affect print quality. Enabling Flow Dynamics Calibration is recommended.");
show_status(PrintDialogStatus::PrintStatusFilamentCrossExtruderWarning, { warning_msg });
}
if (m_ams_mapping_res) {
if (has_timelapse_warning()) {
show_status(PrintDialogStatus::PrintStatusTimelapseWarning);

View File

@@ -531,6 +531,9 @@ public:
// Compare the slicing file's nozzle requirements (validity, flow, diameter) against the
// printer; the rack extruder is checked against its whole inventory (mounted + rack).
bool CheckErrorExtruderNozzleWithSlicing(MachineObject* obj_);//return true if no errors
// Warn (without blocking) when a mapped filament would be printed from both extruders on a
// dual-extruder printer, so per-nozzle manual K-value can't follow it across the whole print.
bool CheckWarningFilamentCrossExtruder(MachineObject* obj_);
// Rack print-dispatch nozzle mapping (H2C): request the printer's auto-mapping and consume the
// result, gating the Send button while the printer computes. Both are no-ops for non-rack printers.