mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-07 12:21:50 +03:00
update slic3r
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "Plater.hpp"
|
||||
#include "QDTStatusBar.hpp"
|
||||
#include "QDTStatusBarPrint.hpp"
|
||||
#include "PrePrintChecker.hpp"
|
||||
#include "Widgets/Label.hpp"
|
||||
#include "Widgets/Button.hpp"
|
||||
#include "Widgets/CheckBox.hpp"
|
||||
@@ -62,92 +63,6 @@ enum PrintPageMode {
|
||||
PrintPageModeFinish
|
||||
};
|
||||
|
||||
enum PrintDialogStatus : unsigned int {
|
||||
/*Errors*/
|
||||
PrintStatusErrorBegin,
|
||||
|
||||
//Errors for printer, Block Print
|
||||
PrintStatusPrinterErrorBegin,
|
||||
PrintStatusInit,
|
||||
PrintStatusNoUserLogin,
|
||||
PrintStatusInvalidPrinter,
|
||||
PrintStatusConnectingServer,
|
||||
PrintStatusReadingTimeout,
|
||||
PrintStatusReading,
|
||||
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,
|
||||
PrintStatusNeedUpgradingAms,
|
||||
PrintStatusAmsOnSettingup,
|
||||
PrintStatusAmsMappingInvalid,
|
||||
PrintStatusAmsMappingU0Invalid,
|
||||
PrintStatusAmsMappingMixInvalid,
|
||||
PrintStatusTPUUnsupportAutoCali,
|
||||
PrintStatusFilamentErrorEnd,
|
||||
|
||||
PrintStatusErrorEnd,
|
||||
|
||||
/*Warnings*/
|
||||
PrintStatusWarningBegin,
|
||||
|
||||
//Warnings for printer
|
||||
PrintStatusPrinterWarningBegin,
|
||||
PrintStatusTimelapseNoSdcard,
|
||||
PrintStatusTimelapseWarning,
|
||||
PrintStatusMixAmsAndVtSlotWarning,
|
||||
PrintStatusPrinterWarningEnd,
|
||||
|
||||
//Warnings for filament
|
||||
PrintStatusFilamentWarningBegin,
|
||||
PrintStatusAmsMappingByOrder,
|
||||
PrintStatusWarningKvalueNotUsed,
|
||||
PrintStatusFilamentWarningEnd,
|
||||
|
||||
PrintStatusWarningEnd,
|
||||
|
||||
/*Success*/
|
||||
//printer
|
||||
PrintStatusReadingFinished,
|
||||
PrintStatusSendingCanceled,
|
||||
|
||||
//filament
|
||||
PrintStatusDisableAms,
|
||||
PrintStatusAmsMappingSuccess,
|
||||
PrintStatusAmsMappingValid,
|
||||
|
||||
/*Other, SendToPrinterDialog*/
|
||||
PrintStatusNotOnTheSameLAN,
|
||||
PrintStatusNotSupportedSendToSDCard,
|
||||
PrintStatusPublicInitFailed,
|
||||
PrintStatusPublicUploadFiled,
|
||||
|
||||
// y60
|
||||
PrinterNotConnectBox,
|
||||
BoxhasSomeProblem,
|
||||
PrintStatusPrinterOffline,
|
||||
PrintStatusPrinterNotStandby,
|
||||
};
|
||||
|
||||
class Material
|
||||
{
|
||||
public:
|
||||
@@ -233,32 +148,58 @@ struct Machine_info {
|
||||
bool timelapse = false;
|
||||
};
|
||||
|
||||
class PrintOptionItem : public ComboBox
|
||||
#define PRINT_OPT_WIDTH FromDIP(44)
|
||||
class PrintOptionItem : public wxPanel
|
||||
{
|
||||
std::vector<POItem> m_ops;
|
||||
std::string selected_key;
|
||||
std::string m_param;
|
||||
|
||||
public:
|
||||
PrintOptionItem(wxWindow *parent, std::vector<POItem> ops, std::string param = "");
|
||||
~PrintOptionItem() {};
|
||||
|
||||
public:
|
||||
bool Enable(bool enable) override { return ComboBox::Enable(enable); }
|
||||
|
||||
void setValue(std::string value);
|
||||
std::string getValue() const { return selected_key; }
|
||||
void update_options(std::vector<POItem> ops) {
|
||||
if (m_ops != ops)
|
||||
{
|
||||
m_ops = ops;
|
||||
selected_key = "";
|
||||
|
||||
void msw_rescale() { ComboBox::Rescale();};
|
||||
void update_options(std::vector<POItem> ops);
|
||||
auto width = ops.size() * PRINT_OPT_WIDTH + FromDIP(8);
|
||||
auto height = FromDIP(22) + FromDIP(8);
|
||||
SetMinSize(wxSize(width, height));
|
||||
SetMaxSize(wxSize(width, height));
|
||||
Refresh();
|
||||
}
|
||||
};
|
||||
|
||||
bool CanBeFocused() const override { return false; }
|
||||
bool is_enabled() const { return m_enable; }
|
||||
void enable(bool able) {
|
||||
if (m_enable != able)
|
||||
{
|
||||
m_enable = able;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void msw_rescale() { m_selected_bk.msw_rescale(); Refresh(); };
|
||||
|
||||
private:
|
||||
void on_combobox_changed(wxCommandEvent &evt);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void render(wxDC& dc);
|
||||
void on_left_down(wxMouseEvent& evt);
|
||||
void doRender(wxDC& dc);
|
||||
|
||||
wxString get_display_str(const std::string& key) const;
|
||||
std::string get_key(const wxString &display_val) const;
|
||||
private:
|
||||
ScalableBitmap m_selected_bk;
|
||||
ScalableBitmap m_selected_bk_dark;
|
||||
ScalableBitmap m_selected_disabled_bk;
|
||||
ScalableBitmap m_selected_disabled_bk_dark;
|
||||
std::vector<POItem> m_ops;
|
||||
std::string selected_key;
|
||||
std::string m_param;
|
||||
|
||||
bool m_enable = true;
|
||||
};
|
||||
|
||||
class PrintOption : public wxPanel
|
||||
@@ -274,7 +215,7 @@ public:
|
||||
~PrintOption(){};
|
||||
|
||||
public:
|
||||
void enable(bool en) { m_printoption_item->Enable(en); }
|
||||
void enable(bool en);
|
||||
|
||||
void setValue(std::string value);
|
||||
std::string getValue();
|
||||
@@ -344,6 +285,7 @@ private:
|
||||
ScalableBitmap m_img_unselected_tag;
|
||||
};
|
||||
|
||||
class PrinterInfoBox;
|
||||
class SelectMachineDialog : public DPIDialog
|
||||
{
|
||||
private:
|
||||
@@ -369,7 +311,6 @@ private:
|
||||
wxColour m_colour_def_color{wxColour(255, 255, 255)};
|
||||
wxColour m_colour_bold_color{wxColour(38, 46, 48)};
|
||||
StateColor m_btn_bg_enable;
|
||||
Label* m_text_bed_type;
|
||||
|
||||
std::unordered_map<string, PrintOption*> m_checkbox_list;
|
||||
std::list<PrintOption*> m_checkbox_list_order;
|
||||
@@ -383,11 +324,6 @@ private:
|
||||
std::vector<int> m_filaments_map;
|
||||
std::shared_ptr<QDTStatusBarPrint> m_status_bar;
|
||||
|
||||
//SendModeSwitchButton* m_mode_print {nullptr};
|
||||
//SendModeSwitchButton* m_mode_send {nullptr};
|
||||
wxStaticBitmap* m_printer_image{nullptr};
|
||||
wxStaticBitmap* m_bed_image{nullptr};
|
||||
|
||||
Slic3r::DynamicPrintConfig m_required_data_config;
|
||||
Slic3r::Model m_required_data_model;
|
||||
Slic3r::PlateDataPtrs m_required_data_plate_data_list;
|
||||
@@ -407,13 +343,12 @@ private:
|
||||
std::string machine_link_url = "";
|
||||
bool machine_is_special = false;
|
||||
SwitchButton* m_switch_button{ nullptr };
|
||||
std::set<std::string> qidi_printers;
|
||||
Machine_info select_machine;
|
||||
|
||||
//w42
|
||||
Box_info machine_filament_info;
|
||||
|
||||
bool has_box_machine;
|
||||
bool has_box_machine = false;
|
||||
|
||||
protected:
|
||||
PrintFromType m_print_type{FROM_NORMAL};
|
||||
@@ -432,10 +367,8 @@ protected:
|
||||
wxBoxSizer* m_sizer_autorefill{ nullptr };
|
||||
wxBoxSizer* m_mapping_sugs_sizer{ nullptr };
|
||||
wxBoxSizer* m_change_filament_times_sizer{ nullptr };
|
||||
ScalableButton* m_button_refresh{ nullptr };
|
||||
Button* m_button_ensure{ nullptr };
|
||||
wxStaticBitmap * m_rename_button{nullptr};
|
||||
ComboBox* m_comboBox_printer{ nullptr };
|
||||
wxStaticBitmap* m_staticbitmap{ nullptr };
|
||||
wxStaticBitmap* m_bitmap_last_plate{ nullptr };
|
||||
wxStaticBitmap* m_bitmap_next_plate{ nullptr };
|
||||
@@ -460,12 +393,13 @@ protected:
|
||||
wxSimplebook* m_rename_switch_panel{nullptr};
|
||||
wxSimplebook* m_simplebook{nullptr};
|
||||
wxStaticText* m_rename_text{nullptr};
|
||||
Label* m_stext_printer_title{nullptr};
|
||||
Label* m_stext_time{ nullptr };
|
||||
Label* m_stext_weight{ nullptr };
|
||||
Label* m_statictext_ams_msg{ nullptr };
|
||||
PrinterMsgPanel * m_statictext_ams_msg{nullptr};
|
||||
Label* m_txt_change_filament_times{ nullptr };
|
||||
Label* m_text_printer_msg{ nullptr };
|
||||
|
||||
PrinterInfoBox* m_printer_box { nullptr};
|
||||
PrinterMsgPanel * m_text_printer_msg{nullptr};
|
||||
Label* m_text_printer_msg_tips{ nullptr };
|
||||
wxStaticText* m_staticText_bed_title{ nullptr };
|
||||
wxStaticText* m_stext_sending{ nullptr };
|
||||
@@ -474,7 +408,6 @@ protected:
|
||||
wxTimer* m_refresh_timer{ nullptr };
|
||||
std::shared_ptr<PrintJob> m_print_job;
|
||||
wxScrolledWindow* m_sw_print_failed_info{nullptr};
|
||||
wxHyperlinkCtrl* m_hyperlink{nullptr};
|
||||
ScalableBitmap * rename_editable{nullptr};
|
||||
ScalableBitmap * rename_editable_light{nullptr};
|
||||
wxStaticBitmap * timeimg{nullptr};
|
||||
@@ -503,6 +436,8 @@ protected:
|
||||
wxGridSizer* m_sizer_ams_mapping_left{ nullptr };
|
||||
wxGridSizer* m_sizer_ams_mapping_right{ nullptr };
|
||||
|
||||
PrePrintChecker m_pre_print_checker;
|
||||
|
||||
//y30
|
||||
bool m_isNetMode = false;
|
||||
std::string preset_typename_normalized;
|
||||
@@ -524,7 +459,6 @@ public:
|
||||
|
||||
void init_bind();
|
||||
void init_timer();
|
||||
void check_focus(wxWindow* window);
|
||||
void show_print_failed_info(bool show, int code = 0, wxString description = wxEmptyString, wxString extra = wxEmptyString);
|
||||
void check_fcous_state(wxWindow* window);
|
||||
void popup_filament_backup();
|
||||
@@ -539,10 +473,10 @@ public:
|
||||
void reset_timeout();
|
||||
void update_user_printer();
|
||||
void reset_ams_material();
|
||||
void update_show_status();
|
||||
void update_show_status(MachineObject* obj_ = nullptr);
|
||||
void update_ams_check(MachineObject* obj);
|
||||
void update_filament_change_count();
|
||||
void on_rename_click(wxMouseEvent &event);
|
||||
void on_rename_click(wxMouseEvent &event);
|
||||
void on_rename_enter();
|
||||
void update_printer_combobox(wxCommandEvent& event);
|
||||
void on_cancel(wxCloseEvent& event);
|
||||
@@ -570,28 +504,23 @@ public:
|
||||
void update_page_turn_state(bool show);
|
||||
void on_timer(wxTimerEvent& event);
|
||||
void on_selection_changed(wxCommandEvent &event);
|
||||
void update_flow_cali_check(MachineObject* obj);
|
||||
void Enable_Refresh_Button(bool en);
|
||||
void Enable_Send_Button(bool en);
|
||||
void on_dpi_changed(const wxRect& suggested_rect) override;
|
||||
void update_user_machine_list();
|
||||
void update_lan_machine_list();
|
||||
void stripWhiteSpace(std::string& str);
|
||||
void update_ams_status_msg(wxString msg, bool can_send_print);
|
||||
void update_priner_status_msg(wxString msg, bool can_send_print);
|
||||
void update_ams_status_msg(vector<wxString> msg, bool is_error, bool is_single);
|
||||
void update_priner_status_msg(vector<wxString> msg, bool is_error, bool is_single);
|
||||
//void update_priner_status_msg(vector<wxString> msg);
|
||||
void update_printer_status_msg_tips(const wxString& msg_tips);
|
||||
void update_print_status_msg(wxString msg, bool is_printer, bool can_send_print, bool can_refresh, const wxString& printer_msg_tips = wxEmptyString);
|
||||
void update_print_status_msg();
|
||||
void update_print_error_info(int code, std::string msg, std::string extra);
|
||||
void set_flow_calibration_state(bool state, bool show_tips = true);
|
||||
bool has_timelapse_warning(wxString& msg);
|
||||
bool has_timelapse_warning() { wxString msg; return has_timelapse_warning(msg);};
|
||||
bool can_support_auto_cali();
|
||||
bool is_same_printer_model();
|
||||
bool is_blocking_printing(MachineObject* obj_);
|
||||
bool is_nozzle_data_valid(const ExtderData& ext_data) const;
|
||||
bool is_same_nozzle_diameters(float& tag_nozzle_diameter, int& mismatch_nozzle_id) const;
|
||||
bool is_same_nozzle_type(const Extder& extruder, std::string& filament_type) const;
|
||||
bool has_tips(MachineObject* obj);
|
||||
bool is_nozzle_hrc_matched(const Extder& extruder, std::string& filament_type) const;
|
||||
bool check_sdcard_for_timelpase(MachineObject* obj);
|
||||
bool is_timeout();
|
||||
int update_print_required_data(Slic3r::DynamicPrintConfig config, Slic3r::Model model, Slic3r::PlateDataPtrs plate_data_list, std::string file_name, std::string file_path);
|
||||
void set_print_type(PrintFromType type) {m_print_type = type;};
|
||||
@@ -605,10 +534,7 @@ public:
|
||||
bool is_nozzle_type_match(ExtderData data, wxString& error_message) const;
|
||||
int convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id);
|
||||
|
||||
std::string get_print_status_info(PrintDialogStatus status);
|
||||
|
||||
PrintFromType get_print_type() {return m_print_type;};
|
||||
wxString format_bed_name(std::string plate_name);
|
||||
wxString format_steel_name(NozzleType type);
|
||||
PrintDialogStatus get_status() { return m_print_status; }
|
||||
|
||||
@@ -616,14 +542,8 @@ public:
|
||||
std::string NormalizeVendor(const std::string& str);
|
||||
|
||||
//y58
|
||||
void init_vendors();
|
||||
void update_image(std::string select_machine_type="");
|
||||
void start_to_send(PrintHostJob upload_job);
|
||||
|
||||
//w42
|
||||
void remove_area();
|
||||
void on_sync_btn(wxCommandEvent& event);
|
||||
void get_machine_filament_info();
|
||||
|
||||
|
||||
private:
|
||||
@@ -640,14 +560,51 @@ private:
|
||||
void load_option_vals(MachineObject* obj);
|
||||
void save_option_vals();
|
||||
void save_option_vals(MachineObject *obj);
|
||||
};
|
||||
|
||||
/*go check*/
|
||||
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 PrinterInfoBox : public StaticBox
|
||||
{
|
||||
public:
|
||||
PrinterInfoBox(wxWindow* parent, SelectMachineDialog* select_dialog);
|
||||
|
||||
public:
|
||||
void UpdatePlate(const std::string& plate_name);
|
||||
|
||||
ComboBox* GetPrinterComboBox() const { return m_comboBox_printer; }
|
||||
void SetPrinterName(const wxString& printer_name) { m_comboBox_printer->SetValue(printer_name); };
|
||||
void SetPrinters(const std::vector<MachineObject*>& sorted_printers);
|
||||
|
||||
void EnableEditing(bool enable);
|
||||
void EnableRefreshButton(bool enable);
|
||||
|
||||
void SetDefault(bool from_sd);
|
||||
|
||||
//y65
|
||||
void SetQDTPrinters(std::vector<Machine_info> machine_list_local);
|
||||
std::string NormalizeVendor(const std::string& str);
|
||||
std::string GetSelectedPrinterName() {
|
||||
return m_comboBox_printer->GetValue().ToStdString();
|
||||
}
|
||||
|
||||
private:
|
||||
void Create();
|
||||
|
||||
void OnBtnQuestionClicked(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
// owner
|
||||
SelectMachineDialog* m_select_dialog;
|
||||
|
||||
Label* m_stext_printer_title{ nullptr };
|
||||
ComboBox* m_comboBox_printer{ nullptr };
|
||||
ScalableButton* m_button_refresh{ nullptr };
|
||||
ScalableButton* m_button_question { nullptr };
|
||||
|
||||
wxStaticBitmap* m_bed_image{ nullptr };
|
||||
Label* m_text_bed_type;
|
||||
|
||||
//y65
|
||||
std::set<std::string> qidi_printers;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user