Files
OrcaSlicer/src/slic3r/GUI/PrePrintChecker.hpp
SoftFever 2fecfc291f fix(gui): rack-aware pre-print nozzle checks in the send dialog
A print sliced for a nozzle that sits in the hotend rack (but is not
mounted) was blocked by the send dialog's mounted-nozzle diameter check,
even though the printer fetches the required nozzle itself (#14685).

Consolidate the three mounted-nozzle gates (_is_nozzle_data_valid,
is_nozzle_type_match, _is_same_nozzle_diameters) into a single
CheckErrorExtruderNozzleWithSlicing fed by s_get_slicing_extuder_nozzles,
which collects the plate's per-extruder nozzle requirements (hybrid
extruders contribute one entry per used sub-nozzle flow). The rack
extruder validates against its whole inventory (mounted + rack) with
guidance to calibrate the rack, refresh nozzle info, or re-slice, and
blocks when toolhead + rack are full (no free slot to stow a nozzle).
Other extruders keep the validity/flow/diameter checks against the
mounted nozzle.

Also add CheckErrorRackStatus, which holds Send while the printer is
still reading the rack hotend information, and judge material hardness
for the rack extruder per dispatch-mapped nozzle as a non-blocking
caution (mounted nozzles keep the blocking gate).
2026-07-13 00:55:16 +08:00

199 lines
5.9 KiB
C++

