mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
NEW:optimizing error info for network requests
Change-Id: I8656c2f899b086b5ab52d94b7186e64df1625e3e
This commit is contained in:
parent
7b12dcb6ea
commit
8b490adc51
27 changed files with 1133 additions and 637 deletions
|
@ -229,8 +229,8 @@ private:
|
|||
wxWindow *create_title_panel(wxString text);
|
||||
};
|
||||
|
||||
#define SELECT_MACHINE_DIALOG_BUTTON_SIZE wxSize(FromDIP(68), FromDIP(24))
|
||||
#define SELECT_MACHINE_DIALOG_SIMBOOK_SIZE wxSize(FromDIP(360), FromDIP(70))
|
||||
#define SELECT_MACHINE_DIALOG_BUTTON_SIZE wxSize(FromDIP(68), FromDIP(23))
|
||||
#define SELECT_MACHINE_DIALOG_SIMBOOK_SIZE wxSize(FromDIP(370), FromDIP(64))
|
||||
|
||||
|
||||
enum PrintDialogStatus {
|
||||
|
@ -270,179 +270,162 @@ std::string get_print_status_info(PrintDialogStatus status);
|
|||
class SelectMachineDialog : public DPIDialog
|
||||
{
|
||||
private:
|
||||
void init_model();
|
||||
void init_bind();
|
||||
void init_timer();
|
||||
int m_current_filament_id{0};
|
||||
int m_print_plate_idx{0};
|
||||
int m_timeout_count{0};
|
||||
bool m_is_in_sending_mode{ false };
|
||||
bool m_ams_mapping_res{ false };
|
||||
bool m_ams_mapping_valid{ false };
|
||||
bool m_need_adaptation_screen{ false };
|
||||
bool m_export_3mf_cancel{ false };
|
||||
bool m_is_canceled{ false };
|
||||
bool m_is_rename_mode{ false };
|
||||
|
||||
std::string m_printer_last_select;
|
||||
std::string m_print_info;
|
||||
wxString m_current_project_name;
|
||||
PrintDialogStatus m_print_status { PrintStatusInit };
|
||||
|
||||
int m_print_plate_idx;
|
||||
|
||||
std::string m_printer_last_select;
|
||||
PrintDialogStatus m_print_status { PrintStatusInit };
|
||||
wxColour m_colour_def_color{wxColour(255, 255, 255)};
|
||||
wxColour m_colour_bold_color{wxColour(38, 46, 48)};
|
||||
StateColor m_btn_bg_enable;
|
||||
|
||||
std::vector<wxString> m_bedtype_list;
|
||||
|
||||
std::map<std::string, ::CheckBox *> m_checkbox_list;
|
||||
std::map<std::string, bool> m_checkbox_state_list;
|
||||
|
||||
wxColour m_colour_def_color{wxColour(255, 255, 255)};
|
||||
wxColour m_colour_bold_color{wxColour(38, 46, 48)};
|
||||
|
||||
//SecondaryCheckDialog* confirm_dlg = nullptr;
|
||||
|
||||
protected:
|
||||
MaterialHash m_materialList;
|
||||
std::vector<FilamentInfo> m_filaments;
|
||||
std::vector<FilamentInfo> m_ams_mapping_result; /* ams mapping data */
|
||||
bool m_ams_mapping_res { false }; /* ams mapping result */
|
||||
bool ams_mapping_valid { false };
|
||||
Plater * m_plater{nullptr};
|
||||
wxPanel * m_line_top{nullptr};
|
||||
wxPanel * m_panel_image{nullptr};
|
||||
wxStaticText *m_stext_time{nullptr};
|
||||
wxStaticText *m_stext_weight{nullptr};
|
||||
wxPanel * m_line_materia{nullptr};
|
||||
wxStaticText *m_stext_printer_title{nullptr};
|
||||
AmsMapingPopup m_mapping_popup{ nullptr };
|
||||
AmsMapingTipPopup m_mapping_tip_popup{ nullptr };
|
||||
AmsTutorialPopup m_mapping_tutorial_popup{ nullptr };
|
||||
MaterialHash m_materialList;
|
||||
Plater * m_plater{nullptr};
|
||||
wxWrapSizer* m_sizer_select{ nullptr };
|
||||
wxBoxSizer* m_sizer_thumbnail{ nullptr };
|
||||
wxGridSizer* m_sizer_material{ nullptr };
|
||||
wxBoxSizer* m_sizer_main{ nullptr };
|
||||
wxBoxSizer* m_sizer_scrollable_view{ nullptr };
|
||||
wxBoxSizer* m_sizer_scrollable_region{ nullptr };
|
||||
wxBoxSizer* rename_sizer_v{ nullptr };
|
||||
wxBoxSizer* rename_sizer_h{ nullptr };
|
||||
Button* m_button_refresh{ nullptr };
|
||||
Button* m_button_ensure{ nullptr };
|
||||
Button* m_rename_button{nullptr};
|
||||
CheckBox* m_ams_check{ nullptr };
|
||||
ComboBox* m_comboBox_printer{ nullptr };
|
||||
ComboBox* m_comboBox_bed{ nullptr };
|
||||
wxStaticBitmap* m_staticbitmap{ nullptr };
|
||||
ThumbnailPanel* m_thumbnailPanel{ nullptr };
|
||||
wxWindow* select_bed{ nullptr };
|
||||
wxWindow* select_flow{ nullptr };
|
||||
wxWindow* select_timelapse{ nullptr };
|
||||
wxWindow* select_use_ams{ nullptr };
|
||||
wxPanel* m_panel_status{ nullptr };
|
||||
wxPanel* m_scrollable_region;
|
||||
wxPanel* m_rename_normal_panel{nullptr};
|
||||
wxPanel* m_line_schedule{nullptr};
|
||||
wxPanel* m_panel_sending{nullptr};
|
||||
wxPanel* m_panel_prepare{nullptr};
|
||||
wxPanel* m_panel_finish{nullptr};
|
||||
wxPanel* m_line_top{ nullptr };
|
||||
wxPanel* m_panel_image{ nullptr };
|
||||
wxPanel* m_line_materia{ nullptr };
|
||||
Label* m_st_txt_error_code{nullptr};
|
||||
Label* m_st_txt_error_desc{nullptr};
|
||||
Label* m_st_txt_extra_info{nullptr};
|
||||
Label * m_link_network_state;
|
||||
wxSimplebook* m_rename_switch_panel{nullptr};
|
||||
wxSimplebook* m_simplebook{nullptr};
|
||||
wxStaticText* m_rename_text{nullptr};
|
||||
wxStaticText* m_stext_printer_title{nullptr};
|
||||
wxStaticText* m_stext_time{ nullptr };
|
||||
wxStaticText* m_stext_weight{ nullptr };
|
||||
wxStaticText* m_statictext_ams_msg{ nullptr };
|
||||
wxStaticText* m_statictext_printer_msg{ nullptr };
|
||||
wxStaticText* m_staticText_bed_title{ nullptr };
|
||||
wxStaticText* m_stext_sending{ nullptr };
|
||||
wxStaticText* m_statictext_finish{nullptr};
|
||||
TextInput* m_rename_input{nullptr};
|
||||
wxTimer* m_refresh_timer{ nullptr };
|
||||
std::shared_ptr<PrintJob> m_print_job;
|
||||
wxScrolledWindow* m_scrollable_view;
|
||||
wxScrolledWindow* m_sw_print_failed_info{nullptr};
|
||||
|
||||
wxBoxSizer* rename_sizer_v{ nullptr };
|
||||
wxBoxSizer* rename_sizer_h{ nullptr };
|
||||
wxStaticText* m_rename_text{nullptr};
|
||||
TextInput* m_rename_input{nullptr};
|
||||
Button* m_rename_button{nullptr};
|
||||
wxPanel* m_rename_normal_panel{nullptr};
|
||||
wxSimplebook* m_rename_switch_panel{nullptr};
|
||||
/* model */
|
||||
wxObjectDataPtr<MachineListModel> m_machine_model;
|
||||
std::shared_ptr<BBLStatusBarSend> m_status_bar;
|
||||
|
||||
wxStaticText *m_statictext_ams_msg{nullptr};
|
||||
wxStaticText * m_statictext_printer_msg{nullptr};
|
||||
wxStaticBitmap* m_staticbitmap {nullptr};
|
||||
ThumbnailPanel *m_thumbnailPanel {nullptr};
|
||||
|
||||
::ComboBox * m_comboBox_printer{nullptr};
|
||||
::ComboBox * m_comboBox_bed{nullptr};
|
||||
wxStaticText *m_staticText_bed_title{nullptr};
|
||||
wxPanel * m_line_schedule{nullptr};
|
||||
wxPanel * m_panel_sending{nullptr};
|
||||
wxStaticText *m_stext_sending{nullptr};
|
||||
wxPanel * m_panel_prepare{nullptr};
|
||||
Button * m_button_refresh{nullptr};
|
||||
Button * m_button_ensure{nullptr};
|
||||
wxPanel * m_panel_finish{nullptr};
|
||||
wxSimplebook *m_simplebook{nullptr};
|
||||
wxStaticText *m_statictext_finish{nullptr};
|
||||
|
||||
StateColor btn_bg_enable;
|
||||
int m_current_filament_id;
|
||||
bool m_is_in_sending_mode { false };
|
||||
|
||||
//wxGridSizer *m_sizer_select;
|
||||
wxWrapSizer *m_sizer_select;
|
||||
wxBoxSizer * sizer_thumbnail;
|
||||
wxGridSizer *m_sizer_material;
|
||||
wxBoxSizer * m_sizer_main;
|
||||
wxBoxSizer * m_sizer_bottom;
|
||||
|
||||
bool m_need_adaptation_screen {false};
|
||||
wxScrolledWindow * m_scrollable_view;
|
||||
wxBoxSizer * m_sizer_scrollable_view;
|
||||
|
||||
wxPanel* m_scrollable_region;
|
||||
wxBoxSizer* m_sizer_scrollable_region;
|
||||
|
||||
wxWindow *select_bed{nullptr};
|
||||
wxWindow *select_flow{nullptr};
|
||||
wxWindow *select_timelapse { nullptr };
|
||||
wxWindow *select_use_ams{nullptr};
|
||||
CheckBox *ams_check{nullptr};
|
||||
|
||||
|
||||
void stripWhiteSpace(std::string& str);
|
||||
wxString format_text(wxString &m_msg);
|
||||
void update_ams_status_msg(wxString msg, bool is_warning = false);
|
||||
void update_priner_status_msg(wxString msg, bool is_warning = false);
|
||||
void update_print_status_msg(wxString msg, bool is_warning = false, bool is_printer = true);
|
||||
/*error info*/
|
||||
int m_print_error_code;
|
||||
std::string m_print_error_msg;
|
||||
std::string m_print_error_extra;
|
||||
|
||||
std::vector<MachineObject*> m_list;
|
||||
std::vector<FilamentInfo> m_filaments;
|
||||
std::vector<FilamentInfo> m_ams_mapping_result; /* ams mapping data */
|
||||
public:
|
||||
SelectMachineDialog(Plater *plater = nullptr);
|
||||
~SelectMachineDialog();
|
||||
|
||||
|
||||
void init_bind();
|
||||
void init_timer();
|
||||
void check_focus(wxWindow* window);
|
||||
void link_to_network_check();
|
||||
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();
|
||||
wxWindow* create_ams_checkbox(wxString title, wxWindow* parent, wxString tooltip);
|
||||
wxWindow* create_item_checkbox(wxString title, wxWindow* parent, wxString tooltip, std::string param);
|
||||
void update_select_layout(MachineObject *obj);
|
||||
void prepare_mode();
|
||||
void sending_mode();
|
||||
void finish_mode();
|
||||
void update_select_layout(MachineObject *obj);
|
||||
void prepare_mode();
|
||||
void sending_mode();
|
||||
void finish_mode();
|
||||
void sync_ams_mapping_result(std::vector<FilamentInfo>& result);
|
||||
void prepare(int print_plate_idx);
|
||||
void show_status(PrintDialogStatus status, std::vector<wxString> params = std::vector<wxString>());
|
||||
void sys_color_changed();
|
||||
void reset_timeout();
|
||||
void update_user_printer();
|
||||
void reset_ams_material();
|
||||
void update_show_status();
|
||||
void update_ams_check(MachineObject* obj);
|
||||
void on_rename_click(wxCommandEvent& event);
|
||||
void on_rename_enter();
|
||||
void update_printer_combobox(wxCommandEvent& event);
|
||||
void on_cancel(wxCloseEvent& event);
|
||||
void show_errors(wxString& info);
|
||||
void on_ok_btn(wxCommandEvent& event);
|
||||
void on_ok();
|
||||
void clear_ip_address_config(wxCommandEvent& e);
|
||||
void on_refresh(wxCommandEvent& event);
|
||||
void on_set_finish_mapping(wxCommandEvent& evt);
|
||||
void on_print_job_cancel(wxCommandEvent& evt);
|
||||
void set_default();
|
||||
void on_timer(wxTimerEvent& event);
|
||||
void on_selection_changed(wxCommandEvent& event);
|
||||
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 is_warning = false);
|
||||
void update_priner_status_msg(wxString msg, bool is_warning = false);
|
||||
void update_print_status_msg(wxString msg, bool is_warning = false, bool is_printer = true);
|
||||
void update_print_error_info(int code, std::string msg, std::string extra);
|
||||
void set_flow_calibration_state(bool state);
|
||||
bool is_show_timelapse();
|
||||
bool is_same_printer_model();
|
||||
bool has_tips(MachineObject* obj);
|
||||
bool is_timeout();
|
||||
bool Show(bool show);
|
||||
bool do_ams_mapping(MachineObject* obj_);
|
||||
bool get_ams_mapping_result(std::string& mapping_array_str, std::string& ams_mapping_info);
|
||||
|
||||
void sync_ams_mapping_result(std::vector<FilamentInfo>& result);
|
||||
bool do_ams_mapping(MachineObject *obj_);
|
||||
bool get_ams_mapping_result(std::string &mapping_array_str, std::string &ams_mapping_info);
|
||||
void prepare(int print_plate_idx);
|
||||
bool has_tips(MachineObject* obj);
|
||||
void show_status(PrintDialogStatus status, std::vector<wxString> params = std::vector<wxString>());
|
||||
wxString format_text(wxString &m_msg);
|
||||
wxWindow* create_ams_checkbox(wxString title, wxWindow* parent, wxString tooltip);
|
||||
wxWindow* create_item_checkbox(wxString title, wxWindow* parent, wxString tooltip, std::string param);
|
||||
wxImage * LoadImageFromBlob(const unsigned char *data, int size);
|
||||
PrintDialogStatus get_status() { return m_print_status; }
|
||||
|
||||
bool is_same_printer_model();
|
||||
void sys_color_changed();
|
||||
bool Show(bool show);
|
||||
|
||||
/* model */
|
||||
wxObjectDataPtr<MachineListModel> machine_model;
|
||||
std::shared_ptr<BBLStatusBarSend> m_status_bar;
|
||||
bool m_export_3mf_cancel{false};
|
||||
bool m_is_canceled { false };
|
||||
|
||||
protected:
|
||||
std::vector<MachineObject *> m_list;
|
||||
wxDataViewCtrl * m_dataViewListCtrl_machines{nullptr};
|
||||
wxStaticText * m_staticText_left{nullptr};
|
||||
wxHyperlinkCtrl * m_hyperlink_add_machine{nullptr};
|
||||
wxGauge * m_gauge_job_progress{nullptr};
|
||||
wxPanel * m_panel_status{nullptr};
|
||||
wxButton * m_button_cancel{nullptr};
|
||||
AmsMapingPopup m_mapping_popup{nullptr};
|
||||
AmsMapingTipPopup m_mapping_tip_popup{nullptr};
|
||||
AmsTutorialPopup m_mapping_tutorial_popup{nullptr};
|
||||
wxString m_current_project_name;
|
||||
std::string m_print_info;
|
||||
int timeout_count = 0;
|
||||
bool m_is_rename_mode{false};
|
||||
bool is_timeout();
|
||||
void reset_timeout();
|
||||
void update_user_printer();
|
||||
void reset_ams_material();
|
||||
void update_show_status();
|
||||
void update_ams_check(MachineObject* obj);
|
||||
bool is_show_timelapse();
|
||||
|
||||
wxTimer *m_refresh_timer { nullptr };
|
||||
|
||||
std::shared_ptr<PrintJob> m_print_job;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
void on_rename_click(wxCommandEvent &event);
|
||||
void on_rename_enter();
|
||||
|
||||
void update_printer_combobox(wxCommandEvent &event);
|
||||
void on_cancel(wxCloseEvent &event);
|
||||
void show_errors(wxString &info);
|
||||
void on_ok_btn(wxCommandEvent &event);
|
||||
void on_ok();
|
||||
void clear_ip_address_config(wxCommandEvent& e);
|
||||
void on_refresh(wxCommandEvent& event);
|
||||
void on_set_finish_mapping(wxCommandEvent &evt);
|
||||
void on_print_job_cancel(wxCommandEvent &evt);
|
||||
void set_default();
|
||||
void on_timer(wxTimerEvent& event);
|
||||
void on_selection_changed(wxCommandEvent &event);
|
||||
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 set_flow_calibration_state(bool state);
|
||||
wxImage * LoadImageFromBlob(const unsigned char *data, int size);
|
||||
std::vector<std::string> sort_string(std::vector<std::string> strArray);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue