mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-15 17:09:43 -07:00
jira: [STUDIO-11777] Change-Id: I12744db7d2e3b53425454d632533768c54524677 (cherry picked from commit 4358e9ce351c5784e392a75d1ffcf2f54e1916ec)
160 lines
4.6 KiB
C++
160 lines
4.6 KiB
C++
#ifndef slic3r_GUI_PRE_PRINT_CHECK_hpp_
|
|
#define slic3r_GUI_PRE_PRINT_CHECK_hpp_
|
|
|
|
#include <wx/wx.h>
|
|
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
enum prePrintInfoLevel {
|
|
Normal,
|
|
Warning,
|
|
Error
|
|
};
|
|
|
|
enum prePrintInfoType {
|
|
Printer,
|
|
Filament
|
|
};
|
|
|
|
struct prePrintInfo
|
|
{
|
|
prePrintInfoLevel level;
|
|
prePrintInfoType type;
|
|
wxString msg;
|
|
wxString tips;
|
|
int 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,
|
|
PrintStatusRefreshingMachineList,
|
|
PrintStatusSending,
|
|
PrintStatusLanModeNoSdcard,
|
|
PrintStatusNoSdcard,
|
|
PrintStatusLanModeSDcardNotAvailable,
|
|
PrintStatusNeedForceUpgrading,
|
|
PrintStatusNeedConsistencyUpgrading,
|
|
PrintStatusNotSupportedPrintAll,
|
|
PrintStatusBlankPlate,
|
|
PrintStatusUnsupportedPrinter,
|
|
PrintStatusInvalidMapping,
|
|
PrintStatusPrinterErrorEnd,
|
|
|
|
// Errors for filament, Block Print
|
|
PrintStatusFilamentErrorBegin,
|
|
PrintStatusAmsOnSettingup,
|
|
PrintStatusAmsMappingInvalid,
|
|
PrintStatusAmsMappingU0Invalid,
|
|
PrintStatusAmsMappingMixInvalid,
|
|
PrintStatusTPUUnsupportAutoCali,
|
|
PrintStatusFilamentErrorEnd,
|
|
|
|
PrintStatusErrorEnd,//->end error<-
|
|
|
|
|
|
PrintStatusWarningBegin,//->start warning<-
|
|
|
|
// Warnings for printer
|
|
PrintStatusPrinterWarningBegin,
|
|
PrintStatusTimelapseNoSdcard,
|
|
PrintStatusTimelapseWarning,
|
|
PrintStatusMixAmsAndVtSlotWarning,
|
|
PrintStatusPrinterWarningEnd,
|
|
|
|
// Warnings for filament
|
|
PrintStatusFilamentWarningBegin,
|
|
PrintStatusWarningKvalueNotUsed,
|
|
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);
|
|
static ::std::string get_print_status_info(PrintDialogStatus status);
|
|
|
|
wxString get_pre_state_msg(PrintDialogStatus status);
|
|
bool is_error(PrintDialogStatus status) { return (PrintStatusErrorBegin < status) && (PrintStatusErrorEnd > status); };
|
|
bool is_error_printer(PrintDialogStatus status) { return (PrintStatusPrinterErrorBegin < status) && (PrintStatusPrinterErrorEnd > status); };
|
|
bool is_error_filament(PrintDialogStatus status) { return (PrintStatusFilamentErrorBegin < status) && (PrintStatusFilamentErrorEnd > status); };
|
|
bool is_warning(PrintDialogStatus status) { return (PrintStatusWarningBegin < status) && (PrintStatusWarningEnd > status); };
|
|
bool is_warning_printer(PrintDialogStatus status) { return (PrintStatusPrinterWarningBegin < status) && (PrintStatusPrinterWarningEnd > status); };
|
|
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};
|
|
//};
|
|
|
|
|
|
|
|
}} // namespace Slic3r::GUI
|
|
|
|
#endif
|