#ifndef slic3r_GUI_PRE_PRINT_CHECK_hpp_
#define slic3r_GUI_PRE_PRINT_CHECK_hpp_
#include <wx/wx.h>
#include "Widgets/Label.hpp"
namespace Slic3r { namespace GUI {
enum prePrintInfoLevel {
Normal,
Warning,
Error
};
enum prePrintInfoType {
Printer,
Filament
};
struct prePrintInfo
{
prePrintInfoLevel level;
prePrintInfoType type;
wxString msg;
wxString tips;
wxString wiki_url;
int index;
public:
bool operator==(const prePrintInfo& other) const {
return level == other.level && type == other.type &&
msg == other.msg && tips == other.tips &&
wiki_url == other.wiki_url && index == other.index;
}
};
enum PrintDialogStatus : unsigned int {
PrintStatusErrorBegin,//->start error<-
// Errors for printer, Block Print
PrintStatusPrinterErrorBegin,
PrintStatusInit,
PrintStatusNoUserLogin,
PrintStatusInvalidPrinter,
PrintStatusConnectingServer,
PrintStatusReadingTimeout,
PrintStatusReading,
PrintStatusConnecting,
PrintStatusReconnecting,
PrintStatusInUpgrading,
PrintStatusModeNotFDM,
PrintStatusInSystemPrinting,
PrintStatusInPrinting,
PrintStatusNozzleMatchInvalid,
PrintStatusNozzleDataInvalid,
PrintStatusNozzleDiameterMismatch,
PrintStatusNozzleTypeMismatch,
PrintStatusNozzleNoMatchedHotends,
PrintStatusNozzleRackMaximumInstalled,
PrintStatusRefreshingMachineList,
PrintStatusSending,
PrintStatusLanModeNoSdcard,
PrintStatusNoSdcard,
PrintStatusLanModeSDcardNotAvailable,
PrintStatusNeedForceUpgrading,
PrintStatusNeedConsistencyUpgrading,
PrintStatusNotSupportedPrintAll,
PrintStatusBlankPlate,
PrintStatusUnsupportedPrinter,
PrintStatusRackNozzleMappingWaiting,
PrintStatusRackNozzleMappingError,
PrintStatusRackReading,
PrintStatusFilaSwitcherError,
PrintStatusPrinterErrorEnd,
// Errors for filament, Block Print
PrintStatusFilamentErrorBegin,
PrintStatusAmsOnSettingup,
PrintStatusAmsMappingInvalid,
PrintStatusAmsMappingU0Invalid,
PrintStatusAmsMappingMixInvalid,
PrintStatusTPUUnsupportAutoCali,
PrintStatusHasFilamentInBlackListError,
PrintStatusColorQuantityExceed,
PrintStatusFilamentErrorEnd,
PrintStatusErrorEnd,//->end error<-
PrintStatusWarningBegin,//->start warning<-
// Warnings for printer
PrintStatusPrinterWarningBegin,
PrintStatusTimelapseNoSdcard,
PrintStatusTimelapseWarning,
PrintStatusMixAmsAndVtSlotWarning,
PrintStatusToolHeadCoolingFanWarning,
PrintStatusRackNozzleMappingWarning,
PrintStatusFilaSwitcherSlicingNotMatch,
PrintStatusPrinterWarningEnd,
// Warnings for filament
PrintStatusFilamentWarningBegin,
PrintStatusWarningKvalueNotUsed,
PrintStatusHasFilamentInBlackListWarning,
PrintStatusFilamentWarningHighChamberTemp,
PrintStatusFilamentWarningHighChamberTempCloseDoor,
PrintStatusFilamentWarningHighChamberTempSoft,
PrintStatusFilamentWarningUnknownHighChamberTempSoft,
PrintStatusWarningExtFilamentNotMatch,
PrintStatusFilamentWarningNozzleHRC,
PrintStatusFilamentWarningEnd,
PrintStatusWarningEnd,//->end error<-
/*success*/
// printer
PrintStatusReadingFinished,
PrintStatusSendingCanceled,
PrintStatusReadyToGo,
// filament
PrintStatusAmsMappingSuccess,
/*Other, SendToPrinterDialog*/
PrintStatusNotOnTheSameLAN,
PrintStatusNotSupportedSendToSDCard,
PrintStatusPublicInitFailed,
PrintStatusPublicUploadFiled,
};
class PrePrintChecker
{
public:
std::vector<prePrintInfo> printerList;
std::vector<prePrintInfo> filamentList;
public:
void clear();
/*auto merge*/
void add(PrintDialogStatus state, wxString msg, wxString tip, const wxString& wiki_url);
static ::std::string get_print_status_info(PrintDialogStatus status);
wxString get_pre_state_msg(PrintDialogStatus status);
static bool is_error(PrintDialogStatus status) { return (PrintStatusErrorBegin < status) && (PrintStatusErrorEnd > status); };
static bool is_error_printer(PrintDialogStatus status) { return (PrintStatusPrinterErrorBegin < status) && (PrintStatusPrinterErrorEnd > status); };
static bool is_error_filament(PrintDialogStatus status) { return (PrintStatusFilamentErrorBegin < status) && (PrintStatusFilamentErrorEnd > status); };
static bool is_warning(PrintDialogStatus status) { return (PrintStatusWarningBegin < status) && (PrintStatusWarningEnd > status); };
static bool is_warning_printer(PrintDialogStatus status) { return (PrintStatusPrinterWarningBegin < status) && (PrintStatusPrinterWarningEnd > status); };
static bool is_warning_filament(PrintDialogStatus status) { return (PrintStatusFilamentWarningBegin < status) && (PrintStatusFilamentWarningEnd > status); };
};
//class PrePrintMsgBoard : public wxWindow
//{
//public:
// PrePrintMsgBoard(wxWindow * parent,
// wxWindowID winid = wxID_ANY,
// const wxPoint & pos = wxDefaultPosition,
// const wxSize & size = wxDefaultSize,
// long style = wxTAB_TRAVERSAL | wxNO_BORDER,
// const wxString &name = wxASCII_STR(wxPanelNameStr)
// );
//
//public:
// // Operations
// void addError(const wxString &msg, const wxString &tips = wxEmptyString) { Add(msg, tips, true); };
// void addWarning(const wxString &msg, const wxString &tips = wxEmptyString) { Add(msg, tips, false); };
// void clear() { m_sizer->Clear(); };
//
// // Const Access
// bool isEmpty() const { return m_sizer->IsEmpty(); }
//
//private:
// void add(const wxString &msg, const wxString &tips, bool is_error);
//
//private:
// wxBoxSizer *m_sizer{nullptr};
//};
class PrinterMsgPanel : public wxPanel
{
public:
PrinterMsgPanel(wxWindow *parent);
public:
bool UpdateInfos(const std::vector<prePrintInfo>& infos);
private:
wxBoxSizer* m_sizer = nullptr;
std::vector<prePrintInfo> m_infos;
};
}} // namespace Slic3r::GUI
#endif